开发者

OpenCL, direct access to host memory from GPU kernels

开发者 https://www.devze.com 2023-01-13 02:42 出处:网络
Is there any way to allocate memory on host, that is accessible directly from GPU, without copying? Like cudaHostGetDevicePointer in CUDA开发者_如何学JAVA.Yes, use clCreateBuffer with flags containi

Is there any way to allocate memory on host, that is accessible directly from GPU, without copying?

Like cudaHostGetDevicePointer in CUDA开发者_如何学JAVA.


Yes, use clCreateBuffer with flags containing one of:

  • CL_MEM_USE_HOST_PTR
  • CL_MEM_ALLOC_HOST_PTR

Which does what you want. For more information visit the man page of clCreateBuffer.

0

精彩评论

暂无评论...
验证码 换一张
取 消