-
Notifications
You must be signed in to change notification settings - Fork 802
[SYCL][CUDA] atomic_ref.fetch_add used for fp64 reduction if device.has(atomic64) #3950
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
Changes from 5 commits
f95f28c
80c8508
b1a8a7d
70a2c54
ab8a600
49ec72a
3b4bc5b
b4bde0c
6a0f948
24ee26e
471ccde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -233,6 +233,28 @@ template <> struct get_device_info<bool, info::device::queue_profiling> { | |
| } | ||
| }; | ||
|
|
||
| // Specialization for atomic64 that is necessary because | ||
| // PI_DEVICE_INFO_ATOMIC_64 isn't implemented for backend other than cuda. | ||
| // TODO the if-statement can be removed when the other backends support | ||
| // PI_DEVICE_INFO_ATOMIC_64. | ||
|
||
| template <> struct get_device_info<bool, info::device::atomic64> { | ||
| static bool get(RT::PiDevice dev, const plugin &Plugin) { | ||
|
|
||
| bool result = false; | ||
|
|
||
| platform plt = | ||
| get_device_info<platform, info::device::platform>::get(dev, Plugin); | ||
|
|
||
| if (plt.get_backend() == backend::cuda) { | ||
|
||
| Plugin.call<PiApiKind::piDeviceGetInfo>( | ||
| dev, pi::cast<RT::PiDeviceInfo>(info::device::atomic64), | ||
| sizeof(result), &result, nullptr); | ||
| } | ||
|
|
||
| return (result); | ||
| } | ||
| }; | ||
|
|
||
| // Specialization for exec_capabilities, OpenCL returns a bitfield | ||
| template <> | ||
| struct get_device_info<vector_class<info::execution_capability>, | ||
|
|
@@ -613,6 +635,10 @@ template <> inline bool get_device_info_host<info::device::image_support>() { | |
| return true; | ||
| } | ||
|
|
||
| template <> inline bool get_device_info_host<info::device::atomic64>() { | ||
| return false; | ||
| } | ||
|
|
||
| template <> | ||
| inline cl_uint get_device_info_host<info::device::max_read_image_args>() { | ||
| // current value is the required minimum | ||
|
|
||
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.
Technically, there are
int64_base_atomicsandint64_extended_atomicsthat overlap withatomic64. Shouldn't we deprecateint64_*_atomicsaspects?