I have noticed a really strange behavior when the function magma_dprint(_gpu) is used along with NVIDIA CuRand library (random number generation on GPU).
I create a uniform random number generator with a fixed seed, I use it to create 4 random vectors with 5 elements each and print them using magma_dprint_gpu. I do the same operation again with the same seed.
Here is the corresponding output:
- Code: Select all
1:
[
0.5130 0.1024 0.0680 0.0562
0.8300 0.4196 0.6611 0.8106
0.0058 0.7963 0.3174 0.2008
0.2229 0.7701 0.3577 0.3821
0.5795 0.3953 0.3689 0.9635
];
2:
[
0.5130 0.5130 0.1024 0.0680
0.8300 0.8300 0.4196 0.6611
0.0058 0.0058 0.7963 0.3174
0.2229 0.2229 0.7701 0.3577
0.5795 0.5795 0.3953 0.3689
];
If I replace the first call to magma_dprint_gpu with my own implementation, the two matrices are the same as expected:
- Code: Select all
1:
-----
0.5130 0.1024 0.0680 0.0562
0.8300 0.4196 0.6611 0.8106
0.0058 0.7963 0.3174 0.2008
0.2229 0.7701 0.3577 0.3821
0.5795 0.3953 0.3689 0.9635
-----
2:
[
0.5130 0.1024 0.0680 0.0562
0.8300 0.4196 0.6611 0.8106
0.0058 0.7963 0.3174 0.2008
0.2229 0.7701 0.3577 0.3821
0.5795 0.3953 0.3689 0.9635
];
Since the only difference between my implementation of dprint_gpu and magma_dprint_gpu is the check is_devptr, I will guess that this function somehow is responsible for the problem.
I have attached my sample code:
Any idea will be appreciated! :) If you think the problem is in CuRand, I can report the problem to them.
Thanks in advance!
Rémi
