From 7f27cfa57e084f7ec8a226960c3b57d84a2fb573 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 27 Jun 2024 18:57:30 +0800 Subject: [PATCH] move legacy api into PaddleNative.legacy.cs --- src/Sdcb.PaddleInference/Native/PaddleNative.g.cs | 7 ------- .../Native/PaddleNative.legacy.cs | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 src/Sdcb.PaddleInference/Native/PaddleNative.legacy.cs diff --git a/src/Sdcb.PaddleInference/Native/PaddleNative.g.cs b/src/Sdcb.PaddleInference/Native/PaddleNative.g.cs index 20858e0..6f6e5f4 100644 --- a/src/Sdcb.PaddleInference/Native/PaddleNative.g.cs +++ b/src/Sdcb.PaddleInference/Native/PaddleNative.g.cs @@ -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); - /// Turn on GPU. - /// (C API type: PD_Config*) - /// initial size of the GPU memory pool in MB. - /// device_id the GPU card to use. - [DllImport(PaddleInferenceCLib)] - public static extern void PD_ConfigEnableUseGpu(IntPtr pd_config, ulong memory_pool_init_size_mb, int device_id); - /// Turn off GPU. /// (C API type: PD_Config*) [DllImport(PaddleInferenceCLib)] diff --git a/src/Sdcb.PaddleInference/Native/PaddleNative.legacy.cs b/src/Sdcb.PaddleInference/Native/PaddleNative.legacy.cs new file mode 100644 index 0000000..50abb33 --- /dev/null +++ b/src/Sdcb.PaddleInference/Native/PaddleNative.legacy.cs @@ -0,0 +1,14 @@ +using System; +using System.Runtime.InteropServices; + +namespace Sdcb.PaddleInference.Native; + +public partial class PaddleNative +{ + /// Turn on GPU, note: this api is only available when version < 2.5.0 + /// (C API type: PD_Config*) + /// initial size of the GPU memory pool in MB. + /// device_id the GPU card to use. + [DllImport(PaddleInferenceCLib)] + public static extern void PD_ConfigEnableUseGpu(IntPtr pd_config, ulong memory_pool_init_size_mb, int device_id); +}