Skip to content

Commit 49b6e15

Browse files
committed
update
1 parent 329330e commit 49b6e15

File tree

1 file changed

+2
-6
lines changed
  • Book_BJ/Chap9/9_2_MatMul_sharedMemory

1 file changed

+2
-6
lines changed

Book_BJ/Chap9/9_2_MatMul_sharedMemory/9_2.cu

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,13 @@ __global__ void matMul_kernel_shared(float* _A, float* _B, float* _C)
6767
for (int k = 0; k < K_SIZE; k++)
6868
sB[k][col] = _B[col + k * COL_SIZE];
6969
}
70-
else if (col == 0 ) { // read matrix A
70+
if (col == 0 ) { // read matrix A
7171
for (int k = 0; k < K_SIZE; k++)
7272
sA[row][k] = _A[row * K_SIZE + k];
7373

7474
}
75-
if (row == 0 && col == 0) { // read the first row of A
76-
for (int k = 0; k < K_SIZE; k++)
77-
sA[row][k] = _A[row * K_SIZE + k];
78-
}
7975

80-
__syncthreads(); // wait until all thread load the matrix
76+
__syncthreads(); // wait until all threads load the matrix
8177

8278
float result = 0;
8379
for (int k = 0; k < K_SIZE; k++)

0 commit comments

Comments
 (0)