From e3fca0b9e7f9397d93c204035e551c8d655413d0 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 10 Aug 2023 09:02:19 +0800 Subject: [PATCH] Rename Openblas device into Blas since mkldnn also have different blas. --- src/Sdcb.PaddleInference/PaddleDevice.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Sdcb.PaddleInference/PaddleDevice.cs b/src/Sdcb.PaddleInference/PaddleDevice.cs index 34f475f..511870f 100644 --- a/src/Sdcb.PaddleInference/PaddleDevice.cs +++ b/src/Sdcb.PaddleInference/PaddleDevice.cs @@ -117,12 +117,13 @@ public static Action TensorRt(Dictionary - /// Creates an action that sets up a Paddle configuration for using OpenBLAS on the CPU. + /// Creates an action that sets up a Paddle configuration for using BLAS on the CPU. /// /// The number of CPU math threads to use. Default value is 0. /// Whether to use memory optimized mode. Default value is true. /// Whether to enable GLog. Default value is false. /// The openblas paddle device definition. + [Obsolete("Use Blas instead.")] public static Action Openblas(int cpuMathThreadCount = 0, bool memoryOptimized = true, bool glogEnabled = false) { return cfg => @@ -132,6 +133,22 @@ public static Action Openblas(int cpuMathThreadCount = 0, bool mem }; } + /// + /// Creates an action that sets up a Paddle configuration for using BLAS on the CPU. + /// + /// The number of CPU math threads to use. Default value is 0. + /// Whether to use memory optimized mode. Default value is true. + /// Whether to enable GLog. Default value is false. + /// The openblas paddle device definition. + public static Action Blas(int cpuMathThreadCount = 0, bool memoryOptimized = true, bool glogEnabled = false) + { + return cfg => + { + cfg.CpuMathThreadCount = cpuMathThreadCount; + CommonAction(cfg, memoryOptimized, glogEnabled); + }; + } + /// /// Returns an Action delegate that configures PaddleConfig for use with Onnx. ///