Get in Touch
 Duration 28 hours

Course Outline

Introduction

  • An overview of CUDA.
  • Comparing CUDA with OpenCL and SYCL.
  • A summary of CUDA features and architecture.
  • Setting up the development environment.

Getting Started

  • Initiating a new CUDA project in Visual Studio Code.
  • Examining the project structure and associated files.
  • Compiling and executing the program.
  • Displaying output using printf and fprintf.

CUDA API

  • Understanding the function of the CUDA API within the host program.
  • Querying device information and capabilities via the CUDA API.
  • Allocating and freeing device memory using the CUDA API.
  • Transferring data between host and device using the CUDA API.
  • Launching kernels and synchronizing threads with the CUDA API.
  • Handling errors and exceptions using the CUDA API.

CUDA C/C++

  • Understanding the role of CUDA C/C++ in the device program.
  • Writing kernels in CUDA C/C++ for GPU execution and data manipulation.
  • Applying CUDA C/C++ data types, qualifiers, operators, and expressions.
  • Using CUDA C/C++ built-in functions for math, atomic operations, warps, etc.
  • Utilizing CUDA C/C++ built-in variables such as threadIdx, blockIdx, and blockDim.
  • Incorporating CUDA C/C++ libraries like cuBLAS, cuFFT, and cuRAND.

CUDA Memory Model

  • Distinguishing between host and device memory models.
  • Working with CUDA memory spaces: global, shared, constant, and local.
  • Managing CUDA memory objects including pointers, arrays, textures, and surfaces.
  • Applying CUDA memory access modes such as read-only, write-only, and read-write.
  • Understanding the CUDA memory consistency model and synchronization mechanisms.

CUDA Execution Model

  • Distinguishing between host and device execution models.
  • Defining parallelism using CUDA threads, blocks, and grids.
  • Utilizing CUDA thread functions like threadIdx, blockIdx, and blockDim.
  • Using CUDA block functions such as __syncthreads and __threadfence_block.
  • Applying CUDA grid functions including gridDim, gridSync, and cooperative groups.

Debugging

  • Identifying common errors and bugs in CUDA applications.
  • Inspecting variables, breakpoints, and call stacks using the Visual Studio Code debugger.
  • Debugging CUDA programs on Linux using CUDA-GDB.
  • Detecting memory errors and leaks with CUDA-MEMCHECK.
  • Debugging and analyzing CUDA programs on Windows using NVIDIA Nsight.

Optimization

  • Understanding factors influencing CUDA program performance.
  • Improving memory throughput with CUDA coalescing techniques.
  • Reducing memory latency using CUDA caching and prefetching techniques.
  • Optimizing memory access and bandwidth using CUDA shared and local memory techniques.
  • Measuring and enhancing execution time and resource utilization with CUDA profiling tools.

Requirements

  • A solid grasp of C/C++ and parallel programming concepts.
  • Foundational knowledge of computer architecture and memory hierarchy.
  • Proficiency with command-line tools and code editors.

Target Audience

  • Developers seeking to master CUDA programming on NVIDIA GPUs to leverage parallel processing capabilities.
  • Developers aiming to write high-performance, scalable code compatible with various CUDA-enabled devices.
  • Programmers interested in exploring the low-level intricacies of GPU programming to optimize code performance.

Related Categories