I'm trying to run CUDA program to generate random numbers by using cuRAND library on Google Colab but I am getting a linker issue.
I know,we can fix this by using -lcurand while compiling with nvcc, but as far as I know, we cannot access terminal in colab.
I'm using this to generate 2*N random numbers.
#include <curand_kernel.h>
int status;
curandGenerator_t gen;
status = curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_MRG32K3A);
status |= curandSetPseudoRandomGeneratorSeed(gen, 4294967296ULL^time(NULL));
status |= curandGenerateUniform(gen, randomnums, (2*N));
status |= curandDestroyGenerator(gen);
Error:
/tmp/tmpxft_000006b3_00000000-10_11f5cb12-9471-4d0d-9dcb-659af6ee1dae.o: In function `main':
tmpxft_000006b3_00000000-5_11f5cb12-9471-4d0d-9dcb-659af6ee1dae.cudafe1.cpp:(.text+0xb0): undefined reference to `curandCreateGenerator'
tmpxft_000006b3_00000000-5_11f5cb12-9471-4d0d-9dcb-659af6ee1dae.cudafe1.cpp:(.text+0xdc): undefined reference to `curandSetPseudoRandomGeneratorSeed'
tmpxft_000006b3_00000000-5_11f5cb12-9471-4d0d-9dcb-659af6ee1dae.cudafe1.cpp:(.text+0xfa): undefined reference to `curandGenerateUniform'
tmpxft_000006b3_00000000-5_11f5cb12-9471-4d0d-9dcb-659af6ee1dae.cudafe1.cpp:(.text+0x109): undefined reference to `curandDestroyGenerator'
collect2: error: ld returned 1 exit status