Question of openCL use of gpu and cpu

I have a term project I am working on involving gpu empirical testing. I read a little about openCL and have been recommended it since cuda has alot of gpu type restrictions.

OpenCL advertises it uses both CPU and GPU, but reading the forums it seems that all processing can be sent to the GPU and CPU is mainly for formating the input to the gpu itself. I need all the processing algorithm to run in the gpu.

Is this correct?

As opposed to CUDA kernels, you can run OpenCL kernels on GPUs and CPUs. So you don’t have to run all your algorithms on the GPU. If you have several tasks for example, you can run some of them on CPUs and others on GPUs (all within the OpenCL framework). You have to be aware though that if the GPU needs data computed by the CPU or vice versa, this data needs to be transferred over PCIe bus which can cause considerable overhead if you’re not careful. The decision where to execute tasks also depends on how fast the code performs on the different devices.

Ok so you can specific where the processing is done. The whole project is to use the cpu to format a weighted graph and send it to a gpu for a simple greedy loop. Once sent into the gpu I want it to handle everything.

Thanks for all the info especially about the pcie overhead. I’m sending one large 2d array, but I will do testing to get the overhead times.