diff --git a/src/Numerics/Providers/Common/Cuda/CudaProvider.cs b/src/Numerics/Providers/Common/Cuda/CudaProvider.cs index a0d80a04..9f175ed2 100644 --- a/src/Numerics/Providers/Common/Cuda/CudaProvider.cs +++ b/src/Numerics/Providers/Common/Cuda/CudaProvider.cs @@ -36,12 +36,20 @@ namespace MathNet.Numerics.Providers.Common.Cuda { public static class CudaProvider { + const int _designTimeRevision = 1; + const int _minimumCompatibleRevision = 1; + static int _nativeRevision; static bool _nativeX86; static bool _nativeX64; static bool _nativeIA64; static bool _loaded; + public static bool IsAvailable(string hintPath = null) + { + return IsAvailable(_minimumCompatibleRevision, hintPath); + } + internal static bool IsAvailable(int minRevision, string hintPath) { if (_loaded && _nativeRevision >= minRevision) @@ -67,6 +75,11 @@ namespace MathNet.Numerics.Providers.Common.Cuda } } + public static void Load(string hintPath = null) + { + Load(_minimumCompatibleRevision, hintPath); + } + internal static void Load(int minRevision, string hintPath) { if (_loaded && _nativeRevision >= minRevision) diff --git a/src/Numerics/Providers/Common/Mkl/MklProvider.cs b/src/Numerics/Providers/Common/Mkl/MklProvider.cs index fb789bf7..d31f2b55 100644 --- a/src/Numerics/Providers/Common/Mkl/MklProvider.cs +++ b/src/Numerics/Providers/Common/Mkl/MklProvider.cs @@ -37,6 +37,8 @@ namespace MathNet.Numerics.Providers.Common.Mkl public static class MklProvider { const int _designTimeRevision = 12; + const int _minimumCompatibleRevision = 4; + static int _nativeRevision; static Version _mklVersion; static bool _nativeX86; @@ -44,6 +46,11 @@ namespace MathNet.Numerics.Providers.Common.Mkl static bool _nativeIA64; static bool _loaded; + public static bool IsAvailable(string hintPath = null) + { + return IsAvailable(_minimumCompatibleRevision, hintPath); + } + internal static bool IsAvailable(int minRevision, string hintPath) { if (_loaded && _nativeRevision >= minRevision) @@ -69,6 +76,11 @@ namespace MathNet.Numerics.Providers.Common.Mkl } } + public static void Load(string hintPath = null) + { + Load(_minimumCompatibleRevision, hintPath); + } + internal static void Load(int minRevision, string hintPath) { if (_loaded && _nativeRevision >= minRevision) diff --git a/src/Numerics/Providers/Common/OpenBlas/OpenBlasProvider.cs b/src/Numerics/Providers/Common/OpenBlas/OpenBlasProvider.cs index 12ea2e70..c2d0d474 100644 --- a/src/Numerics/Providers/Common/OpenBlas/OpenBlasProvider.cs +++ b/src/Numerics/Providers/Common/OpenBlas/OpenBlasProvider.cs @@ -36,6 +36,9 @@ namespace MathNet.Numerics.Providers.Common.OpenBlas { internal static class OpenBlasProvider { + const int _designTimeRevision = 1; + const int _minimumCompatibleRevision = 1; + static int _nativeRevision; static bool _nativeX86; static bool _nativeX64; @@ -43,6 +46,11 @@ namespace MathNet.Numerics.Providers.Common.OpenBlas static bool _nativeARM; static bool _loaded; + public static bool IsAvailable(string hintPath = null) + { + return IsAvailable(_minimumCompatibleRevision, hintPath); + } + internal static bool IsAvailable(int minRevision, string hintPath) { if (_loaded && _nativeRevision >= minRevision) @@ -68,6 +76,11 @@ namespace MathNet.Numerics.Providers.Common.OpenBlas } } + public static void Load(string hintPath = null) + { + Load(_minimumCompatibleRevision, hintPath); + } + internal static void Load(int minRevision, string hintPath) { if (_loaded && _nativeRevision >= minRevision)