Skip to content

Commit

Permalink
Rename Openblas device into Blas since mkldnn also have different blas.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Aug 10, 2023
1 parent 2550c1c commit e3fca0b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Sdcb.PaddleInference/PaddleDevice.cs
Expand Up @@ -117,12 +117,13 @@ public static Action<PaddleConfig> Gpu(int initialMemoryMB = 500, int deviceId =
}

/// <summary>
/// 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.
/// </summary>
/// <param name="cpuMathThreadCount">The number of CPU math threads to use. Default value is 0.</param>
/// <param name="memoryOptimized">Whether to use memory optimized mode. Default value is true.</param>
/// <param name="glogEnabled">Whether to enable GLog. Default value is false.</param>
/// <returns>The openblas paddle device definition.</returns>
[Obsolete("Use Blas instead.")]
public static Action<PaddleConfig> Openblas(int cpuMathThreadCount = 0, bool memoryOptimized = true, bool glogEnabled = false)
{
return cfg =>
Expand All @@ -132,6 +133,22 @@ public static Action<PaddleConfig> Openblas(int cpuMathThreadCount = 0, bool mem
};
}

/// <summary>
/// Creates an action that sets up a Paddle configuration for using BLAS on the CPU.
/// </summary>
/// <param name="cpuMathThreadCount">The number of CPU math threads to use. Default value is 0.</param>
/// <param name="memoryOptimized">Whether to use memory optimized mode. Default value is true.</param>
/// <param name="glogEnabled">Whether to enable GLog. Default value is false.</param>
/// <returns>The openblas paddle device definition.</returns>
public static Action<PaddleConfig> Blas(int cpuMathThreadCount = 0, bool memoryOptimized = true, bool glogEnabled = false)
{
return cfg =>
{
cfg.CpuMathThreadCount = cpuMathThreadCount;
CommonAction(cfg, memoryOptimized, glogEnabled);
};
}

/// <summary>
/// Returns an Action delegate that configures PaddleConfig for use with Onnx.
/// </summary>
Expand Down

0 comments on commit e3fca0b

Please sign in to comment.