-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Implement device_has kernel property and macro #7159
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
[SYCL] Implement device_has kernel property and macro #7159
Conversation
This commit implements the `device_has` kernel property and the SYCL_EXT_ONEAPI_FUNCTION_PROPERTY macro from the [sycl_ext_oneapi_kernel_properties](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_kernel_properties.asciidoc) extension. Known current limitations: - The LLVM IR attributes from add_ir_attributes_function are not correctly generated on SYCL_EXTERNAL functions. - The SYCL_EXT_ONEAPI_FUNCTION_PROPERTY cannot currently be placed after SYCL_EXTERNAL. Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
Signed-off-by: Larsen, Steffen <[email protected]>
This is currently a restriction in Clang's parsing of attributes, which to my knowledge is being loosened in upstream. @gmlueck & @Pennycook - Would it make sense to accept the limitation for now and add a note about it in the extension instead of finding a work-around? |
I think so; this would unblock developers who are waiting on function properties, and we could get more implementation experience. Also, Clang's handling of attributes and |
OK with me too, but we should add a NOTE in the Status section about the restriction. Just curious ... SYCL_EXTERNAL also expands to a C++ attribute. What is the restriction in Clang that prevents arbitrary ordering? Since they're both attributes, it seems surprising that Clang cares about their order. |
It is only a problem because one uses the |
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
Do we know why |
I am for changing it, but I think it would be safer to defer it to after attribute lists are made order-agnostic. As soon as that happens I don't see why us changing it would cause user-code breaks as they do not use it directly but rather through the |
Signed-off-by: Larsen, Steffen <[email protected]>
This commit implements the
device_has
kernel property and the SYCL_EXT_ONEAPI_FUNCTION_PROPERTY macro from thesycl_ext_oneapi_kernel_properties extension.
Known current limitations: