-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Add support for free function kernel builtins #15938
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
Conversation
Support for the following three builtins are added: __builtin_sycl_is_single_task_kernel(function-pointer) __builtin_sycl_is_nd_range_kernel(function-pointer, dimension) __builtin_sycl_is_kernel(function-pointer) __builtin_sycl_is_single_task_kernel returns true if the function pointer represents a function with the IR attribute "sycl-single-task-kernel". __builtin_sycl_is_nd_range_kernel returns true if the function pointer represents a function with the IR attribute "sycl-single-task-kernel" with a matching dimension. __builtin_sycl_is_kernel returns true if the function pointer represents a function with either of the two IR attributes.
5add9a9
to
e4face5
Compare
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.
Sorry for the delay in review. This one slipped through the cracks
.getZExtValue(); | ||
// Return true only if the dimensions match. | ||
if (std::stoul(NVPair.second) == Dim) | ||
return RValue::get( |
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.
Can you explain what passing the type to the getTrue( )
API does here? Is it possible to just return 0 or 1 if you are converting to ConstantInt
anyway?
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.
I am not that familiar with this - but passing the type makes the function return a true value in the context of the type. There is another interface for getTrue, but it takes the LLVM context as its argument and returns a true value in that context. Passing the type made more sense and that is what other builtins seem to do too.
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.
Thank you for explaining
@intel/llvm-gatekeepers, this PR may be merged. Thanks. |
Support for the following three builtins are added: __builtin_sycl_is_single_task_kernel(function-pointer) __builtin_sycl_is_nd_range_kernel(function-pointer, dimension) __builtin_sycl_is_kernel(function-pointer)
__builtin_sycl_is_single_task_kernel returns true if the function pointer represents a function with the IR attribute "sycl-single-task-kernel".
__builtin_sycl_is_nd_range_kernel returns true if the function pointer represents a function with the IR attribute "sycl-single-task-kernel" with a matching dimension.
__builtin_sycl_is_kernel returns true if the function pointer represents a function with either of the two IR attributes.