Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lecture_009/segment_reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

__global__ void SharedMemoryReduction(float* input, float* output, int n) {
__shared__ float input_s[BLOCK_DIM];
unsigned int idx = blockIdx.x * blockDim.x + threadIdx.x; // index within a block
unsigned int t = threadIdx.x; // global index
unsigned int idx = blockIdx.x * blockDim.x + threadIdx.x; // global index
unsigned int t = threadIdx.x; // index within a block

// Load elements into shared memory
if (idx < n) {
Expand Down