views:

183

answers:

3

hi i was running cuda program on a machine which has cpu with four cores, how is it possible to change cuda c program to use all four cores and all gpu's available? i mean my program also does things on host side before computing on gpus'...

thanks!

+6  A: 

CUDA is not intended to do this. The purpose of CUDA is to provide access to the GPU for parallel processing. It will not use your CPU cores.

From the What is CUDA? page:

CUDA is NVIDIA’s parallel computing architecture that enables dramatic increases in computing performance by harnessing the power of the GPU (graphics processing unit).

That should be handled via more traditional multi-threading techniques.

Reed Copsey
Just beat me to it so I've removed my post as it's a duplicate of yours
zebrabox
+1  A: 

cuda code runs only on GPU. so if you want parallelism on your CPU cores, you need to use threads such as Pthreads or OpenMP.

scatman
+1  A: 

Convert your program to OpenCL :-)

Die in Sente