From 4bd32799cfcf3ae2e128d5625f92e95241335380 Mon Sep 17 00:00:00 2001 From: Loren Schwiebert Date: Mon, 20 Jan 2025 14:32:29 -0500 Subject: [PATCH 1/2] Recognize newer OpenMP version date-codes --- src/Main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index 262b151d5..688633590 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -113,12 +113,12 @@ int main(int argc, char *argv[]) { #endif // Print OpenMP version if recognized or OpenMP date code if not recognized. #ifdef _OPENMP - std::unordered_map omp_map{ + std::unordered_map omp_map{ {200505, "2.5"}, {200805, "3.0"}, {201107, "3.1"}, {201307, "4.0"}, {201511, "4.5"}, {201611, "5.0 Preview 1"}, - {201811, "5.0"}}; - std::unordered_map::const_iterator match = - omp_map.find(_OPENMP); + {201811, "5.0"}, {202011, "5.1"}, {202111, "5.2"}, + {202411, "6.0"}}; + auto match = omp_map.find(_OPENMP); if (match == omp_map.end()) printf("%-40s %u\n", "Info: Compiled with OpenMP Version", _OPENMP); else From a3138bf669ddb0b148f729cf75e23272b55fd4ac Mon Sep 17 00:00:00 2001 From: Loren Schwiebert Date: Mon, 20 Jan 2025 14:50:34 -0500 Subject: [PATCH 2/2] Reformat updated code and revise comment --- src/Main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index 688633590..7b7f9c37e 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -111,13 +111,12 @@ int main(int argc, char *argv[]) { #if defined _OPENMP && _OPENMP < 201511 printf("Warning: OpenMP version < 4.5. GOMC will not run optimally!\n"); #endif - // Print OpenMP version if recognized or OpenMP date code if not recognized. + // Print the OpenMP version if recognized or instead the OpenMP date code. #ifdef _OPENMP std::unordered_map omp_map{ - {200505, "2.5"}, {200805, "3.0"}, {201107, "3.1"}, - {201307, "4.0"}, {201511, "4.5"}, {201611, "5.0 Preview 1"}, - {201811, "5.0"}, {202011, "5.1"}, {202111, "5.2"}, - {202411, "6.0"}}; + {200505, "2.5"}, {200805, "3.0"}, {201107, "3.1"}, {201307, "4.0"}, + {201511, "4.5"}, {201611, "5.0 Preview 1"}, {201811, "5.0"}, + {202011, "5.1"}, {202111, "5.2"}, {202411, "6.0"}}; auto match = omp_map.find(_OPENMP); if (match == omp_map.end()) printf("%-40s %u\n", "Info: Compiled with OpenMP Version", _OPENMP);