Skip to content

Commit

Permalink
Update transpose.cu
Browse files Browse the repository at this point in the history
  • Loading branch information
linjames0 committed Sep 24, 2023
1 parent 5e11fac commit 3696523
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions transpose.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ __global__ void transpose(float *d_A, float *d_T, int M, int N) {
int row = blockIdx.y * blockDim.y + threadIdx.y;
int col = blockIdx.x * blockDim.x + threadIdx.x;

// swap elements via transpose
if (row < M && col < N) {
d_T[col * M + row] = d_A[row * N + col];
}
Expand Down

0 comments on commit 3696523

Please sign in to comment.