GPU Computing

TP 0.3 - Compilation and Runtime

E. Carlinet

J. Chazalon

Sept. 2020

Objective(s)

Duration

You should complete this part within 30 minutes.

Exercise 1: Chose a target architecture

Use the -arch flag from the nvcc compiler to compile the show_arch.cu program from the student resources archive student_resources.tar.gz. This program displays at runtime the version of the CUDA architecture is was built for. You can use the --run flag of nvcc to run the program directly.

Then, use the cuobjdump tool to inspect the binary produced and check what was generated.

You can also run nvcc without any -arch flag to check the default target architecture for your SDK.

Exercice 2: Use multiple target architectures

Use multiple -gencode flags of nvcc to build the show_arch.cu program, then inspect the resulting binary using cuobjdump.

Relevant documentation: CUDA C programming guide, section 3.1.4. Application Compatibility