pinn already allocated memory?

Is it possible to pin (lock?) already allocated memory such that it can be copied asynchronically to the gpu? I have the problem that i get memory allocated by a foreign library so that i cannot control how it gets allocated.

Thanx for any help

Nope, there is no way to do this at the moment. (it’s completely unsafe on Linux, for example!)

unsafe or impossible? does a cuda-pinnen memory are differ from a mlock()-ed area under linux?

// edit:

even if a call mlockall() before the copy, cudaMemcpyAsync fails with “invalid argument”