Thank you for sending your enquiry! One of our team members will contact you shortly.
Thank you for sending your booking! One of our team members will contact you shortly.
Duration 28 hours
Course Outline
Introduction
- Overview of OpenCL.
- Comparison of OpenCL with CUDA and SYCL.
- Key features and architectural overview of OpenCL.
- Configuring the development environment.
Getting Started
- Initializing a new OpenCL project in Visual Studio Code.
- Exploring project structure and essential files.
- Compiling and executing the program.
- Displaying output using printf and fprintf.
OpenCL API
- Understanding the role of the OpenCL API in host programs.
- Querying device information and capabilities via the OpenCL API.
- Creating contexts, command queues, buffers, kernels, and events using the OpenCL API.
- Enqueueing commands such as read, write, copy, map, unmap, execute, and wait.
- Managing errors and exceptions within OpenCL applications.
OpenCL C
- Understanding the role of OpenCL C in device programs.
- Writing kernels in OpenCL C to execute on the device and manipulate data.
- Utilizing OpenCL C data types, qualifiers, operators, and expressions.
- Applying OpenCL C built-in functions, including math, geometric, and relational operations.
- Using OpenCL C extensions and libraries, such as atomic, image, and cl_khr_fp16.
OpenCL Memory Model
- Distinguishing between host and device memory models.
- Working with OpenCL memory spaces: global, local, constant, and private.
- Managing OpenCL memory objects, including buffers, images, and pipes.
- Applying OpenCL memory access modes, such as read-only, write-only, and read-write.
- Utilizing the OpenCL memory consistency model and synchronization mechanisms.
OpenCL Execution Model
- Differentiating between host and device execution models.
- Defining parallelism using OpenCL work-items, work-groups, and ND-ranges.
- Using OpenCL work-item functions like get_global_id, get_local_id, and get_group_id.
- Applying OpenCL work-group functions such as barrier, work_group_reduce, and work_group_scan.
- Leveraging OpenCL device functions, including get_num_groups, get_global_size, and get_local_size.
Debugging
- Identifying common errors and bugs in OpenCL programs.
- Using the Visual Studio Code debugger to inspect variables, breakpoints, and call stacks.
- Debugging and analyzing OpenCL programs on AMD devices using CodeXL.
- Debugging and analyzing OpenCL programs on Intel devices using Intel VTune.
- Debugging and analyzing OpenCL programs on NVIDIA devices using NVIDIA Nsight.
Optimization
- Understanding factors influencing OpenCL program performance.
- Enhancing arithmetic throughput with OpenCL vector data types and vectorization techniques.
- Reducing control overhead and improving locality using loop unrolling and tiling.
- Optimizing memory access and bandwidth using local memory and related functions.
- Measuring and improving execution time and resource utilization through profiling tools.
Summary and Next Steps
Requirements
- A solid understanding of C/C++ programming and parallel computing concepts.
- Fundamental knowledge of computer architecture and memory hierarchy.
- Familiarity with command-line tools and code editors.
Target Audience
- Developers seeking to master OpenCL for programming heterogeneous devices and leveraging parallelism.
- Developers aiming to write portable and scalable code adaptable to various platforms and devices.
- Programmers interested in exploring low-level aspects of heterogeneous programming to optimize code performance.