I wanted to fill an array with random numbers (I use cuRand
), but what a surprise when I noticed that although being apparently random, every time that I run the code (I'm talking about different executions) there they are, always the same numbers (not so random). I proceeded to check my seed, and I received always the same value which was 1462615827
. I tried to make it unsigned and I receive the exact same value. What could possibly happen in this idyllic code?
unsigned long seed1 = unsigned(time(NULL));
printf("%lu\n", seed1);
//The same number is printed every execution
EDIT: The most strange thing happened. I saved the work on my network disk, and restarted my pc. It wont work (I think the motherboard crashed). I just continued working on another PC and the seed was perfectly taken. So, Could it be a hardware failure?