Created
August 10, 2014 19:24
-
-
Save johnwalley/99f26d1f677a1dc6d834 to your computer and use it in GitHub Desktop.
Simple matrix-vector multiplication kernel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__global__ void multiplyKernel(float *c, const float *a, const float *b, const int size) { | |
int index = threadIdx.x + blockIdx.x * blockDim.x; | |
c[index] = 0; | |
for (int j = 0; j < size; ++j) | |
c[index] += a[index * size + j] * b[index]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment