Skip to content

[SYCL][HIP] Vendor ID for AMD devices is expected to be 4098 #6127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 27, 2022
Merged

[SYCL][HIP] Vendor ID for AMD devices is expected to be 4098 #6127

merged 7 commits into from
May 27, 2022

Conversation

zjin-lcf
Copy link
Contributor

@zjin-lcf zjin-lcf commented May 9, 2022

A pull request to solve the issue #6123
Thanks for your review.

@zjin-lcf zjin-lcf requested a review from a team as a code owner May 9, 2022 20:09
@zjin-lcf zjin-lcf requested a review from cperkinsintel May 9, 2022 20:09
@@ -980,7 +980,7 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name,
PI_DEVICE_TYPE_GPU);
}
case PI_DEVICE_INFO_VENDOR_ID: {
return getInfo(param_value_size, param_value, param_value_size_ret, 4318u);
return getInfo(param_value_size, param_value, param_value_size_ret, 4098u);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what vendor ID is returned when DPC++ was built with HIP NVIDIA support?

Copy link
Contributor Author

@zjin-lcf zjin-lcf May 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion. I don't have a platform for the test, but updated the codes:

 case PI_DEVICE_INFO_VENDOR_ID: {
#if defined(__HIP_PLATFORM_AMD__)
    pi_uint32 vendor_id = 4098u;
#elif defined(__HIP_PLATFORM_NVIDIA__)
    pi_uint32 vendor_id = 4318u;
#else
    pi_uint32 vendor_id = 0u;
#endif
    return getInfo(param_value_size, param_value, param_value_size_ret, vendor_id);
  }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zjin-lcf - Are you planning on incorporating the changes you mention here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the box 'Allow edits and access to secrets by maintainers', so assumed that reviewers could incorporate the changes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to let you know that I'm not a maintainer so I can't push the changes. Can you please push them for me?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I updated the codes for pull request.

@pvchupin pvchupin added the hip Issues related to execution on HIP backend. label May 10, 2022
@pvchupin pvchupin requested a review from AerialMantis May 10, 2022 19:26
@pvchupin pvchupin changed the title Vendor ID for AMD devices is expected to be 4098 [SYCL][HIP] Vendor ID for AMD devices is expected to be 4098 May 10, 2022
steffenlarsen
steffenlarsen previously approved these changes May 19, 2022
Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AerialMantis | @npmiller - Could you please have a look?

npmiller
npmiller previously approved these changes May 20, 2022
The indentation needs to be clang-formatted

Co-authored-by: Nicolas Miller <nicolas.pierre.miller@gmail.com>
@zjin-lcf zjin-lcf dismissed stale reviews from npmiller and steffenlarsen via c2b48d7 May 20, 2022 11:08
@zjin-lcf
Copy link
Contributor Author

@npmiller
Thank you for your comment. How do you format codes automatically ?

@npmiller
Copy link
Contributor

@npmiller Thank you for your comment. How do you format codes automatically ?

You should use clang-format for DPC++/LLVM code, there's some pointers about how to use it to format patches here:

And it can also be integrated with IDEs or editors (for example I personally use this plugin to call it directly from vim: https://github.com/frasercrmck/formative.vim )

@steffenlarsen
Copy link
Contributor

How do you format codes automatically ?

You can also use https://github.com/intel/llvm/blob/sycl/clang/tools/clang-format/clang-format-diff.py to apply clang-format from a diff. See the comment at the top of the file. The PR testing should also tell us when things are not formatted in accordance with recent clang-format, though it seems testing did not run for this PR until now.

It should also be possible to create a git hook for it.

@densamoilov
Copy link

@zjin-lcf, is there anything else that needs to be done to merge this PR?

@zjin-lcf
Copy link
Contributor Author

Opening the check report shows many lld errors:
error: undefined hidden symbol: __spirv_Group*(unsigned int, unsigned int, int)
These errors are specific to the HIP plugin interface #6185

@steffenlarsen
Copy link
Contributor

Failing tests were disabled in intel/llvm-test-suite#1034. I believe this is ready to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hip Issues related to execution on HIP backend.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants