Thrust is a C++ template library for CUDA based on the Standard Template Library (STL). Thrust allows you to implement high performance parallel applications with minimal programming effort through a high-level interface that is fully interoperable with CUDA C.
Thrust provides a rich collection of data parallel primitives such as scan, sort, and reduce, which can be composed together to implement complex algorithms with concise, readable source code. By describing your computation in terms of these high-level abstractions you provide Thrust with the freedom to select the most efficient implementation automatically. As a result, Thrust can be utilized in rapid prototyping of CUDA applications, where programmer productivity matters most, as well as in production, where robustness and absolute performance are crucial.
On génère de manière aléatoire des entiers et on les trie ( i5-4570 CPU @ 3.20GHz, GeForce GTX 770) :
nvcc --link -o thrust_sort.exe thrust_sort.cu --compiler-options -O2 -gencode arch=compute_30,code=sm_30
time ./thurst_sort.exe
real 0m0.432s
user 0m0.361s
sys 0m0.069s
On génère de manière aléatoire des entiers et on en calcule la somme ( i5-4570 CPU @ 3.20GHz, GeForce GTX 770) :
nvcc --link -o thrust_reduce.exe thrust_reduce.cu --compiler-options -O2 -gencode arch=compute_30,code=sm_30
time ./thrust_reduce.exe
sum = 2002318
real 0m0.058s
user 0m0.023s
sys 0m0.033s
CUME (prononcer QMi) est un acronyme pour CUDA Made Easy. Il s'agit d'un framework qui a pour but de simplifier la programmation en CUDA en déchargeant le programmeur des tâches fastidieuses telles que :
Pour plus d'informations, voir :