コード例 #1
0
 public CuDevicePtrSafe(
     CuDevicePtr devicePtr,
     CuDevicePtrDeallocator deallocator)
 {
     DevicePtr = devicePtr;
     _deallocator = deallocator;
 }
コード例 #2
0
        /// <inheritdoc cref="LibCuda.MemFree(CuDevicePtr)"/>
        public void Dispose()
        {
            var handle = Interlocked.Exchange(ref Handle, IntPtr.Zero);
            if (handle == IntPtr.Zero) return;
            var obj = new CuDevicePtr { Handle = handle };

            MemFree(obj);
        }
コード例 #3
0
        /// <inheritdoc cref="LibCuVideo.UnmapVideoFrame64(CuVideoDecoder, CuDevicePtr)"/>
        public void Dispose()
        {
            var handle = Interlocked.Exchange(ref Handle, IntPtr.Zero);
            if (handle == IntPtr.Zero) return;
            var obj = new CuDevicePtr { Handle = handle };

            var result = Environment.Is64BitProcess
                ? UnmapVideoFrame64(_decoder, obj)
                : UnmapVideoFrame(_decoder, obj);

            CheckResult(result);
        }
コード例 #4
0
ファイル: LibCuda.Ipc.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult IpcGetMemHandle(CuIpcMemHandle *pHandle, CuDevicePtr dptr);
コード例 #5
0
 public CuVideoFrame(CuDevicePtr devicePtr, CuVideoDecoder decoder)
 {
     Handle = devicePtr.Handle;
     _decoder = decoder;
 }
コード例 #6
0
ファイル: LibCuVideo.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MapVideoFrame64(CuVideoDecoder decoder, int nPicIdx,
                                               out CuDevicePtr devPtr, out int pitch, ref CuVideoProcParams vpp);
コード例 #7
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD2D32Async(CuDevicePtr dstDevice, IntPtr dstPitch, int ui, IntPtr width, IntPtr height, CuStream hStream);
コード例 #8
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD8(CuDevicePtr dstDevice, byte uc, IntPtr n);
コード例 #9
0
 public static extern CuResult MemRangeGetAttributes(IntPtr data, IntPtr dataSizes, [MarshalAs(UnmanagedType.LPArray)] MemoryRangeAttribute[] attributes, IntPtr numAttributes, CuDevicePtr devPtr, IntPtr count);
コード例 #10
0
 public static extern CuResult MemRangeGetAttribute(IntPtr data, IntPtr dataSize, MemoryRangeAttribute attribute, CuDevicePtr devPtr, IntPtr count);
コード例 #11
0
 public static extern CuResult MemAdvise(CuDevicePtr devPtr, IntPtr count, MemoryAdvice advice, CuDevice device);
コード例 #12
0
 public static extern CuResult MemPrefetchAsync(CuDevicePtr devPtr, IntPtr count, CuDevice dstDevice, CuStream hStream);
コード例 #13
0
 public static extern CuResult PointerGetAttribute(IntPtr data, PointerAttribute attribute, CuDevicePtr ptr);
コード例 #14
0
ファイル: LibCuda.Ipc.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult IpcCloseMemHandle(CuDevicePtr dptr);
コード例 #15
0
ファイル: LibCuda.Ipc.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult IpcOpenMemHandle(out CuDevicePtr pdptr, CuIpcMemHandle handle, IpcMemoryFlags flags);
コード例 #16
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD16Async(CuDevicePtr dstDevice, short us, IntPtr n, CuStream hStream);
コード例 #17
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD32Async(CuDevicePtr dstDevice, int ui, IntPtr n, CuStream hStream);
コード例 #18
0
 public static extern void ResizeNv12(
     CuDevicePtr dstNv12, int dstPitch, int dstWidth, int dstHeight,
     CuDevicePtr srcNv12, int srcPitch, int srcWidth, int srcHeight,
     CuDevicePtr dstNv12UV);
コード例 #19
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD2D16Async(CuDevicePtr dstDevice, IntPtr dstPitch, short us, IntPtr width, IntPtr height, CuStream hStream);
コード例 #20
0
 public static extern CuResult GraphicsResourceGetMappedPointer(out CuDevicePtr pDevPtr, out IntPtr pSize, CuGraphicsResource resource);
コード例 #21
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD16(CuDevicePtr dstDevice, short us, IntPtr n);
コード例 #22
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD32(CuDevicePtr dstDevice, int ui, IntPtr n);
コード例 #23
0
ファイル: LibCuVideo.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult UnmapVideoFrame64(CuVideoDecoder decoder, CuDevicePtr devPtr);
コード例 #24
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD2D8(CuDevicePtr dstDevice, IntPtr dstPitch, byte uc, IntPtr width, IntPtr height);
コード例 #25
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD2D16(CuDevicePtr dstDevice, IntPtr dstPitch, short us, IntPtr width, IntPtr height);
コード例 #26
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD2D32(CuDevicePtr dstDevice, IntPtr dstPitch, int ui, IntPtr width, IntPtr height);
コード例 #27
0
 private CuDeviceMemory(CuDevicePtr devicePtr)
 {
     Handle = devicePtr.Handle;
 }
コード例 #28
0
ファイル: LibCuda.Memset.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult MemsetD8Async(CuDevicePtr dstDevice, byte uc, IntPtr n, CuStream hStream);
コード例 #29
0
ファイル: LibCuda.Stream.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult StreamAttachMemAsync(CuStream hStream, CuDevicePtr dptr, IntPtr length, MemoryAttachFlags flags);
コード例 #30
0
ファイル: LibCuda.Event.cs プロジェクト: jlennox/NvEncSharp
 public static extern CuResult StreamWriteValue64(CuStream stream, CuDevicePtr addr, long value, int flags);