Compiling CUDA Projects with Dynamic Parallelism (VS 2012/13)

Just a quick note.
If you are starting from a template C++ CUDA project in VS 2012/2013, calling a kernel from a kernel (dynamic parallelism) would not compile:

error : kernel launch from __device__ or __global__ functions requires separate compilation mode

To fix this, first make sure your hardware supports it (cc 3.5 or higher) and compute capability is set correctly in the compiler options (“compute_35,sm_35”)

fourth

Then set -rdc=true in CUDA C++ options:

compiler

Then add cudadevrt.lib to the libraries that are statically linked in the Linker options:

linker

5 thoughts on “Compiling CUDA Projects with Dynamic Parallelism (VS 2012/13)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.