Cuda program does not give the correct output when using a CUDA compatible GPU

admin

Administrator
Staff member
I found the following program from <a href="http://llpanorama.wordpress.com/2008/05/21/my-first-cuda-program/" rel="nofollow">http://llpanorama.wordpress.com/2008/05/21/my-first-cuda-program/</a>

Unfortunately I can't copy paste it here because the code becomes messy

It takes as input a vector of numbers and then gives as an output the vector multiplied by itself, I run it on the emulator that I have installed on my computer and it gives the following output:

Code:
0 0.000000
1 1.000000
2 4.000000
3 9.000000
4 16.000000
5 25.000000
6 36.000000
7 49.000000
8 64.000000
9 81.000000

however if I decide to run it on a remote computer which runs debian and has cuda compatible gpu by entering

Code:
nvcc test.cu -lcudart -o test
./test

it gives me the following output

Code:
0 0.000000
1 1.000000
2 2.000000
3 3.000000
4 4.000000
5 5.000000
6 6.000000
7 7.000000
8 8.000000
9 9.000000

why does this happen? Thank you in advance!