I have four jobs (grouped in two tasks) need to be executed on AMD OpenCl device and GPU Device parallely. As per my knowledge, calling NDRangeKernel for AMD OpenCl CPU Device, is returning promptly (non blocking) if NULL event is passed.
TASK1 Hence, firstly i am calling NDRangeKernel for AMD OpenCl CPU Device with NDRangeKernel for job1, after which host will have the control promptly.
ret = clEnqueueNDRangeKernel(command_queue_amd, icm_kernel_amd, 1, NULL, &glob, &local, 0, NULL, NULL);
TASK2 Then host can call NDRangeKernel for GPU Device using gpu kernel 1 for job2 and then for gpu kernel 2 for job3 and then gpu kernel 3 for job4 which will call them serially.
ret = clEnqueueNDRangeKernel(command_queue_gpu, icm_kernel_gpu[0], 1, NULL, &glob, &local, 0, NULL, NULL);
ret = clEnqueueNDRangeKernel(command_queue_gpu, icm_kernel_gpu[1], 1, NULL, &glob, &local, 0, NULL, NULL);
ret = clEnqueueNDRangeKernel(command_queue_gpu, icm_kernel_gpu[2], 1, NULL, &glob, &local, 0, NULL, NULL);
They are not returning promptly to host.
And then reading buffer for GPU and then for CPU.
ret = clEnqueueReadBuffer(command_queue_gpu, Buffer_gpu, CL_TRUE, 0, count * sizeof(double), arr_gpu, 0, NULL, NULL);
ret = clEnqueueReadBuffer(command_queue_amd, Buffer_amd, CL_TRUE, 0, count * sizeof(double), arr_cpu, 0, NULL, NULL);
My question is, is both the tasks are running parallely? Is there any profiler/logic to detect such behaviour? Any commments/logics/pointers will be appreciated.
command_queue_gpufor all the GPU cases, so there, it doesn't matter if you launch 1, 3 or 1k kernels, they are going to be serial. As for the CPU and GPU devices, yes, they do run in parallel (check it by looking at the event data). - DarkZeros