-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][HIP] Fix max constant memory device query #5168
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
This fixes the `Basic/info.cpp` test for HIP AMD. The issue here is that AMD GPU report a very large constant memory (confirmed using `clinfo` as well). But the HIP entry point to query that information takes a `int*`. So the value will show up as negative, even though it's the correct value. So remove the assertion on if the value is positive and cast it back to `unsigned` before returning it.
This will be fixed in intel/llvm#5168
sycl/plugins/hip/pi_hip.cpp
Outdated
return getInfo(param_value_size, param_value, param_value_size_ret, | ||
pi_uint64(constant_memory)); | ||
pi_uint64(static_cast<unsigned int>(constant_memory))); |
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't you just make the constant_memory
be unsigned int
?
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.
The problem is hipDeviceGetAttribute
takes a int *
, so we do need a cast, either here, or I can make constant_memory
a unsigned int
and cast the pointer when calling hipDeviceGetAttribute
.
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.
make constant_memory a unsigned int and cast the pointer when calling hipDeviceGetAttribute
Let's do so. Not sure the cast would be really needed.
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.
Updated as suggested, however a cast is still needed, without it complains with the following:
llvm/sycl/plugins/hip/pi_hip.cpp:1320:31: error: invalid conversion from ‘unsigned int*’ to ‘int*’ [-fpermissive]
hipDeviceGetAttribute(&constant_memory,
^~~~~~~~~~~~~~~~
This will be fixed in intel/llvm#5168
This will be fixed in intel#5168
This fixes the
Basic/info.cpp
test for HIP AMD.The issue here is that AMD GPU report a very large constant memory
(confirmed using
clinfo
as well). But the HIP entry point to querythat information takes a
int*
. So the value will show up as negative,even though it's the correct value.
So remove the assertion on if the value is positive and cast it back to
unsigned
before returning it.