-
Notifications
You must be signed in to change notification settings - Fork 744
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] Add prototype of atomic_ref<T*> #2177
Conversation
Enables partial specialization of atomic_ref for pointer types. Implementation assumes that both host and device pointers can be stored in a uintptr_t, but uses compare_exchange to implement pointer arithmetic rather than make assumptions about how pointers will be represented on different devices. Signed-off-by: John Pennycook <[email protected]>
Triggers a pointer validity check that isn't required here. Signed-off-by: John Pennycook <[email protected]>
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
sycl/doc/extensions/README.md
Outdated
@@ -13,7 +13,7 @@ DPC++ extensions status: | |||
| [SYCL_INTEL_deduction_guides](deduction_guides/SYCL_INTEL_deduction_guides.asciidoc) | Supported | | | |||
| [SYCL_INTEL_device_specific_kernel_queries](DeviceSpecificKernelQueries/SYCL_INTEL_device_specific_kernel_queries.asciidoc) | Proposal | | | |||
| [SYCL_INTEL_enqueue_barrier](EnqueueBarrier/enqueue_barrier.asciidoc) | Supported(OpenCL, Level Zero) | | | |||
| [SYCL_INTEL_extended_atomics](ExtendedAtomics/SYCL_INTEL_extended_atomics.asciidoc) | Partially supported(OpenCL: CPU, GPU) | Not supported: pointer types | | |||
| [SYCL_INTEL_extended_atomics](ExtendedAtomics/SYCL_INTEL_extended_atomics.asciidoc) | Supported(OpenCL) | | |
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.
Does it mean FPGAs also gain support for atomic_ref? Should we enable tests on FPGA emulator as well then?
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.
Ah, no. That's a mistake -- good catch. I should have changed it from "Partially supported" to "Supported", but left the set of supported platforms the same. Fixed in 0c19be3.
Should be fully supported, but only a subset of devices. Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
…rogram * upstream/sycl: [SYCL] Add barrier before leader guard in LowerWGSCope pass (intel#2208) [SYCL] Add prototype of atomic_ref<T*> (intel#2177) Revert "[SYCL] Disallow mutable lambdas (intel#1785)" (intel#2213)
Enables partial specialization of atomic_ref for pointer types.
Implementation assumes that both host and device pointers can be stored
in a uintptr_t, but uses compare_exchange to implement pointer arithmetic
rather than make assumptions about how pointers will be represented on
different devices.
Signed-off-by: John Pennycook [email protected]
There are a few changes in the tests that may not be obvious to reviewers, so capturing those here:
std::numeric_limits<T>::max()
isn't defined forT*
, but tests only ever required that the sentinel value was outside the range of the group.int
toT*
, and the simplest fix was to usesize_t
to store the work-item ID in those tests (since it's defined to be asize_t
anyway).min
andmax
tests mistakenly included comments referencing the pointer specialization, so I removed them -- not addingfetch_min
andfetch_max
to the pointer specialization ofatomic_ref
is deliberate