Initilizing device

Hi all.

how to initialize the device before launching kernel.
should I use CUT_DEVICE_INIT();
if yes then HOW ?

thanks

If you are using CUDA runtime API, then you don’t have to explicitly initialize the device. The first call to any of cuda* functions will initialize the device. (by default, it chooses the device number 0 in your system)
However, if you want a non-zero device to be selected, you can explicitly do so using the ‘cudaSetDevice’.