From 8c96d8b829228c6e6ad6f42f6655423491d546e0 Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Tue, 1 Oct 2019 19:09:08 +0000 Subject: [PATCH 01/10] [TVM] Add an option to use OMP thread pool --- CMakeLists.txt | 7 +++++++ cmake/config.cmake | 3 +++ src/runtime/thread_pool.cc | 42 +++++++++++++++++++++++++++++++++++++- 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10730ac718b4..976d92519ff1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ tvm_option(USE_LLVM "Build with LLVM, can be set to specific llvm-config path" O tvm_option(USE_STACKVM_RUNTIME "Include stackvm into the runtime" OFF) tvm_option(USE_GRAPH_RUNTIME "Build with tiny graph runtime" ON) tvm_option(USE_GRAPH_RUNTIME_DEBUG "Build with tiny graph runtime debug mode" OFF) +tvm_option(USE_OMP "Build with OpenMP thread pool implementation" OFF) tvm_option(USE_RELAY_DEBUG "Building Relay in debug mode..." OFF) tvm_option(USE_SGX "Build with SGX" OFF) tvm_option(USE_RTTI "Build with RTTI" ON) @@ -154,6 +155,12 @@ list(APPEND COMPILER_SRCS ${RELAY_BACKEND_SRCS}) list(APPEND COMPILER_SRCS ${RELAY_IR_SRCS}) list(APPEND COMPILER_SRCS ${RELAY_QNN_SRCS}) +if(USE_OMP) + message(STATUS "Build with OpenMP") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") + add_definitions(-DUSE_OMP=1) +endif(USE_OMP) + if(USE_VM_PROFILER) message(STATUS "Build compiler with Relay VM profiler support...") file(GLOB BACKEND_VM_PROFILER_SRCS src/relay/backend/vm/profiler/*.cc) diff --git a/cmake/config.cmake b/cmake/config.cmake index d92c2151d9c8..6286584c26b4 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -115,6 +115,9 @@ set(USE_BLAS none) # set(USE_MKL_PATH ) if using `pip install mkl` set(USE_MKL_PATH none) +# Whether use OpenMP thread pool +set(USE_OMP OFF) + # Whether use contrib.random in runtime set(USE_RANDOM OFF) diff --git a/src/runtime/thread_pool.cc b/src/runtime/thread_pool.cc index 2e101364db2a..f66de51b2731 100644 --- a/src/runtime/thread_pool.cc +++ b/src/runtime/thread_pool.cc @@ -39,6 +39,7 @@ #include #include #include +#include const constexpr int kL1CacheBytes = 64; @@ -46,7 +47,8 @@ namespace tvm { namespace runtime { namespace { -constexpr uint32_t kDefaultSpinCount = 300000; +//constexpr uint32_t kDefaultSpinCount = 300000; +constexpr uint32_t kDefaultSpinCount = 0; uint32_t GetSpinCount() { const char* val = getenv("TVM_THREAD_POOL_SPIN_COUNT"); @@ -394,9 +396,43 @@ int TVMBackendParallelLaunch( FTVMParallelLambda flambda, void* cdata, int num_task) { +#ifndef USE_OMP int res = tvm::runtime::ThreadPool::ThreadLocal()->Launch( flambda, cdata, num_task, 1); return res; +#else + const char *val = getenv("TVM_NUM_THREADS"); + int num_workers; + if (val == nullptr) { + val = getenv("OMP_NUM_THREADS"); + } + if (val != nullptr) { + num_workers = atoi(val); + } else { +#if defined(_M_X64) || defined(__x86_64__) + // Half to not count hyper threading. + num_workers = std::thread::hardware_concurrency() / 2; +#else + num_workers = std::thread::hardware_concurrency(); +#endif + } + num_workers = std::max(num_workers, 1); + if (num_task ==0) num_task = num_workers; + omp_set_num_threads(num_workers); + #pragma omp parallel num_threads(num_workers) + { + TVMParallelGroupEnv env; + env.num_task = num_task; + std::atomic* sync_counter = new std::atomic[num_task * tvm::runtime::kSyncStride]; + for (int i = 0; i < num_task; ++i) { + sync_counter[i * tvm::runtime::kSyncStride].store( + 0, std::memory_order_relaxed); + } + env.sync_handle = sync_counter; + (*flambda)(omp_get_thread_num(), &env, cdata); + } + return 0; +#endif } int TVMBackendParallelBarrier(int task_id, TVMParallelGroupEnv* penv) { @@ -410,7 +446,11 @@ int TVMBackendParallelBarrier(int task_id, TVMParallelGroupEnv* penv) { if (i != task_id) { while (sync_counter[i * kSyncStride].load( std::memory_order_relaxed) <= old_counter) { +#ifdef USE_OMP + #pragma omp taskyield +#else tvm::runtime::threading::Yield(); +#endif } } } From 36782fb73488eca2dcf81dcf06008c9e9c8232fc Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Tue, 8 Oct 2019 17:43:48 +0000 Subject: [PATCH 02/10] fix --- src/runtime/thread_pool.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/runtime/thread_pool.cc b/src/runtime/thread_pool.cc index f66de51b2731..c7db94fcf2d3 100644 --- a/src/runtime/thread_pool.cc +++ b/src/runtime/thread_pool.cc @@ -47,8 +47,7 @@ namespace tvm { namespace runtime { namespace { -//constexpr uint32_t kDefaultSpinCount = 300000; -constexpr uint32_t kDefaultSpinCount = 0; +constexpr uint32_t kDefaultSpinCount = 300000; uint32_t GetSpinCount() { const char* val = getenv("TVM_THREAD_POOL_SPIN_COUNT"); From 995682eebfe0be727a2a2aa60a672e9a1fd52fdb Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Tue, 8 Oct 2019 18:00:11 +0000 Subject: [PATCH 03/10] lint --- src/runtime/thread_pool.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/runtime/thread_pool.cc b/src/runtime/thread_pool.cc index c7db94fcf2d3..250c12304a54 100644 --- a/src/runtime/thread_pool.cc +++ b/src/runtime/thread_pool.cc @@ -29,6 +29,9 @@ #include #include #include +#ifdef USE_OMP +#include +#endif #include #include #include @@ -39,7 +42,6 @@ #include #include #include -#include const constexpr int kL1CacheBytes = 64; @@ -410,9 +412,9 @@ int TVMBackendParallelLaunch( } else { #if defined(_M_X64) || defined(__x86_64__) // Half to not count hyper threading. - num_workers = std::thread::hardware_concurrency() / 2; + num_workers = std::thread::hardware_concurrency() / 2; #else - num_workers = std::thread::hardware_concurrency(); + num_workers = std::thread::hardware_concurrency(); #endif } num_workers = std::max(num_workers, 1); @@ -424,9 +426,9 @@ int TVMBackendParallelLaunch( env.num_task = num_task; std::atomic* sync_counter = new std::atomic[num_task * tvm::runtime::kSyncStride]; for (int i = 0; i < num_task; ++i) { - sync_counter[i * tvm::runtime::kSyncStride].store( - 0, std::memory_order_relaxed); - } + sync_counter[i * tvm::runtime::kSyncStride].store( + 0, std::memory_order_relaxed); + } env.sync_handle = sync_counter; (*flambda)(omp_get_thread_num(), &env, cdata); } From d53403e2211dfefb9a9dd0ef0c533fd7d3fdebf1 Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Fri, 11 Oct 2019 17:44:11 +0000 Subject: [PATCH 04/10] fix --- src/runtime/thread_pool.cc | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/runtime/thread_pool.cc b/src/runtime/thread_pool.cc index 250c12304a54..33ee27bc8450 100644 --- a/src/runtime/thread_pool.cc +++ b/src/runtime/thread_pool.cc @@ -402,23 +402,8 @@ int TVMBackendParallelLaunch( flambda, cdata, num_task, 1); return res; #else - const char *val = getenv("TVM_NUM_THREADS"); - int num_workers; - if (val == nullptr) { - val = getenv("OMP_NUM_THREADS"); - } - if (val != nullptr) { - num_workers = atoi(val); - } else { -#if defined(_M_X64) || defined(__x86_64__) - // Half to not count hyper threading. - num_workers = std::thread::hardware_concurrency() / 2; -#else - num_workers = std::thread::hardware_concurrency(); -#endif - } - num_workers = std::max(num_workers, 1); - if (num_task ==0) num_task = num_workers; + int num_workers = tvm::runtime::threading::MaxConcurrency(); + if (num_task == 0) num_task = num_workers; omp_set_num_threads(num_workers); #pragma omp parallel num_threads(num_workers) { @@ -437,6 +422,9 @@ int TVMBackendParallelLaunch( } int TVMBackendParallelBarrier(int task_id, TVMParallelGroupEnv* penv) { +#ifdef USE_OMP + #pragma omp barrier +#else using tvm::runtime::kSyncStride; int num_task = penv->num_task; std::atomic* sync_counter = @@ -447,14 +435,11 @@ int TVMBackendParallelBarrier(int task_id, TVMParallelGroupEnv* penv) { if (i != task_id) { while (sync_counter[i * kSyncStride].load( std::memory_order_relaxed) <= old_counter) { -#ifdef USE_OMP - #pragma omp taskyield -#else tvm::runtime::threading::Yield(); -#endif } } } std::atomic_thread_fence(std::memory_order_acquire); +#endif return 0; } From 880f4a16be6c3ad36fcc65b6a30c35fe6e7e00d6 Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Fri, 18 Oct 2019 21:02:57 +0000 Subject: [PATCH 05/10] update --- CMakeLists.txt | 9 +++----- cmake/config.cmake | 2 +- cmake/modules/OpenMP.cmake | 44 +++++++++++++++++++++++++++++++++++++ src/relay/pass/mac_count.cc | 19 ++++++++++++++++ src/runtime/thread_pool.cc | 6 ++--- 5 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 cmake/modules/OpenMP.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 976d92519ff1..a7628482aced 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ tvm_option(USE_LLVM "Build with LLVM, can be set to specific llvm-config path" O tvm_option(USE_STACKVM_RUNTIME "Include stackvm into the runtime" OFF) tvm_option(USE_GRAPH_RUNTIME "Build with tiny graph runtime" ON) tvm_option(USE_GRAPH_RUNTIME_DEBUG "Build with tiny graph runtime debug mode" OFF) -tvm_option(USE_OMP "Build with OpenMP thread pool implementation" OFF) +tvm_option(USE_OPENMP "Build with OpenMP thread pool implementation" OFF) tvm_option(USE_RELAY_DEBUG "Building Relay in debug mode..." OFF) tvm_option(USE_SGX "Build with SGX" OFF) tvm_option(USE_RTTI "Build with RTTI" ON) @@ -155,11 +155,6 @@ list(APPEND COMPILER_SRCS ${RELAY_BACKEND_SRCS}) list(APPEND COMPILER_SRCS ${RELAY_IR_SRCS}) list(APPEND COMPILER_SRCS ${RELAY_QNN_SRCS}) -if(USE_OMP) - message(STATUS "Build with OpenMP") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") - add_definitions(-DUSE_OMP=1) -endif(USE_OMP) if(USE_VM_PROFILER) message(STATUS "Build compiler with Relay VM profiler support...") @@ -271,6 +266,8 @@ add_library(tvm SHARED ${COMPILER_SRCS} ${RUNTIME_SRCS}) add_library(tvm_topi SHARED ${TOPI_SRCS}) add_library(tvm_runtime SHARED ${RUNTIME_SRCS}) +include(cmake/modules/OpenMP.cmake) + if(USE_RELAY_DEBUG) message(STATUS "Building Relay in debug mode...") set_target_properties(tvm PROPERTIES COMPILE_DEFINITIONS "USE_RELAY_DEBUG") diff --git a/cmake/config.cmake b/cmake/config.cmake index 6286584c26b4..dfe08d3cc0fc 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -116,7 +116,7 @@ set(USE_BLAS none) set(USE_MKL_PATH none) # Whether use OpenMP thread pool -set(USE_OMP OFF) +set(USE_OPENMP OFF) # Whether use contrib.random in runtime set(USE_RANDOM OFF) diff --git a/cmake/modules/OpenMP.cmake b/cmake/modules/OpenMP.cmake new file mode 100644 index 000000000000..d57aed351de5 --- /dev/null +++ b/cmake/modules/OpenMP.cmake @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# OpenMP Module +if(USE_OPENMP STREQUAL "gnu") + find_package(OpenMP) + if(OPENMP_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + list(APPEND TVM_RUNTIME_LINKER_LIBS ${OpenMP_CXX_LIBRARIES}) + add_definitions(-DTVM_THREADPOOL_USE_OPENMP=1) + message(STATUS "Build with OpenMP ${OpenMP_CXX_LIBRARIES}") + else() + add_definitions(-DTVM_THREADPOOL_USE_OPENMP=0) + message(WARNING "OpenMP cannot be found, use TVM threadpool instead.") + endif() +elseif(USE_OPENMP STREQUAL "intel") + find_package(OpenMP) + if(OPENMP_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + find_library(OMP_LIBRARY NAMES iomp5) + list(APPEND TVM_RUNTIME_LINKER_LIBS ${OMP_LIBRARY}) + add_definitions(-DTVM_THREADPOOL_USE_OPENMP=1) + message(STATUS "Build with OpenMP " ${OMP_LIBRARY}) + else() + add_definitions(-DTVM_THREADPOOL_USE_OPENMP=1) + message(WARNING "OpenMP cannot be found, use TVM threadpool instead.") + endif() +else() + add_definitions(-DTVM_THREADPOOL_USE_OPENMP=0) +endif() diff --git a/src/relay/pass/mac_count.cc b/src/relay/pass/mac_count.cc index 48a0dfb84746..97cd9046aa4f 100644 --- a/src/relay/pass/mac_count.cc +++ b/src/relay/pass/mac_count.cc @@ -150,6 +150,22 @@ int64_t DenseMacCount(const Call& call_node) { return count; } +int64_t BatchMatmulMacCount(const Call& call_node) { + if (!call_node->checked_type_.defined()) { + LOG(WARNING) << "The infer type pass should be called before the mac count pass"; + return 0; + } + Array args = call_node->args; + CHECK(args.size() == 2); + Array x_shape = args[0]->checked_type().as()->shape; + Array y_shape = args[1]->checked_type().as()->shape; + int64_t batch = x_shape[0].as()->value; + int64_t m = x_shape[1].as()->value; + int64_t k = x_shape[2].as()->value; + int64_t n = y_shape[1].as()->value; + return batch * m * k * n; +} + RELAY_REGISTER_OP("nn.conv2d") .set_attr("FMacCount", ConvMacCount); @@ -159,6 +175,9 @@ RELAY_REGISTER_OP("nn.conv2d_transpose") RELAY_REGISTER_OP("nn.dense") .set_attr("FMacCount", DenseMacCount); +RELAY_REGISTER_OP("nn.batch_matmul") +.set_attr("FMacCount", BatchMatmulMacCount); + class MacCounter : private ExprVisitor { public: MacCounter() { diff --git a/src/runtime/thread_pool.cc b/src/runtime/thread_pool.cc index 33ee27bc8450..e9e6d03243e3 100644 --- a/src/runtime/thread_pool.cc +++ b/src/runtime/thread_pool.cc @@ -29,7 +29,7 @@ #include #include #include -#ifdef USE_OMP +#if TVM_THREADPOOL_USE_OPENMP #include #endif #include @@ -397,7 +397,7 @@ int TVMBackendParallelLaunch( FTVMParallelLambda flambda, void* cdata, int num_task) { -#ifndef USE_OMP +#if !TVM_THREADPOOL_USE_OPENMP int res = tvm::runtime::ThreadPool::ThreadLocal()->Launch( flambda, cdata, num_task, 1); return res; @@ -422,7 +422,7 @@ int TVMBackendParallelLaunch( } int TVMBackendParallelBarrier(int task_id, TVMParallelGroupEnv* penv) { -#ifdef USE_OMP +#if TVM_THREADPOOL_USE_OPENMP #pragma omp barrier #else using tvm::runtime::kSyncStride; From 097660fd01d180796f2c88986e9f950fa68a8576 Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Fri, 18 Oct 2019 21:06:42 +0000 Subject: [PATCH 06/10] fix --- CMakeLists.txt | 2 +- cmake/config.cmake | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7628482aced..1b7d5efaf0e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,6 +235,7 @@ include(cmake/modules/VTA.cmake) include(cmake/modules/CUDA.cmake) include(cmake/modules/OpenCL.cmake) include(cmake/modules/OpenGL.cmake) +include(cmake/modules/OpenMP.cmake) include(cmake/modules/Vulkan.cmake) include(cmake/modules/Metal.cmake) include(cmake/modules/ROCM.cmake) @@ -266,7 +267,6 @@ add_library(tvm SHARED ${COMPILER_SRCS} ${RUNTIME_SRCS}) add_library(tvm_topi SHARED ${TOPI_SRCS}) add_library(tvm_runtime SHARED ${RUNTIME_SRCS}) -include(cmake/modules/OpenMP.cmake) if(USE_RELAY_DEBUG) message(STATUS "Building Relay in debug mode...") diff --git a/cmake/config.cmake b/cmake/config.cmake index dfe08d3cc0fc..6a55397692a0 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -115,8 +115,9 @@ set(USE_BLAS none) # set(USE_MKL_PATH ) if using `pip install mkl` set(USE_MKL_PATH none) -# Whether use OpenMP thread pool -set(USE_OPENMP OFF) +# Whether use OpenMP thread pool, choices: gnu, intel +# Note: "gnu" uses gomp library, "intel" uses iomp5 library +set(USE_OPENMP none) # Whether use contrib.random in runtime set(USE_RANDOM OFF) From 984cd50106cdbf7dbb0c3eec4411b52ca06b6c73 Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Fri, 18 Oct 2019 21:13:56 +0000 Subject: [PATCH 07/10] clean up --- src/relay/pass/mac_count.cc | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/relay/pass/mac_count.cc b/src/relay/pass/mac_count.cc index 97cd9046aa4f..48a0dfb84746 100644 --- a/src/relay/pass/mac_count.cc +++ b/src/relay/pass/mac_count.cc @@ -150,22 +150,6 @@ int64_t DenseMacCount(const Call& call_node) { return count; } -int64_t BatchMatmulMacCount(const Call& call_node) { - if (!call_node->checked_type_.defined()) { - LOG(WARNING) << "The infer type pass should be called before the mac count pass"; - return 0; - } - Array args = call_node->args; - CHECK(args.size() == 2); - Array x_shape = args[0]->checked_type().as()->shape; - Array y_shape = args[1]->checked_type().as()->shape; - int64_t batch = x_shape[0].as()->value; - int64_t m = x_shape[1].as()->value; - int64_t k = x_shape[2].as()->value; - int64_t n = y_shape[1].as()->value; - return batch * m * k * n; -} - RELAY_REGISTER_OP("nn.conv2d") .set_attr("FMacCount", ConvMacCount); @@ -175,9 +159,6 @@ RELAY_REGISTER_OP("nn.conv2d_transpose") RELAY_REGISTER_OP("nn.dense") .set_attr("FMacCount", DenseMacCount); -RELAY_REGISTER_OP("nn.batch_matmul") -.set_attr("FMacCount", BatchMatmulMacCount); - class MacCounter : private ExprVisitor { public: MacCounter() { From 794da1a8fa2b3b4bc7374bd1fc517a21271d070f Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Fri, 18 Oct 2019 21:21:06 +0000 Subject: [PATCH 08/10] fix --- cmake/modules/OpenMP.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/OpenMP.cmake b/cmake/modules/OpenMP.cmake index d57aed351de5..6d8d47a81a19 100644 --- a/cmake/modules/OpenMP.cmake +++ b/cmake/modules/OpenMP.cmake @@ -36,7 +36,7 @@ elseif(USE_OPENMP STREQUAL "intel") add_definitions(-DTVM_THREADPOOL_USE_OPENMP=1) message(STATUS "Build with OpenMP " ${OMP_LIBRARY}) else() - add_definitions(-DTVM_THREADPOOL_USE_OPENMP=1) + add_definitions(-DTVM_THREADPOOL_USE_OPENMP=0) message(WARNING "OpenMP cannot be found, use TVM threadpool instead.") endif() else() From dd340e31c8bebbcd2303451ebd2faacc43f83026 Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Fri, 18 Oct 2019 21:42:30 +0000 Subject: [PATCH 09/10] fix for windows --- cmake/modules/OpenMP.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/modules/OpenMP.cmake b/cmake/modules/OpenMP.cmake index 6d8d47a81a19..005d22423c9a 100644 --- a/cmake/modules/OpenMP.cmake +++ b/cmake/modules/OpenMP.cmake @@ -31,7 +31,11 @@ elseif(USE_OPENMP STREQUAL "intel") find_package(OpenMP) if(OPENMP_FOUND) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") - find_library(OMP_LIBRARY NAMES iomp5) + if (MSVC) + find_library(OMP_LIBRARY NAMES iomp5md) + else() + find_library(OMP_LIBRARY NAMES iomp5) + endif() list(APPEND TVM_RUNTIME_LINKER_LIBS ${OMP_LIBRARY}) add_definitions(-DTVM_THREADPOOL_USE_OPENMP=1) message(STATUS "Build with OpenMP " ${OMP_LIBRARY}) From 115cac5c6569322449ba09f094468b4ade30eb3f Mon Sep 17 00:00:00 2001 From: Haichen Shen Date: Fri, 18 Oct 2019 22:37:05 +0000 Subject: [PATCH 10/10] fix --- cmake/modules/OpenMP.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/OpenMP.cmake b/cmake/modules/OpenMP.cmake index 005d22423c9a..5dd9be508342 100644 --- a/cmake/modules/OpenMP.cmake +++ b/cmake/modules/OpenMP.cmake @@ -32,7 +32,7 @@ elseif(USE_OPENMP STREQUAL "intel") if(OPENMP_FOUND) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") if (MSVC) - find_library(OMP_LIBRARY NAMES iomp5md) + find_library(OMP_LIBRARY NAMES libiomp5md) else() find_library(OMP_LIBRARY NAMES iomp5) endif()