Difference between revisions of "GPU Tutorial/Open MP"
GPU Tutorial/Open MP
Jump to navigation
Jump to search
m |
|||
(One intermediate revision by one other user not shown) | |||
Line 8: | Line 8: | ||
=== Video === <!--T:5--> | === Video === <!--T:5--> | ||
+ | |||
+ | <youtube width="600" height="340" right>EPflqxk4rfk</youtube> | ||
([[Media:GPU_tutorial_saxpy_openmp.pdf |Slides as pdf]]) | ([[Media:GPU_tutorial_saxpy_openmp.pdf |Slides as pdf]]) | ||
Line 20: | Line 22: | ||
|| <code>#pragma omp target gpu</code> is a syntax error in OpenMP. | || <code>#pragma omp target gpu</code> is a syntax error in OpenMP. | ||
- <code>#pragma omp target acc</code> | - <code>#pragma omp target acc</code> | ||
− | || | + | || <code>#pragma omp target acc</code> is a syntax error in OpenMP. |
+ <code>#pragma omp target</code> | + <code>#pragma omp target</code> | ||
|| Correct: <code>#pragma omp target</code> defines a target region, which is a block of computation that operates on GPU. | || Correct: <code>#pragma omp target</code> defines a target region, which is a block of computation that operates on GPU. |
Latest revision as of 16:22, 21 January 2022
Tutorial | |
---|---|
Title: | Introduction to GPU Computing |
Provider: | HPC.NRW
|
Contact: | tutorials@hpc.nrw |
Type: | Multi-part video |
Topic Area: | GPU computing |
License: | CC-BY-SA |
Syllabus
| |
1. Introduction | |
2. Several Ways to SAXPY: CUDA C/C++ | |
3. Several Ways to SAXPY: OpenMP | |
4. Several Ways to SAXPY: Julia | |
5. Several Ways to SAXPY: NUMBA |
This video discusses the SAXPY via OpenMP GPU offloading. OpenMP 4.0 and later enables developers to program GPUs in C/C++ and Fortran by means of OpenMP directives. In this tutorial we present the basic OpenMP syntax for GPU offloading and give a step-by-step guide for implementing SAXPY with it.
Video
Quiz
1. Which one of the following OpenMP directives can create a target region on GPU?
2. The OpenMP `map(to:...)` clause maps variables:
3. Which one of the following OpenMP directives can initialize a league of teams for execution on GPU?
4. Which one of the following OpenMP directives can distribute iterations of for-loop across GPU threads in the teams?