coreylowman / cudarc

Safe rust wrapper around CUDA toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use pinned memory for doing transfers

coreylowman opened this issue · comments

Hey, just to be clear, you mean something like RustaCUDA's LockedBuffer, right?

FYI I need this to switch from RustaCUDA to cudarc.

Yep, this will be utilizing cuMemAllocHost and cuMemFreeHost underneath the hood, which is also what the LockedBuffer is using.

As far as how this would be integrated into result/safe APIs, we could either:

  1. Have a separate htod copy method for pinned transfers (htod_pinned_copy)
  2. Change the existing htod_copy methods to accept something like AsRef<[T]> and make sure we can implement that trait for the page locked memory.