What is the best way to print device variables in CUDA outside of the kernel? Do I have to do a cudaMemcpy to the host and then print the resulting values? When I try to use printf on pointers created using cudaMalloc, the program crashes. It seems that most of the attention focuses on printing inside the kernel, not in regular code.
Thanks, Eric
printfdirectly from kernel was added somewhere around 2.1. If you want to printf from hostside, you'll need to usecudaMemcpy, yes.