HostAllocate and Mapped Memory

Apr 2, 2012 at 9:57 PM
Edited Apr 2, 2012 at 10:00 PM

HI, Is there any sample code, which shows how to use Mapped Memory with CUDAFY. I was manage to find function HostAllocate, but it has only one parameter and I can't set any flags necessary to set when dealing with mapped memory. Looking at source code of CudaGPU, HostAllocate was implemented as follows:

public override IntPtr HostAllocate<T>(int x) { int bytes = MSizeOf(typeof(T)) * x; IntPtr ptr = IntPtr.Zero; try { ptr = _cuda.HostAllocate((uint)bytes, CUDADriver.CU_MEMHOSTALLOC_PORTABLE); } catch (CUDAException ex) { HandleCUDAException(ex); } _hostHandles.Add(ptr, _cuda.CurrentContext); return ptr; }

Is there any other way of declaring memory as DEVICEMAPPED ?