GPU Computing

TP 0.1 - Device query

E. Carlinet

J. Chazalon

Sept. 2020

Objective(s)

Duration

You should complete this part within 30 minutes.

Instructions

Use and extend the code sample provided in the next section to query the following properties of a CUDA device:

Code template

The code provided in the file device_query.cu in the archive student_resources.tar.gz is suggested as a starting point for you. You are expected to insert your code in the sections demarcated with //@@. You should not have to make any change in other code sections.

The relevant documentations are:

Please notice that you do not need to import any header file when using core** CUDA functions:** they are automatically made available in the global namespace for .cu files by the compiler.

Questions

Once you have completed this exercise, please take some time to think about the following questions.

  1. What is the compute capability of the NVIDIA device you are using?
  2. What are the maximum block dimensions for GPUs with this compute capability?
  3. Suppose you are launching a one dimensional grid and block. If the hardware’s maximum grid dimension is 65535 and the maximum block dimension is 512, what is the maximum number threads can be launched on the GPU?