Question

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!

Was it helpful?

Solution

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.

OTHER TIPS

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.

Convert your program to OpenCL :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top