Skip to content

Commit

Permalink
Update softmax.cu
Browse files Browse the repository at this point in the history
  • Loading branch information
linjames0 authored Sep 20, 2023
1 parent eb7af93 commit 79ceadd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions softmax.cu
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ __global__ void softmax(float *d_in, float *d_out, float *expArr, float *redArr,
redArr[N + i] = 0;
}

__syncthreads();
__syncthreads();

// parallel reduction to compute sum
for(int stride = 1 << padding; stride >= 1; stride /= 2) {
if(col < stride) {
redArr[col] += redArr[col + stride];
// parallel reduction to compute sum
for(int stride = 1 << padding; stride >= 1; stride /= 2) {
if(col < stride) {
redArr[col] += redArr[col + stride];
}
}
}
Expand Down

0 comments on commit 79ceadd

Please sign in to comment.