8.3.2 Use CL_MEM_ALLOC_HOST_PTR to avoid copying memory

The Mali™ GPU can access the memory buffers created by clCreateBuffer(CL_MEM_ALLOC_HOST_PTR). This is the preferred method to allocate buffers because data copies are not required.

This method of allocating buffers is shown in the following figure.

Figure 8-1 Memory buffer created by clCreateBuffer(CL_MEM_ALLOC_HOST_PTR)
To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


Arm recommends the following:

  • You must make the initial memory allocation through the OpenCL API.
  • Always use the latest pointer returned.

    If a buffer is repeatedly mapped and unmapped, the address the buffer maps into, is not guaranteed to be the same.

  • Note:

    If you are using a Mali Bifrost or Valhall GPU in a fully coherent system, use fine-grain shared virtual memory. See F.8 Shared virtual memory.
Non-ConfidentialPDF file icon PDF version101574_0301_00_en
Copyright © 2019 Arm Limited or its affiliates. All rights reserved.