-
Notifications
You must be signed in to change notification settings - Fork 797
[SYCL][PI] Change const to constexpr to make GCC happy #1017
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
Signed-off-by: James Brodman <[email protected]>
Only the latest VS accepts "constexpr". Are we ok with some preprocessor #if s? Clang/MSVC take "const". GCC before 7.2 requires "constexpr" |
Signed-off-by: James Brodman <[email protected]>
Also we can consider using array of strings and enum values of which maps to corresponding values in the array:
|
I suggest to submit the change to unblock the build and then implement improvements |
Signed-off-by: James Brodman <[email protected]>
Ok I have no clue why that test failed. |
This is flacky test. Please ignore it. |
CONSTFIX char clEnqueueMemcpyName[] = "clEnqueueMemcpyINTEL"; | ||
CONSTFIX char clEnqueueMigrateMemName[] = "clEnqueueMigrateMemINTEL"; | ||
CONSTFIX char clEnqueueMemAdviseName[] = "clEnqueueMemAdviseINTEL"; | ||
CONSTFIX char clGetMemAllocInfoName[] = "clGetMemAllocInfoINTEL"; |
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 was actually thinking to just
auto constexpr clHostMemAllocName = "clHostMemAllocINTEL";
but it might not work on some old compilers... Who cares about old compilers? SYCL is about the future. :-)
CONSTFIX char clEnqueueMemAdviseName[] = "clEnqueueMemAdviseINTEL"; | ||
CONSTFIX char clGetMemAllocInfoName[] = "clGetMemAllocInfoINTEL"; | ||
|
||
#undef CONSTFIX |
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.
__SYCL_CONST_FIX
to limit the risk of collision?
…#1017) The behavior of -fsycl-instrument-device-code has modified the requirements for tests which perform separate compilation. Update these tests to pull in the needed device code to alleviate issues as seen below: Error: unimplemented function(s) used: __itt_offload_wi_start_wrapper is undefined __itt_offload_wi_finish_wrapper is undefined CompilerException Failed to parse IR -17 (CL_LINK_PROGRAM_FAILURE) Signed-off-by: Michael D Toguchi [email protected]
GCC older than 7.2 requires constexpr instead of const.
Signed-off-by: James Brodman [email protected]