Skip to content
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

atomic types (half2, bf162, float2, float4) #16488

Open
jinz2014 opened this issue Dec 30, 2024 · 1 comment
Open

atomic types (half2, bf162, float2, float4) #16488

jinz2014 opened this issue Dec 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jinz2014
Copy link
Contributor

Is your feature request related to a problem? Please describe

error: static assertion failed due to requirement 'detail::IsValidAtomicRefType<sycl::vec<sycl::detail::half_impl::half, 2>>::value': Invalid atomic type. Valid types are int, unsigned int, long, unsigned long, long long, unsigned long long, sycl::half, float, double and pointer types

Describe the solution you would like

The float2 and float4 floating-point vector versions of atomicAdd() are only supported by devices of compute capability 9.x and higher. The atomicity of the float2 or float4 add operation is guaranteed separately for each of the two or four float elements; the entire float2 or float4 is not guaranteed to be atomic as a single 64-bit or 128-bit access.

The 16-bit __half floating-point version of atomicAdd() is only supported by devices of compute capability 7.x and higher.

The 16-bit __nv_bfloat16 floating-point version of atomicAdd() is only supported by devices of compute capability 8.x and higher.

The float2 and float4 floating-point vector versions of atomicAdd() are only supported by devices of compute capability 9.x and higher.

The float2 and float4 floating-point vector versions of atomicAdd() are only supported for global memory addresses.

Describe alternatives you have considered

No response

Additional context

No response

@jinz2014 jinz2014 added the enhancement New feature or request label Dec 30, 2024
@Pennycook
Copy link
Contributor

The atomicity of the float2 or float4 add operation is guaranteed separately for each of the two or four float elements; the entire float2 or float4 is not guaranteed to be atomic as a single 64-bit or 128-bit access.

This is not compatible with the semantics of std::atomic_ref, so it isn't compatible with the semantics of sycl::atomic_ref.

If you don't care whether the components of the vector are actually handled atomically, couldn't you create a separate sycl::atomic_ref for each component of the vector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants