Reputation: 415
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.
Upvotes: 0
Views: 336
Reputation: 6333
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.
Upvotes: 0
Reputation: 5482
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.
Upvotes: 1