문제

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.
도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top