我正在创建一个调用Nvidia的减少内核的例程(reduction6),但是当我比较CPU和GPU之间的结果时,得到的错误会随着矢量大小的增加而增加,所以:
CPU和GPU的减少都是浮动的
Size: 1024 (Blocks : 1, Threads : 512)
Reduction on CPU: 508.1255188
Reduction on GPU: 508.1254883
Error: 6.0059137e-06
Size: 16384 (Blocks : 8, Threads : 1024)
Reduction on CPU: 4971.3193359
Reduction on GPU: 4971.3217773
Error: 4.9109825e-05
Size: 131072 (Blocks : 64, Threads : 1024)
Reduction on CPU: 49986.6718750
Reduction on GPU: 49986.8203125
Error: 2.9695415e-04
Size: 1048576 (Blocks : 512, Threads : 1024)
Reduction on CPU: 500003.7500000
Reduction on GPU: 500006.8125000
Error: 6.1249541e-04
Run Code Online (Sandbox Code Playgroud)
关于这个错误的任何想法?,谢谢.
cuda ×1