diff --git a/projects/hip-tests/catch/include/hip_test_kernels.hh b/projects/hip-tests/catch/include/hip_test_kernels.hh index 68f452ba53..e47614ee65 100644 --- a/projects/hip-tests/catch/include/hip_test_kernels.hh +++ b/projects/hip-tests/catch/include/hip_test_kernels.hh @@ -93,7 +93,12 @@ template __global__ void vector_square(const T* A_d, T* C_d, size_t size_t gputhread = (blockIdx.x * blockDim.x + threadIdx.x); size_t stride = blockDim.x * gridDim.x; for (size_t i = gputhread; i < N_ELMTS; i += stride) { +#if HT_AMD + T result = A_d[i] * A_d[i]; + __hip_atomic_store(&C_d[i], result, __ATOMIC_RELAXED, __HIP_MEMORY_SCOPE_SYSTEM); +#else C_d[i] = A_d[i] * A_d[i]; +#endif } }