Quick question from a new CUDA user,
I have a single value, say ‘cnt’, that is an integer on the CPU and gets passed by-reference to various functions in C++ code. The ‘cnt’ variable is updated in some of the various functions it is passed to. I would like to create CUDA/GPU versions of the CPU functions but need to be able to pass the ‘cnt’ as a reference but I don’t think this is possible - is it?
If it is, how?
If it is not, I thought about collapsing all kernels into one and just storing the ‘cnt’ variable on the GPU. Can this be done? I found info on vector/arrays being stored on the GPU via CUDA but not about scalar values.