Forums - About Qualcomm's device-host unified memory architecture

3 posts / 0 new
Last post
About Qualcomm's device-host unified memory architecture
pvrtisrp
Join Date: 28 Sep 13
Posts: 47
Posted: Tue, 2013-10-29 02:37

Dear all,

I know OpenCL on Qualcomm SoC has a device-host unified memory architecture.

Does it mean when I call clCreateBuffer API, I should set CL_MEM_USE_HOST_PTR no matter CL_MEM_READ_ONLY or CL_MEM_WRITE_ONLY is set?

Do I really need to use clEnqueueReadBufferclEnqueueWriteBuffer on Qualcomm SoC? What's the fastest way to access memory in OpenCL C Kernel?

Thank you.

Cathy.

  • Up0
  • Down0
Jonny D
Join Date: 4 Nov 15
Posts: 7
Posted: Tue, 2016-05-24 11:22

Bump

  • Up0
  • Down0
Carlos Dominguez Moderator
Join Date: 27 Jul 15
Location: San Diego
Posts: 110
Posted: Fri, 2016-05-27 13:19

You should be creating a buffer  with CL_MEM_ALLOC_HOST_PTR and use clEnqueueMapBuffer and clEnqueueUnmapBuffer to access the buffer on the host cpu. This is regardless of read_only and write_only.

With this approach there is no data copy involved. clEnqueueReadBuffer and clEnqueueWrite buffer will incur the overhead of data copy and are not recommended. Similarly for CL_MEM_USE_HOST_PTR;

We would also encourage you  to look at cl_qcom_ion_host_ptr and cl_qcom_android_native_buffer_host_ptr  as these will let you share data between different components without copy.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.