Skip to content

Commit

Permalink
Fix bad dot group initialiser in HIP and CUDA
Browse files Browse the repository at this point in the history
  • Loading branch information
tom91136 committed Oct 7, 2023
1 parent e347d2f commit f2f7f3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cuda/CUDAStream.cu
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ __global__ void dot_kernel(const T * a, const T * b, T * sum, int array_size)
int i = blockDim.x * blockIdx.x + threadIdx.x;
const size_t local_i = threadIdx.x;

tb_sum[local_i] = 0.0;
tb_sum[local_i] = {};
for (; i < array_size; i += blockDim.x*gridDim.x)
tb_sum[local_i] += a[i] * b[i];

Expand Down
2 changes: 1 addition & 1 deletion src/hip/HIPStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ __global__ void dot_kernel(const T * a, const T * b, T * sum, int array_size)
const size_t local_i = threadIdx.x;
size_t i = blockDim.x * blockIdx.x + local_i;

tb_sum[local_i]{};
tb_sum[local_i] = {};
for (; i < array_size; i += blockDim.x*gridDim.x)
tb_sum[local_i] += a[i] * b[i];

Expand Down

0 comments on commit f2f7f3a

Please sign in to comment.