CUDA计算能力1.0比3.5快

Ben*_*tok 3 cuda gpgpu nvidia compiler-optimization nsight

我有一个cuda程序,我在680gtx上运行,同时测试不同的编译器选项,我注意到:

  • 编译我的代码用于计算能力1.0和sm 1.0给出了47ms的运行时间

  • 编译我的代码用于计算能力3.5(也是2.0)和sm 3.0给出了60ms的运行时间


这种结果可能是什么原因?

我正在编译Linux和CUDA 5.0上的nsight编译器,我的内核主要是内存绑定.

谢谢.


命令:

cc 1.0

nvcc --compile -O0 -Xptxas -v -gencode arch=compute_10,code=compute_10 -gencode arch=compute_10,code=sm_10 -keep -keep-dir /tmp/debug -lineinfo -pg -v  -x cu -o  "BenOlaCuda/src/main.o" "../BenOlaCuda/src/main.cu"
Run Code Online (Sandbox Code Playgroud)

cc 3.0

nvcc -lineinfo -pg -O0 -v -keep -keep-dir /tmp/debug -Xptxas -v -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -odir "BenOlaCuda/src" -M -o "BenOlaCuda/src/main.d" "../BenOlaCuda/src/main.cu"
Run Code Online (Sandbox Code Playgroud)

有关编译内核的更多信息:

cc 1.0

ptxas info    : Compiling entry function '_Z15optimizePixelZ3tfPfS_S_S_tttttt' for 'sm_10'
ptxas info    : Used 40 registers, 68 bytes smem, 64 bytes cmem[1], 68 bytes lmem
Run Code Online (Sandbox Code Playgroud)

cc 3.0

ptxas info    : Compiling entry function '_Z15optimizePixelZ3tfPfS_S_S_tttttt' for 'sm_30'
ptxas info    : Function properties for _Z15optimizePixelZ3tfPfS_S_S_tttttt
128 bytes stack frame, 100 bytes spill stores, 108 bytes spill loads
ptxas info    : Used 63 registers, 380 bytes cmem[0], 20 bytes cmem[2]
Run Code Online (Sandbox Code Playgroud)

Mic*_*idl 6

大约两年前,我将模拟从CUDA3.2切换到CUDA4.0,并且性能达到了大约10%.凭借Compute Capability 2.0,nVidia引入了IEEE754-2008符合浮点计算(CC 1.0使用IEEE754-1985).这一点以及"冲到零"的消除是性能受损的原因.尝试使用编译器标志--use_fast_math编译CC 3.0可执行文件.这样可以实现CC 1.0的旧精度.