How dose clCreateBuffer( CL_MEM_USE_HOST_PTR) work when platform and device are both CPU

How dose clCreateBuffer( CL_MEM_USE_HOST_PTR) work when platform and device are both CPU

When my OpenCL platform and device are both CPU, would the behaviour (creating buffer using CL_MEM_USE_HOST_PTR )copy another uniform data or just link to the host_ptr address without copy?

Dose any one knows?
Thank you!

4 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Intel OpenCL implementation for CPU device never copies data to/from buffers unless user requested the copy explicitly by using clEnqueueRead/Write/Copy or by providing CL_MEM_COPY_HOST_PTR to clCreateBuffer call.

Quote:

Dmitry Kaptsenel (Intel) wrote:

Intel OpenCL implementation for CPU device never copies data to/from buffers unless user requested the copy explicitly by using clEnqueueRead/Write/Copy or by providing CL_MEM_COPY_HOST_PTR to clCreateBuffer call.


oh,thank you.But the time by using clEnqueuewriteBuffer (CL_MEM_ALLOC_HOST_PTR) to transform data is just the same long as clCreateBuffer by using CL_USE_HOST_PTR, so that I doubt there is data copy reaction. As you say, the latter time should be much shorter. Am I right?

Quote:

wang h. wrote:

But the time by using clEnqueuewriteBuffer (CL_MEM_ALLOC_HOST_PTR) to transform data is just the same long as clCreateBuffer by using CL_USE_HOST_PTR, so that I doubt there is data copy reaction. As you say, the latter time should be much shorter. Am I right?

Sorry for the late answer.
Yes, it should be shorter. But if the buffer size is not too huge and the buffer creation is not dominated by the copy operation time you will not feel a difference.

登陆并发表评论。