Created
July 13, 2015 20:09
-
-
Save JCaskey/12728199f10c0cd47539 to your computer and use it in GitHub Desktop.
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
// Kernel | |
__global__ void testKernel(float* d_array, int size){ | |
// Index | |
int idx = blockIdx.x *blockDim.x + threadIdx.x; | |
// Initialize | |
d_array[idx] = 0; | |
// Loop | |
for(int i = 0; i < 1000; ++i){ | |
// Condition | |
if(idx % 2 == 0){ | |
d_array[idx] = idx + i + 1; | |
} | |
else{ | |
d_array[idx] = idx + i + 2; | |
} | |
} | |
} |
allanmac
commented
Jul 13, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment