summaryrefslogtreecommitdiff
path: root/pstl/CMakeLists.txt
diff options
context:
space:
mode:
authorMikhail Dvorskiy <mikhail.dvorskiy@intel.com>2021-10-15 15:36:07 +0300
committerMikhail Dvorskiy <mikhail.dvorskiy@intel.com>2021-10-15 15:36:07 +0300
commit6069a6a5049497a32a50a49661c2f4169078bdba (patch)
tree57beff6f8b758d1d354e84625e213d6d8796edbc /pstl/CMakeLists.txt
parente7418906f5051da329ba0094635aeabd39bf6803 (diff)
downloadllvm-6069a6a5049497a32a50a49661c2f4169078bdba.tar.gz
[pstl] Initial implementation of OpenMP backend, on behalf of Christopher Nelson nadiasvertex@gmail.com
Phabricator Review: https://reviews.llvm.org/D99836 A couple of parallel patterns still remains serial - "Parallel partial sort", and "Parallel transform scan" - there are //TODOs in the code.
Diffstat (limited to 'pstl/CMakeLists.txt')
-rw-r--r--pstl/CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/pstl/CMakeLists.txt b/pstl/CMakeLists.txt
index 8bea8843589b..181f1164cf45 100644
--- a/pstl/CMakeLists.txt
+++ b/pstl/CMakeLists.txt
@@ -16,7 +16,7 @@ math(EXPR VERSION_PATCH "(${PARALLELSTL_VERSION_SOURCE} % 10)")
project(ParallelSTL VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} LANGUAGES CXX)
-set(PSTL_PARALLEL_BACKEND "serial" CACHE STRING "Threading backend to use. Valid choices are 'serial' and 'tbb'. The default is 'serial'.")
+set(PSTL_PARALLEL_BACKEND "serial" CACHE STRING "Threading backend to use. Valid choices are 'serial', 'omp', and 'tbb'. The default is 'serial'.")
set(PSTL_HIDE_FROM_ABI_PER_TU OFF CACHE BOOL "Whether to constrain ABI-unstable symbols to each translation unit (basically, mark them with C's static keyword).")
set(_PSTL_HIDE_FROM_ABI_PER_TU ${PSTL_HIDE_FROM_ABI_PER_TU}) # For __pstl_config_site
@@ -43,6 +43,10 @@ elseif (PSTL_PARALLEL_BACKEND STREQUAL "tbb")
message(STATUS "Parallel STL uses TBB ${TBB_VERSION} (interface version: ${TBB_INTERFACE_VERSION})")
target_link_libraries(ParallelSTL INTERFACE TBB::tbb)
set(_PSTL_PAR_BACKEND_TBB ON)
+elseif (PSTL_PARALLEL_BACKEND STREQUAL "omp")
+ message(STATUS "Parallel STL uses the omp backend")
+ target_compile_options(ParallelSTL INTERFACE "-fopenmp=libomp")
+ set(_PSTL_PAR_BACKEND_OPENMP ON)
else()
message(FATAL_ERROR "Requested unknown Parallel STL backend '${PSTL_PARALLEL_BACKEND}'.")
endif()