Crud Hello
Crud Hello
Crud Hello
PRACTICAL : 09
1. Grids :
Grid refers to the highest-level grouping of threads that are scheduled
for execution on the GPU device. It represents the entire set of parallel
work that needs to be processed by the GPU.
2. Blocks :
A block is a group of threads that execute concurrently on an SM.
Threads within the same block can cooperate with each other through
shared memory and synchronization mechanisms.
3. Warps :
A warp is the smallest unit of execution in CUDA. It consists of 32
consecutive threads that are executed in lockstep on an SM. This
means that all 32 threads within a warp execute the same instruction at
the same time.
4. Threads :
A thread is a basic unit of execution in CUDA (NVIDIA's parallel
computing platform). Threads are organized into groups called thread
blocks, and multiple thread blocks are organized into a grid.
Steps :
%%writefile p1.cu
#include <stdio.h>
int main() {
cuda_hello<<<1,5>>>();
cudaDeviceSynchronize();
return 0;
}
Output.
%%writefile p2.cu
#include <stdio.h>
int main() {
cuda_hello<<<2,5>>>();
cudaDeviceSynchronize();
return 0;
}
Output.