Friday, January 18, 2013

[gpu/cuda] Fix error : calling a host function("printf") from a __device__/__global__ function

1. in NSight:

The Project -> Properties -> CUDA

Tick the box 2.1 and above for 'Generate GPU Code' 

2. in VS


Project->{Project Name} Properties->CUDA C/C++ ->Device -> [Code Generation]: compute_10, sm_10 to compute_20, sm_21

3. nvcc 

nvcc -arch=sm_21 [other options] .....




http://stackoverflow.com/questions/9749652/cuda-4-1-printf-error