Browse Source

FFT: include MKL version in MKL provider description (ToString)

benchmark-la
Christoph Ruegg 10 years ago
parent
commit
ea3b57c4b1
  1. 20
      src/NativeProviders/MKL/capabilities.cpp
  2. 23
      src/Numerics/Providers/Common/Mkl/MklProvider.cs
  3. 3
      src/Numerics/Providers/Common/Mkl/MklProviderCapabilities.cs

20
src/NativeProviders/MKL/capabilities.cpp

@ -40,6 +40,26 @@ extern "C" {
return 0; return 0;
#endif #endif
// MKL VERSION
case 32: // major version
{
MKLVersion Version;
mkl_get_version(&Version);
return Version.MajorVersion;
}
case 33: // minor version
{
MKLVersion Version;
mkl_get_version(&Version);
return Version.MinorVersion;
}
case 34: // update version
{
MKLVersion Version;
mkl_get_version(&Version);
return Version.UpdateVersion;
}
// COMMON/SHARED // COMMON/SHARED
case 64: return 11; // revision case 64: return 11; // revision
case 65: return 1; // numerical consistency, precision and accuracy modes case 65: return 1; // numerical consistency, precision and accuracy modes

23
src/Numerics/Providers/Common/Mkl/MklProvider.cs

@ -28,11 +28,13 @@
// </copyright> // </copyright>
using System; using System;
using System.Collections.Generic;
namespace MathNet.Numerics.Providers.Common.Mkl namespace MathNet.Numerics.Providers.Common.Mkl
{ {
internal static class MklProvider internal static class MklProvider
{ {
static Version _mklVersion;
static int _nativeRevision; static int _nativeRevision;
static bool _nativeX86; static bool _nativeX86;
static bool _nativeX64; static bool _nativeX64;
@ -54,6 +56,11 @@ namespace MathNet.Numerics.Providers.Common.Mkl
_nativeIA64 = SafeNativeMethods.query_capability((int)ProviderPlatform.ia64) > 0; _nativeIA64 = SafeNativeMethods.query_capability((int)ProviderPlatform.ia64) > 0;
_nativeRevision = SafeNativeMethods.query_capability((int)ProviderConfig.Revision); _nativeRevision = SafeNativeMethods.query_capability((int)ProviderConfig.Revision);
_mklVersion = new Version(
SafeNativeMethods.query_capability((int)ProviderConfig.MklMajorVersion),
SafeNativeMethods.query_capability((int)ProviderConfig.MklMinorVersion),
SafeNativeMethods.query_capability((int)ProviderConfig.MklUpdateVersion));
} }
catch (DllNotFoundException e) catch (DllNotFoundException e)
{ {
@ -192,9 +199,19 @@ namespace MathNet.Numerics.Providers.Common.Mkl
public static string Describe() public static string Describe()
{ {
return string.Format("Intel MKL ({1}; revision {0})", var parts = new List<string>();
_nativeRevision, if (_nativeX86) parts.Add("x86");
_nativeX86 ? "x86" : _nativeX64 ? "x64" : _nativeIA64 ? "IA64" : "unknown"); if (_nativeX64) parts.Add("x64");
if (_nativeIA64) parts.Add("IA64");
parts.Add("revision " + _nativeRevision);
if (_mklVersion.Major > 0)
{
parts.Add(_mklVersion.Build == 0
? string.Concat("MKL ", _mklVersion.ToString(2))
: string.Concat("MKL ", _mklVersion.ToString(2), " Update ", _mklVersion.Build));
}
return string.Concat("Intel MKL (", string.Join("; ", parts), ")");
} }
enum MklMemoryRequestMode : int enum MklMemoryRequestMode : int

3
src/Numerics/Providers/Common/Mkl/MklProviderCapabilities.cs

@ -38,6 +38,9 @@ namespace MathNet.Numerics.Providers.Common.Mkl
internal enum ProviderConfig : int internal enum ProviderConfig : int
{ {
MklMajorVersion = 32,
MklMinorVersion = 33,
MklUpdateVersion = 34,
Revision = 64, Revision = 64,
Precision = 65, Precision = 65,
Threading = 66, Threading = 66,

Loading…
Cancel
Save