4

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

Like cudaHostGetDevicePointer in CUDA.

4

1 回答 1

7

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.

于 2010-08-22T16:36:18.240 回答