kenel2 has repeated calculations
dim3 gridDim(CEIL_DIV(M, 32), CEIL_DIV(N, 32));
dim3 blockDim(32 * 32);
// BLOCKSIZE=32
const int cRow = blockIdx.x * BLOCKSIZE + (threadIdx.x / BLOCKSIZE);
const int cCol = blockIdx.y * BLOCKSIZE + (threadIdx.x % BLOCKSIZE);
I think there is a problem, threadIdx.y is not used for cRow and cCol, which cause different threads(has diff value of threadIdx.y) to do the same work.
关闭于 2025-04-29 2 条评论