-
Notifications
You must be signed in to change notification settings - Fork 738
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] atomic_memory_order_capabilities query for device and context #8517
[SYCL] atomic_memory_order_capabilities query for device and context #8517
Conversation
This satsifies llvm-test-suite/SYCL/AtomicRef/atomic-memory-order.cpp if you remove the "UNSUPPORTED OpenCL" test line, but doesn't implement the other capabilities this could return. Further discussion is required for further work to continue.
Minimal implementaton for now that calls similar query for each device and combines them. Currently checks for memory_order::relaxed, others coming soon.
Covering all current OpenCL versions
Return full set of them as in OCL 2.x
Instead of resolving it as its own plugin call with PI code, just call the related one for each of its devices and intersect the results together.
Unsure whether ACQUIRE and RELEASE need removing as current pi.h expects 5 bits for memory order info but the OCL headers say only 3 are necessary in 3.0 as the values are RELAXED, ACQ_REL, and SEQ_CST.
ACQ_REL infers ACQUIRE and RELEASE, so adding them to the return value.
This will need to wait for #8595 to be merged first to resolve potential merge conflicts. |
Moved mask location, added bitwise operations to convert CL to PI enum values, masked off relevant bits, and improved handling of out parameters.
40a96e4
to
58c53ad
Compare
…om/andylshort/llvm into alamzeds/atomic_mem_order_caps_fix
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
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. LGTM!
I'm just testing a patch that addresses this comment from #8586 (comment) as there now are UR equivalents of the PI flags I needed, so just need to hold fire on the merge for a short while. |
My comments were resolved, dismissing that review
…ntel#8517) This patch implements the `atomic_memory_order_capabilities` query in the OpenCL and Level Zero backends/plugins for `device` and `context` Specifically: - OpenCL <2.0 returns the minimum required capability set (`relaxed`) defined in [Section 4.2 of the OpenCL 3.0 specification](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES). - OpenCL <3.0 and Level Zero backends return all memory order capabilities. - OpenCL >=3.0 queries the actual device to get the supported memory order capabilities. E2E test have also been updated to reflect these changes: intel/llvm-test-suite#1627
This patch implements the
atomic_memory_order_capabilities
query in the OpenCL and Level Zero backends/plugins fordevice
andcontext
Specifically:
relaxed
) defined in Section 4.2 of the OpenCL 3.0 specification.E2E test have also been updated to reflect these changes: intel/llvm-test-suite#1627