Skip to content

Commit

Permalink
Update matAdd.cu
Browse files Browse the repository at this point in the history
  • Loading branch information
linjames0 authored Sep 20, 2023
1 parent a45cb5f commit 3dcc52c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion matAdd.cu
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ int main() {
cudaMemcpy(d_A, A, N * M * sizeof(float), cudaMemcpyHostToDevice);
cudaMemcpy(d_B, B, N * M * sizeof(float), cudaMemcpyHostToDevice);
cudaMemcpy(d_C, C, N * M * sizeof(float), cudaMemcpyHostToDevice);


// launch kernel instance
dim3 blockDim(16, 16);
dim3 gridDim((M + blockDim.x - 1)/blockDim.x, (N + blockDim.y - 1)/blockDim.y);
matAdd<<<gridDim, blockDim>>>(d_A, d_B, d_C, N, M);
Expand Down

0 comments on commit 3dcc52c

Please sign in to comment.