Tag: CUDA

  • What is parallel computing and why does it matter?

    —

    by

    in

    Parallel computing means executing many calculations simultaneously, by dividing a large problem into smaller independent pieces and running them at the same time on multiple processors. A modern GPU like the NVIDIA RTX 5060 Ti contains 4,608 CUDA cores — all of them working in parallel on your data. Parallel computing is not a niche…

  • CUDA : Vector Addition Example

    —

    by

    in

    Vector addition (C[i] = A[i] + B[i]) is the our first parallel CUDA program, integrating memory management, data transfer, kernel execution, and error handling. This complete example demonstrates the full CUDA workflow: allocate device memory with cudaMalloc(), copy data with cudaMemcpy(), launch parallel kernel, retrieve results, verify correctness, and free allocated memories. Refer to following…

  • CUDA: Device Query

    —

    by

    in

    Using cudaGetDeviceProperties() lets your program learn about the GPU’s features. It tells you things like how powerful the GPU is, how much memory it has, and how many multiprocessors it has. This information helps you write better CUDA code that works well on different types of GPUs. For example, it can help you decide the…

  • CUDA: Error Handling

    —

    by

    in

    Robust CUDA programs require systematic error checking since GPU operations can fail silently. When you start a kernel on the GPU, it runs immediately without giving an error code if something goes wrong. Using cudaError_t, cudaGetLastError(), and error-checking macros helps catch problems like running out of memory, bad launch settings, or trying to access memory…

  • CUDA: Compilation and Execution

    —

    by

    in

    CUDA programs require special compilation to generate both CPU and GPU code. The nvcc tool helps by splitting the code into two parts: host (C++) and device (PTX/SASS). Then it combines them. Using the right compiler flags is important, especially the -arch flag, which tells the program which GPUs to run on. This makes your…