新程序碰到如下问题:1.在C2050上跑结果正确,编译命令为:nvcc main_C.cu -lm -o nozflux -arch compute_20 -code sm_20
2.在K20上跑出如下问题:
2.1当编译命令为:
nvcc main_C.cu -lm -o nozflux -arch compute_35 -code sm_35或者
nvcc main_C.cu -lm -o nozflux -arch compute_35 -code sm_35 -O2或者
nvcc main_C.cu -lm -o nozflux -arch compute_35 -code sm_35 -O1或者
nvcc main_C.cu -lm -o nozflux -arch compute_35 -code sm_35 -O0时,每次跑的结果完全不一致,而且随时可能出现非常大的数。
2.2当编译命令为:nvcc main_C.cu -lm -o nozflux -arch compute_35 -code sm_35 -G时,结果正确。
疑惑:1.为何C2050上能正确运行而K20上算出错误结果?
2.为何K20上用-G参数能出正确结果而-O0出错误结果,-O0不是没优化吗?