CUDA tutorial/fr: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 131: Line 131:
add <<< N, 1 >>> (dev_a, dev_b, dev_c);
add <<< N, 1 >>> (dev_a, dev_b, dev_c);
</syntaxhighlight>
</syntaxhighlight>
Here we replaced 1 by N, so that N different CUDA blocks will be executed at the same time. However, in order to achieve parallelism we need to make some changes to the kernel as well:
Ici, nous avons remplacé 1 par N pour que N blocs CUDA différents soient exécutés en mêmte temps. Pour paralléliser cependant, il faut aussi faire des modifications au ''kernel'' :
<syntaxhighlight lang="cpp" line highlight="1,5">
<syntaxhighlight lang="cpp" line highlight="1,5">
__global__  void add (int *a, int *b, int *c){
__global__  void add (int *a, int *b, int *c){
rsnt_translations
56,430

edits

Navigation menu