Skip to content

Commit

Permalink
Check for atomicAdd
Browse files Browse the repository at this point in the history
  • Loading branch information
nshmyrev committed Apr 17, 2023
1 parent 0fee1c1 commit 9b90d1e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cudafeat/feature-online-batched-cmvn-cuda-kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ __host__ __device__ inline float2 operator+(const float2 &a, const float2 &b) {
return retval;
}

#if __CUDA_API_VER_MAJOR__ < 12
__device__ inline void atomicAdd(float2 *addr, float2 val) {
atomicAdd(reinterpret_cast<float *>(addr), val.x);
atomicAdd(reinterpret_cast<float *>(addr) + 1, val.y);
}
#endif

__device__ inline void operator+=(float2 &a, float2 &b) {
// overloading +=
Expand Down

0 comments on commit 9b90d1e

Please sign in to comment.