Skip to content

Commit

Permalink
move legacy api into PaddleNative.legacy.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Jun 27, 2024
1 parent 9cb4b4e commit 7f27cfa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/Sdcb.PaddleInference/Native/PaddleNative.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ public partial class PaddleNative
[DllImport(PaddleInferenceCLib)]
public static extern void PD_ConfigEnableUseGpu(IntPtr pd_config, ulong memory_pool_init_size_mb, int device_id, PD_PrecisionType precision_mode);

/// <summary>Turn on GPU.</summary>
/// <param name="pd_config">(C API type: PD_Config*) </param>
/// <param name="memory_pool_init_size_mb">initial size of the GPU memory pool in MB.</param>
/// <param name="device_id">device_id the GPU card to use.</param>
[DllImport(PaddleInferenceCLib)]
public static extern void PD_ConfigEnableUseGpu(IntPtr pd_config, ulong memory_pool_init_size_mb, int device_id);

/// <summary>Turn off GPU.</summary>
/// <param name="pd_config">(C API type: PD_Config*) </param>
[DllImport(PaddleInferenceCLib)]
Expand Down
14 changes: 14 additions & 0 deletions src/Sdcb.PaddleInference/Native/PaddleNative.legacy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Runtime.InteropServices;

namespace Sdcb.PaddleInference.Native;

public partial class PaddleNative
{
/// <summary>Turn on GPU, note: this api is only available when version &lt; 2.5.0</summary>
/// <param name="pd_config">(C API type: PD_Config*) </param>
/// <param name="memory_pool_init_size_mb">initial size of the GPU memory pool in MB.</param>
/// <param name="device_id">device_id the GPU card to use.</param>
[DllImport(PaddleInferenceCLib)]
public static extern void PD_ConfigEnableUseGpu(IntPtr pd_config, ulong memory_pool_init_size_mb, int device_id);
}

0 comments on commit 7f27cfa

Please sign in to comment.