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 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

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.

Connectez-vous pour laisser un commentaire.