-
Notifications
You must be signed in to change notification settings - Fork 751
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::kernel_handler::get_specialization_constant
calls __sycl_getComposite2020SpecConstantValue
on enumerated value_type
#12703
Comments
@victor-eds please, attach the code. |
Added inline |
Some massaging of our llvm/sycl/include/sycl/kernel_handler.hpp Lines 66 to 85 in 5fae0aa
We have a simple switch between |
According to cppreference, enums are scalar types. Maybe using |
Fixed by #12925 |
Describe the bug
sycl::kernel_handler::get_specialization_constant
calls__sycl_getComposite2020SpecConstantValue
instead of__sycl_getScalar2020SpecConstantValue
. Enumerated types have the same size, value representation and alignment requirements as their underlying integral types, so we could be simply using the scalar version of the builtin.To Reproduce
Compile the following code:
You'll see the
@_Z40__sycl_getComposite2020SpecConstantValueI7my_enumET_PKcPKvS5_
function being called to get the specialization constant value instead of the scalar version of the function.Environment (please complete the following information):
effbbabcd6e3
Additional context
This should have the exact same semantics, but using the scalar builtin leads to a simpler compilation path.
Changing the check in
kernel_handler.hpp
so that the scalar version accepts enumerated types might be enough.The text was updated successfully, but these errors were encountered: