Difference between revisions of "GPU Tutorial/SAXPY CUDA C"
GPU Tutorial/SAXPY CUDA C
Jump to navigation
Jump to search
m |
|||
Line 12: | Line 12: | ||
([[Media:GPU_tutorial_saxpy_cuda_c.pdf |Slides as pdf]]) | ([[Media:GPU_tutorial_saxpy_cuda_c.pdf |Slides as pdf]]) | ||
− | === Quiz === <!--T:5--> | + | === Introduction Quiz === <!--T:5--> |
{{hidden begin | {{hidden begin | ||
− | |title = 1. For which kind of | + | |title = 1. For which kind of program can we expect improvements with GPUs?}} |
<quiz display=simple> | <quiz display=simple> | ||
{ | { | ||
Line 52: | Line 52: | ||
+ All of the above | + All of the above | ||
|| Correct! | || Correct! | ||
+ | </quiz> | ||
+ | {{hidden end}} | ||
+ | |||
+ | |||
+ | === Quiz === <!--T:5--> | ||
+ | {{hidden begin | ||
+ | |title = 1. Which features does CUDA add to C/C++?}} | ||
+ | <quiz display=simple> | ||
+ | { | ||
+ | |type="()"} | ||
+ | - functions | ||
+ | || CUDA does not only add new functions, but all of these features. | ||
+ | - syntax | ||
+ | || CUDA does not only add new syntax, but all of these features. | ||
+ | - GPU support | ||
+ | || CUDA does not only add GPU support, but all of these features. | ||
+ | + All of the above | ||
+ | || Correct | ||
+ | </quiz> | ||
+ | {{hidden end}} | ||
+ | |||
+ | |||
+ | {{hidden begin | ||
+ | |title = 2. What is a kernel?}} | ||
+ | <quiz display=simple> | ||
+ | { | ||
+ | |type="()"} | ||
+ | - It's a flag you can set to automatically parallelize any function. | ||
+ | || Unfortunately, life is not that easy. | ||
+ | + It's the part of your code that is run on the GPU. | ||
+ | || Correct | ||
+ | - It's a new CUDA function that activates the GPU. | ||
+ | || Wrong | ||
+ | </quiz> | ||
+ | {{hidden end}} | ||
+ | |||
+ | |||
+ | {{hidden begin | ||
+ | |title = 3. How do you flag a function to be a kernel?}} | ||
+ | <quiz display=simple> | ||
+ | { | ||
+ | |type="()"} | ||
+ | - __host__ | ||
+ | || Wrong | ||
+ | - __device__ | ||
+ | || Wrong | ||
+ | + __global__ | ||
+ | || Correct | ||
+ | - __GPU__ | ||
+ | || Wrong | ||
+ | </quiz> | ||
+ | {{hidden end}} | ||
+ | |||
+ | {{hidden begin | ||
+ | |title = 4. Let's say you coded you kernel function called "MyKernel". How do you run it?}} | ||
+ | <quiz display=simple> | ||
+ | { | ||
+ | |type="()"} | ||
+ | - MyKernel() | ||
+ | || Wrong | ||
+ | - CUDA_GPU_run(NoBlocks,NoThreads()) | ||
+ | || Wrong | ||
+ | + <<<NoBlocks,NoThreads>>>MyKernel() | ||
+ | || Correct | ||
+ | - __global(NoBlocks,NoThreads)__ MyKernel() | ||
+ | || Wrong | ||
</quiz> | </quiz> | ||
{{hidden end}} | {{hidden end}} |
Revision as of 11:52, 11 November 2021
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 NVIDIA CUDA C/C++.
Video
Introduction Quiz
1. For which kind of program can we expect improvements with GPUs?
2. What does GPU stands for?
3. Why do we expect an onverhead in the GPU timings?
Quiz
1. Which features does CUDA add to C/C++?
2. What is a kernel?
3. How do you flag a function to be a kernel?
4. Let's say you coded you kernel function called "MyKernel". How do you run it?