This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can I access host memory directly in OpenCL kernel with Arm cpu and mali gpu?

I need a way to create an memory object which can be accessed parallelly both in CPU and GPU, this memory will be read only. How can I do it?

Parents
  • If you need the memory object to wrap existing host memory, I suggest you look into using the host import feature of https://www.khronos.org/registry/OpenCL/extensions/arm/cl_arm_import_memory.txt. This will allow you to create a buffer from an existing application-supplied pointer. Parallel access is allowed as long as both the CPU and GPU are treating the memory as read-only.

    If the memory object doesn't have to be created from an existing pointer, then you can just use clCreateBuffer and map the buffer for reading on the host (CL_MAP_READ) and simultaneously access it on the GPU from a kernel.

    As Ben suggested, you can also do this with Shared Virtual Memory.

    Regards,

    Kevin

Reply
  • If you need the memory object to wrap existing host memory, I suggest you look into using the host import feature of https://www.khronos.org/registry/OpenCL/extensions/arm/cl_arm_import_memory.txt. This will allow you to create a buffer from an existing application-supplied pointer. Parallel access is allowed as long as both the CPU and GPU are treating the memory as read-only.

    If the memory object doesn't have to be created from an existing pointer, then you can just use clCreateBuffer and map the buffer for reading on the host (CL_MAP_READ) and simultaneously access it on the GPU from a kernel.

    As Ben suggested, you can also do this with Shared Virtual Memory.

    Regards,

    Kevin

Children
No data