Introduction to CUDA
GPU programming using CUDA.
What is CUDA?
CUDA stands for Compute Unified Device Architecture. CUDA is a heterogeneous programming language from NVIDIA that exposes GPU for general purpose program. Heterogeneous programming means the code runs on two different platform: host (CPU) and devices (NVDIA GPU devices).
Why use GPU?
CPU are extremely powerful and are better for low latency operation where we want few serial tasks to execute parallel. But if we have to run code which is requires massively parallel processing then the CPU will take longer time to execute as it can only do because threads in CPU are heavy, and the operating system swaps the thread on and off to implement multiprocessing called context switching and it is a slow and expensive process. GPU have exponentially high computational throughput and bandwidth compared to CPU. GPU is better for parallel data processing. They are better for carrying out small operation like floating point arithmetic on large amount of data. Future of programming is parallelism, and GPU is the best way to achieve it.
Prerequisites
NVIDIA graphics card
CUDA toolkit
(follow instruction from here https://developer.nvidia.com/cuda-downloads)