Skip to content

Commit 28bcdec

Browse files
authored
Merge pull request #1 from ahorek/initcuda
init cuda
2 parents 79311e0 + ab191fd commit 28bcdec

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

main.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4835,6 +4835,11 @@ int main(int argc, char **argv) {
48354835
}
48364836
#endif
48374837

4838+
CUresult code = cuInit(0);
4839+
if (code != CUDA_SUCCESS) {
4840+
fprintf(stderr, "Cuda Init: %s (code %d)\n", code);
4841+
exit(EXIT_FAILURE);
4842+
}
48384843
GPU_ASSERT(cudaSetDevice(device));
48394844
// int numBlocks;
48404845
cudaDeviceProp prop;

0 commit comments

Comments
 (0)