Question

My task is to compute the sum on an array.

What I plan to do is to perform a partial sun using OpenCL so that the kernel returns a smaller array of the size corresponding to the number of work-items. And then to use OpenMP to sum up this somewhat little array.

Now, I'm wondering if I can use OpenMP in the host part of my OpenCL code. If yes, can I use OpenCL type (say cl_float4) with OpenMP.

I thank you in advance,

     Éric.
Was it helpful?

Solution

cl_float4 basicly represents an array of 4 float values with proper memory alignement for GPUs. However, it can be used in host code without any problems.

OTHER TIPS

Yes, you can use OpenMP in your host code, and yes, you could use cl_float4 inside an OpenMP block. OpenMP doesn't much care what you do inside a parallel section.

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