compiler errors - CUDA, cuPrintf causes "unspecified launch failure"? -


i have kernel runs twice different grid size.

my problem cuprintf. when don't have cudaprintfinit() before kernel run , cudaprintfdisplay(stdout, true) , cudaprintfend() after kernel run, have no error when put them there "unspecified launch failure" error.

in device code, there 1 loop printing:

if (threadidx.x==0) {      cuprintf("max:%f x:%d y:%d\n", maxval, blockidx.x, blockidx.y); } 

i'm using cuda 4.0 card cuda capability 2.0 , i'm compiling code syntax:

nvcc lb2.0.cu -arch=compute_20 -code=sm_20   

if on cc 2.0 gpu, don't need cuprintf @ -- cuda has printf built-in cc-2.0 , higher gpus. replace call cuprintf this:

#if __cuda_arch__ >= 200 if (threadidx.x==0) {     printf("max:%f x:%d y:%d\n", maxval, blockidx.x, blockidx.y); } #endif 

(note need #if / #endif lines if compiling code sm_20 , earlier versions. example compilation command line gave, can eliminate them.)

with printf, don't need cudaprintfinit() or cudaprintfdisplay() -- automatic. if print lot of data, may need increase default printf fifo size cudadevicesetlimit(), passing cudalimitprintffifosize option.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -