Library/ManagedCuda/CudaDirectXInteropResource.cs
/// <summary>
/// Returns device variable through which the mapped graphics resource may be accessed. <para/>
/// The pointer value in the device variable may change every time that the resource is mapped.<para/>
/// If the resource is not a buffer then it cannot be accessed via a pointer and <see cref="CUResult.ErrorNotMappedAsPointer"/>
/// exception is thrown. If the resource is not mapped then <see cref="CUResult.ErrorNotMapped"/> exception is thrown.
/// </summary>
/// <returns></returns>
Returns device variable through which the mapped graphics resource may be accessed.
The pointer value in the device variable may change every time that the resource is mapped.
If the resource is not a buffer then it cannot be accessed via a pointer and
exception is thrown. If the resource is not mapped then  exception is thrown.
Returns device variable through which the mapped graphics resource may be accessed . The pointer value in the device variable may change every time that the resource is mapped . If the resource is not a buffer then it cannot be accessed via a pointer and exception is thrown . If the resource is not mapped then exception is thrown .
public CudaDeviceVariable<T> GetMappedPointer<T>() where T : struct
        {
            if (disposed) throw new ObjectDisposedException(this.ToString());
            CUdeviceptr devPtr = new CUdeviceptr();
            SizeT size = 0;
            res = DriverAPINativeMethods.GraphicsInterop.cuGraphicsResourceGetMappedPointer_v2(ref devPtr, ref size, _cudaResource);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuGraphicsResourceGetMappedPointer", res));
            if (res != CUResult.Success)
                throw new CudaException(res);
            CudaDeviceVariable<T> retVar = new CudaDeviceVariable<T>(devPtr, false, size);
            return retVar;
        }
public CudaDeviceVariable < T > GetMappedPointer < T > ( ) where T : struct { if ( disposed ) throw new ObjectDisposedException ( this . ToString ( ) ) ; CUdeviceptr devPtr = new CUdeviceptr ( ) ; SizeT size = 0 ; res = DriverAPINativeMethods . GraphicsInterop . cuGraphicsResourceGetMappedPointer_v2 ( ref devPtr , ref size , _cudaResource ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; CudaDeviceVariable < T > retVar = new CudaDeviceVariable < T > ( devPtr , false , size ) ; return retVar ; }
Returns device variable through which the mapped graphics resource may be accessed.
Returns device variable through which the mapped graphics resource may be accessed .
None