Copy to global memory allocated by malloc()?

后端 未结 1 1808
情话喂你
情话喂你 2020-12-21 06:41

CUDA programming guide states that \"Memory allocated via malloc() can be copied using the runtime (i.e., by calling any of the copy memory functions from Devic

相关标签:
1条回答
  • 2020-12-21 06:58

    As far as I am aware, it isn't possible to copy runtime heap memory using the host API functions. It certainly was not possible in CUDA 4.x and the CUDA 5.0 release candidate has not changed this. The only workaround I can offer is to use a kernel to "gather" final results and stuff them into a device transfer buffer or zero copy memory which can be accessed via the API or directly from the host. You can see an example of this approach in this answer and another question where Mark Harris from NVIDIA confirmed that this is a limitation of the (then) current implementation in the CUDA runtime.

    0 讨论(0)
提交回复
热议问题