Skip to content

Commit

Permalink
fix: GPU complex reducer prod for empty lists (#3235)
Browse files Browse the repository at this point in the history
* fix: make sure that both CPU and GPU produce identical results

* fix: one more
  • Loading branch information
ianna authored Sep 12, 2024
1 parent a0b3858 commit 7a825bf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ awkward_reduce_prod_complex_a(
int64_t thread_id = blockIdx.x * blockDim.x + threadIdx.x;

if (thread_id < outlength) {
toptr[thread_id * 2] = (T)1.0f;
toptr[thread_id * 2 + 1] = (T)0.0f;
toptr[thread_id * 2] = (T)1;
toptr[thread_id * 2 + 1] = (T)0;
}
}
}
Expand Down Expand Up @@ -59,8 +59,8 @@ awkward_reduce_prod_complex_b(

if (thread_id < lenparents) {
for (int64_t stride = 1; stride < blockDim.x; stride *= 2) {
T real = (T)1.0f;
T imag = (T)0.0f;
T real = (T)1;
T imag = (T)0;
if (idx >= stride && thread_id < lenparents && parents[thread_id] == parents[thread_id - stride]) {
real = temp[(idx - stride) * 2];
imag = temp[(idx - stride) * 2 + 1];
Expand Down

0 comments on commit 7a825bf

Please sign in to comment.