cuda programming problem

hello !! i am a newbie in cuda programming. I wanted to know

I) If there should be two differt file for cpu and host ( .c and .cu) or a single .cu file?
II)how to block cpu doing other task after launching kernal untill it completes its task?
III) how to load .cu file in GPU?

gpu i am using is geforce gtx 460

thanks in advance.

  1. doesn’t matter, can have one file containing both C and cuda code, or have separate files
  2. a call to cudaThreadSynchronize(); after the call to the kernel will do this for you
    see Cuda toolkit reference manual
  3. done automatically for you ( i.e. compiler adds necessary code and it becomes part of your .exe )