From c49e18cad44c46edf4b114db61c437a08accde7b Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 31 Aug 2021 18:06:28 +0100 Subject: [PATCH] Projucer: Add option to automatically set up oneMKL in VS exporters --- .../ProjectSaving/jucer_ProjectExport_MSVC.h | 21 +++++++++++++++---- .../Source/Utility/Helpers/jucer_PresetIDs.h | 1 + modules/juce_dsp/juce_dsp.h | 9 ++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index 6da291682c..cde6da96e7 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -42,6 +42,7 @@ public: : ProjectExporter (p, t), IPPLibraryValue (settings, Ids::IPPLibrary, getUndoManager()), IPP1ALibraryValue (settings, Ids::IPP1ALibrary, getUndoManager()), + MKL1ALibraryValue (settings, Ids::MKL1ALibrary, getUndoManager()), platformToolsetValue (settings, Ids::toolset, getUndoManager()), targetPlatformVersion (settings, Ids::windowsTargetPlatformVersion, getUndoManager()), manifestFileValue (settings, Ids::msvcManifestFile, getUndoManager()) @@ -59,6 +60,7 @@ public: //============================================================================== String getIPPLibrary() const { return IPPLibraryValue.get(); } String getIPP1ALibrary() const { return IPP1ALibraryValue.get(); } + String getMKL1ALibrary() const { return MKL1ALibraryValue.get(); } String getPlatformToolset() const { return platformToolsetValue.get(); } String getWindowsTargetPlatformVersion() const { return targetPlatformVersion.get(); } @@ -446,14 +448,15 @@ public: addWindowsTargetPlatformToConfig (*e); - struct IPPLibraryInfo + struct IntelLibraryInfo { String libraryKind; String configString; }; - for (const auto& info : { IPPLibraryInfo { owner.getIPPLibrary(), "UseIntelIPP" }, - IPPLibraryInfo { owner.getIPP1ALibrary(), "UseIntelIPP1A" }}) + for (const auto& info : { IntelLibraryInfo { owner.getIPPLibrary(), "UseIntelIPP" }, + IntelLibraryInfo { owner.getIPP1ALibrary(), "UseIntelIPP1A" }, + IntelLibraryInfo { owner.getMKL1ALibrary(), "UseInteloneMKL" } }) { if (info.libraryKind.isNotEmpty()) e->createNewChildElement (info.configString)->addTextElement (info.libraryKind); @@ -1501,6 +1504,11 @@ public: { var(), "true", "Static_Library", "Dynamic_Library" }), "Enable this to use Intel's Integrated Performance Primitives library, supplied as part of the oneAPI toolkit."); + props.add (new ChoicePropertyComponent (MKL1ALibraryValue, "Use MKL Library (oneAPI)", + { "No", "Parallel", "Sequential", "Cluster" }, + { var(), "Parallel", "Sequential", "Cluster" }), + "Enable this to use Intel's MKL library, supplied as part of the oneAPI toolkit."); + { auto isWindows10SDK = getVisualStudioVersion() > 14; @@ -1584,7 +1592,12 @@ protected: mutable File rcFile, iconFile, packagesConfigFile; OwnedArray targets; - ValueWithDefault IPPLibraryValue, IPP1ALibraryValue, platformToolsetValue, targetPlatformVersion, manifestFileValue; + ValueWithDefault IPPLibraryValue, + IPP1ALibraryValue, + MKL1ALibraryValue, + platformToolsetValue, + targetPlatformVersion, + manifestFileValue; File getProjectFile (const String& extension, const String& target) const { diff --git a/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h b/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h index f31e9051d2..1c1738d11f 100644 --- a/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h +++ b/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h @@ -152,6 +152,7 @@ namespace Ids DECLARE_ID (debugInformationFormat); DECLARE_ID (IPPLibrary); DECLARE_ID (IPP1ALibrary); + DECLARE_ID (MKL1ALibrary); DECLARE_ID (msvcModuleDefinitionFile); DECLARE_ID (bigIcon); DECLARE_ID (smallIcon); diff --git a/modules/juce_dsp/juce_dsp.h b/modules/juce_dsp/juce_dsp.h index 07a29ddb56..b357174c46 100644 --- a/modules/juce_dsp/juce_dsp.h +++ b/modules/juce_dsp/juce_dsp.h @@ -123,10 +123,11 @@ If this flag is set, then JUCE will use Intel's MKL for JUCE's FFT and convolution classes. - The folder containing the mkl_dfti.h header must be in your header - search paths when using this flag. You also need to add all the necessary - intel mkl libraries to the "External Libraries to Link" field in the - Projucer. + If you're using the Projucer's Visual Studio exporter, you should also set + the "Use MKL Library (oneAPI)" option in the exporter settings to + "Sequential" or "Parallel". If you're not using the Visual Studio exporter, + the folder containing the mkl_dfti.h header must be in your header search + paths, and you must link against all the necessary MKL libraries. */ #ifndef JUCE_DSP_USE_INTEL_MKL #define JUCE_DSP_USE_INTEL_MKL 0