سؤال

I understand that pinned memory allocated by "cudaHostAlloc" can be transferred more efficiently to device than "malloc"'ed memory can. However, I think "cudaHostAlloc" can only be compiled by cuda compiler. My scenario is to use cublas API without cuda compiler, and it seems that cublas doesn't provide function for pinned memory allocation from the handbook, or maybe I miss something...

هل كانت مفيدة؟

المحلول

cudaHostAlloc() is implemented in the CUDA Runtime API. You don't need to compile with nvcc to use CUDA API calls, you can just include the appropriate header (e.g. cuda_runtime_api.h) and link with the runtime library (cudart).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top