-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][CUDA] Support device ID and UUID in the CUDA Plugin #8203
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
The code changes reported by lint are not consistent with the coding style in the plugin. |
I believe the CI uses |
No, I just looked at other codes in the plugin, and then follow that style. |
The linter is consistent, there's other parts of the plugins that are formatted like it is suggesting here, and all of the plugin code has gone through the linter. It's just that the rules it uses to format are not always directly obvious, for example for this: sycl::detail::pi::assertion(
- cuDeviceGetAttribute(&value,
- CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID,
+ cuDeviceGetAttribute(&value, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID,
device->get()) == CUDA_SUCCESS); If you look at other places that have it like this, they have enums with longer names that wouldn't fit on the first line in 80 columns. Line breaking rules can get very tricky in C++, and that's why we should trust the linter even if it's not always the prettiest. So could you update the code as the linter is suggesting? And in general I suggest using Other than that the patch looks good to me 👍 |
|
||
case PI_DEVICE_INFO_UUID: { | ||
int driver_version = 0; | ||
cuDriverGetVersion(&driver_version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the CUDA docs it looks like this can only return an error if the parameter is nullptr
, so I think this should be fine, see:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@zjin-lcf, thanks for contributing this! |
I want to thank the reviewers for their comments. |
This PR tries to enable the accesses to device ID and UUID with the CUDA driver APIs. Thank you for your review.
Reference
https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/supported/sycl_ext_intel_device_info.md