Browse Source

Mark delegates with UnmanagedFunctionPointer

tags/v0.20
Sam Harwell 5 years ago
parent
commit
e62184157b
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/TensorFlowNET.Core/APIs/c_api.cs

+ 4
- 0
src/TensorFlowNET.Core/APIs/c_api.cs View File

@@ -50,8 +50,12 @@ namespace Tensorflow
return handle == IntPtr.Zero ? String.Empty : Marshal.PtrToStringAnsi(handle); return handle == IntPtr.Zero ? String.Empty : Marshal.PtrToStringAnsi(handle);
} }


[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate void Deallocator(IntPtr data, IntPtr size, ref DeallocatorArgs args); public delegate void Deallocator(IntPtr data, IntPtr size, ref DeallocatorArgs args);

[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate void DeallocatorV2(IntPtr data, long size, IntPtr args); public delegate void DeallocatorV2(IntPtr data, long size, IntPtr args);

public struct DeallocatorArgs public struct DeallocatorArgs
{ {
internal static unsafe c_api.DeallocatorArgs* EmptyPtr; internal static unsafe c_api.DeallocatorArgs* EmptyPtr;


Loading…
Cancel
Save