add comment on reduce cuda
This commit is contained in:
parent
12eb38a940
commit
b56ed81cd7
2 changed files with 1 additions and 1 deletions
0
.gitmodules
vendored
0
.gitmodules
vendored
|
|
@ -136,7 +136,7 @@ __global__ void sum_tensor_cuda_kernel(float* data, float* result_data, int size
|
|||
__syncthreads();
|
||||
|
||||
// Perform block-wise reduction
|
||||
for (int s = blockDim.x / 2; s > 0; s >>= 1) {
|
||||
for (int s = blockDim.x / 2; s > 0; s >>= 1) { // s>>=1 --> s = s/2
|
||||
if (tid < s) {
|
||||
partial_sum[tid] += partial_sum[tid + s];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue