gpu_tp1
This commit is contained in:
parent
917b2258ad
commit
6054d1ada0
6 changed files with 264 additions and 0 deletions
17
gpu/tp1/c/src/ex2.cu
Normal file
17
gpu/tp1/c/src/ex2.cu
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include <cstdio>
|
||||
|
||||
// step 02
|
||||
|
||||
__global__ void prints_hello() {
|
||||
printf("Hello World bloc=%d thread=%d\n", blockIdx.x, threadIdx.x);
|
||||
}
|
||||
|
||||
int main() {
|
||||
// step 03
|
||||
prints_hello<<<1, 1>>>();
|
||||
cudaDeviceSynchronize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// # Question 2
|
||||
// Avec 4 blocs de 32 threads, le message apparaitra 4*32 = 128 fois.
|
Loading…
Add table
Add a link
Reference in a new issue