From ec9e4abf9cf8292712cfc70be069f4ee6378059e Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Mon, 24 May 2021 20:30:03 +0200 Subject: [PATCH] Control.Describe to include CPU architecture and identifier if known --- src/Numerics/Control.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Numerics/Control.cs b/src/Numerics/Control.cs index 487658b4..5094a415 100644 --- a/src/Numerics/Control.cs +++ b/src/Numerics/Control.cs @@ -28,15 +28,21 @@ // using System; -using System.Linq; using System.Reflection; -using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using MathNet.Numerics.Providers.SparseSolver; using MathNet.Numerics.Providers.FourierTransform; using MathNet.Numerics.Providers.LinearAlgebra; +#if NET40 +using System.Linq; +#endif + +#if !NET40 && !NET461 +using System.Runtime.InteropServices; +#endif + namespace MathNet.Numerics { /// @@ -346,6 +352,17 @@ namespace MathNet.Numerics sb.AppendLine($"Framework: {RuntimeInformation.FrameworkDescription}"); sb.AppendLine($"Process Architecture: {RuntimeInformation.ProcessArchitecture}"); #endif + var processorArchitecture = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"); + if (!String.IsNullOrEmpty(processorArchitecture)) + { + sb.AppendLine($"Processor Architecture: {processorArchitecture}"); + } + var processorId = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"); + if (!String.IsNullOrEmpty(processorId)) + { + sb.AppendLine($"Processor Identifier: {processorId}"); + } + return sb.ToString(); } }