Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __global__ void matrixMultiplication(matrixCol *A, matrixCol *B, matrixCol *C, int N)
- {
- long long row = blockIdx.y*blockDim.y + threadIdx.y;
- long long col = blockIdx.x*blockDim.x + threadIdx.x;
- if (row < N && col < N){
- float sum = 0.f;
- for (long long n = 0; n < N; ++n)
- sum += A[row].col[n] * B[n].col[col];
- C[row].col[col] = sum;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement