Skip to content

Commit e3fca0b

Browse files
committed
Rename Openblas device into Blas since mkldnn also have different blas.
1 parent 2550c1c commit e3fca0b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/Sdcb.PaddleInference/PaddleDevice.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ public static Action<PaddleConfig> TensorRt(Dictionary<string, TensorRtDynamicSh
117117
}
118118

119119
/// <summary>
120-
/// Creates an action that sets up a Paddle configuration for using OpenBLAS on the CPU.
120+
/// Creates an action that sets up a Paddle configuration for using BLAS on the CPU.
121121
/// </summary>
122122
/// <param name="cpuMathThreadCount">The number of CPU math threads to use. Default value is 0.</param>
123123
/// <param name="memoryOptimized">Whether to use memory optimized mode. Default value is true.</param>
124124
/// <param name="glogEnabled">Whether to enable GLog. Default value is false.</param>
125125
/// <returns>The openblas paddle device definition.</returns>
126+
[Obsolete("Use Blas instead.")]
126127
public static Action<PaddleConfig> Openblas(int cpuMathThreadCount = 0, bool memoryOptimized = true, bool glogEnabled = false)
127128
{
128129
return cfg =>
@@ -132,6 +133,22 @@ public static Action<PaddleConfig> Openblas(int cpuMathThreadCount = 0, bool mem
132133
};
133134
}
134135

136+
/// <summary>
137+
/// Creates an action that sets up a Paddle configuration for using BLAS on the CPU.
138+
/// </summary>
139+
/// <param name="cpuMathThreadCount">The number of CPU math threads to use. Default value is 0.</param>
140+
/// <param name="memoryOptimized">Whether to use memory optimized mode. Default value is true.</param>
141+
/// <param name="glogEnabled">Whether to enable GLog. Default value is false.</param>
142+
/// <returns>The openblas paddle device definition.</returns>
143+
public static Action<PaddleConfig> Blas(int cpuMathThreadCount = 0, bool memoryOptimized = true, bool glogEnabled = false)
144+
{
145+
return cfg =>
146+
{
147+
cfg.CpuMathThreadCount = cpuMathThreadCount;
148+
CommonAction(cfg, memoryOptimized, glogEnabled);
149+
};
150+
}
151+
135152
/// <summary>
136153
/// Returns an Action delegate that configures PaddleConfig for use with Onnx.
137154
/// </summary>

0 commit comments

Comments
 (0)