CUDA launches a kernel with triple-angle-bracket syntax: `kernel<<<blocks, threads>>>();`. The first value sets the number of blocks; the second sets threads per block. For `<<<1, 8>>>`, one block runs eight threads, each executing the kernel body independently. A kernel must be launched this way, not called like an ordinary C function. section 2.4
Eight parallel greetings
In `helloKernel<<<1, 8>>>();`, eight threads each print a greeting. This launch uses one block; the same pattern, `<<<1, n>>>`, launches n threads in a single block. section 2.1 section 2.4
#include <stdio.h>
#include <cuda_runtime.h>
__global__ void helloKernel() { #A
printf("Hello, Parallel World!\n"); #B
}
int main() {
helloKernel<<<1, 8>>>(); #C
cudaDeviceSynchronize(); #D
return 0;
}View the complete program: the kernel definition, its eight-thread launch, and the synchronization call. section 2.1
