---------------------------------------
性能比较
TEA_CUDA:
C:\Users\Seth>E:\Project\VC\TEA_CUDA\Release\TEA_CUDA.exe
GeForce 8400M GS
data len:20971520 ThreadCount:512
v_len:40960
Encrypt Time used: 0.28
TEA_CPU:
C:\Users\Seth>E:\Project\VC\TeaCPU\release\TeaCPU.exe
data len:20971520
CPU used time:0.807000
-----------------------------------------
结论:可以看出在千万字节级的数据处理上GPU是CPU的2倍以上。
C:\Users\Seth>E:\Project\VC\TEA_CUDA\Debug\TEA_CUDA.exe
Device:GeForce 8400M GS
data len:10485760 loopcount:80
encrypt time used: 0.0960(sec)
data Process rate: 104.1667(M/sec)
C:\Users\Seth>E:\Project\VC\TeaCPU\Release\TeaCPU.exe
data len:10485760
encrypt time used: 0.3960(sec)
data Process rate: 25.2525(M/sec)
-----------------------------------------------------------------
e:\Project\VC\TeaCPU\Release>E:\Project\VC\TEA_CUDA\Release\TEA_CUDA.exe
Device:GeForce 8400M GS
data len:10485760 loopcount:80
encrypt time used: 0.0800(sec)
data Process rate: 125.0000(M/sec)
e:\Project\VC\TeaCPU\Release>TeaCPU.exe
data len:10485760
encrypt time used: 0.3920(sec)
data Process rate: 25.5102(M/sec)