File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,20 @@ elseif(ONEDPL_BACKEND MATCHES "^(omp)$")
288288 find_package (OpenMP)
289289 if (OpenMP_CXX_FOUND)
290290 message (STATUS "Compilation for the host due to OpenMP backend." )
291- target_link_libraries (oneDPL INTERFACE OpenMP::OpenMP_CXX)
291+ # Due to minor correctness issues with -fiopenmp / -Qiopenmp, we are using -fopenmp / -Qopenmp until they are corrected.
292+ # Once correctness issues are resolved, we will limit this workaround to affected versions of specific compilers.
293+ if (OpenMP_CXX_FLAGS MATCHES ".*-fiopenmp.*" )
294+ set (_openmp_flag -fopenmp)
295+ elseif (OpenMP_CXX_FLAGS MATCHES ".*[-/]Qiopenmp.*" )
296+ set (_openmp_flag /Qopenmp)
297+ endif ()
298+ if (_openmp_flag)
299+ message (STATUS "Using ${_openmp_flag} for openMP" )
300+ target_compile_options (oneDPL INTERFACE ${_openmp_flag} )
301+ target_link_libraries (oneDPL INTERFACE ${_openmp_flag} )
302+ else ()
303+ target_link_libraries (oneDPL INTERFACE OpenMP::OpenMP_CXX)
304+ endif ()
292305 target_compile_definitions (oneDPL INTERFACE
293306 ONEDPL_USE_TBB_BACKEND=0
294307 ONEDPL_USE_DPCPP_BACKEND=0
Original file line number Diff line number Diff line change @@ -82,7 +82,20 @@ if (EXISTS "${_onedpl_headers}")
8282 elseif (OpenMP_CXX_FOUND)
8383 set (ONEDPL_PAR_BACKEND openmp)
8484 message (STATUS "oneDPL: ONEDPL_PAR_BACKEND=${ONEDPL_PAR_BACKEND} , disable oneTBB backend" )
85- set_target_properties (oneDPL PROPERTIES INTERFACE_LINK_LIBRARIES OpenMP::OpenMP_CXX)
85+ # Due to minor correctness issues with -fiopenmp / -Qiopenmp, we are using -fopenmp / -Qopenmp until they are corrected.
86+ # Once correctness issues are resolved, we will limit this workaround to affected versions of specific compilers.
87+ if (OpenMP_CXX_FLAGS MATCHES ".*-fiopenmp.*" )
88+ set (_openmp_flag -fopenmp)
89+ elseif (OpenMP_CXX_FLAGS MATCHES ".*[-/]Qiopenmp.*" )
90+ set (_openmp_flag /Qopenmp)
91+ endif ()
92+ if (_openmp_flag)
93+ message (STATUS "oneDPL: Using ${_openmp_flag} for openMP" )
94+ set_target_properties (oneDPL PROPERTIES INTERFACE_COMPILE_OPTIONS ${_openmp_flag} )
95+ set_target_properties (oneDPL PROPERTIES INTERFACE_LINK_LIBRARIES ${_openmp_flag} )
96+ else ()
97+ set_target_properties (oneDPL PROPERTIES INTERFACE_LINK_LIBRARIES OpenMP::OpenMP_CXX)
98+ endif ()
8699 set_property (TARGET oneDPL APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS ONEDPL_USE_TBB_BACKEND=0 ONEDPL_USE_OPENMP_BACKEND=1)
87100 endif ()
88101 endif ()
You can’t perform that action at this time.
0 commit comments