This commit is contained in:
JOLIMAITRE Matthieu 2024-03-10 21:31:32 +01:00
parent 917b2258ad
commit 6054d1ada0
6 changed files with 264 additions and 0 deletions

17
gpu/tp1/c/src/ex2.cu Normal file
View 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.