[pstl] Rename PARALLELSTL_BACKEND to PSTL_PARALLEL_BACKEND

It makes more sense to name configuration options as PSTL_XXX.
Also, I'm naming it PSTL_PARALLEL_BACKEND because we might introduce
the ability to customize the vectorization backend, in which case
PSTL_BACKEND would become ambiguous.

llvm-svn: 368672
This commit is contained in:
Louis Dionne 2019-08-13 11:50:26 +00:00
parent 58f03f2128
commit 5065e78173
2 changed files with 6 additions and 6 deletions

View File

@ -16,7 +16,7 @@ math(EXPR VERSION_PATCH "(${PARALLELSTL_VERSION_SOURCE} % 10)")
project(ParallelSTL VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} LANGUAGES CXX)
set(PARALLELSTL_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' and 'tbb'. The default is 'serial'.")
if (NOT TBB_DIR)
get_filename_component(PSTL_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
@ -33,16 +33,16 @@ add_library(ParallelSTL INTERFACE)
add_library(pstl::ParallelSTL ALIAS ParallelSTL)
target_compile_features(ParallelSTL INTERFACE cxx_std_17)
if (PARALLELSTL_BACKEND STREQUAL "serial")
if (PSTL_PARALLEL_BACKEND STREQUAL "serial")
message(STATUS "Parallel STL uses the serial backend")
set(_PSTL_PAR_BACKEND_SERIAL ON)
elseif (PARALLELSTL_BACKEND STREQUAL "tbb")
elseif (PSTL_PARALLEL_BACKEND STREQUAL "tbb")
find_package(TBB 2018 REQUIRED tbb OPTIONAL_COMPONENTS tbbmalloc)
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)
else()
message(FATAL_ERROR "Requested unknown Parallel STL backend '${PARALLELSTL_BACKEND}'.")
message(FATAL_ERROR "Requested unknown Parallel STL backend '${PSTL_PARALLEL_BACKEND}'.")
endif()
set(PSTL_GENERATED_HEADERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated_headers")

View File

@ -8,9 +8,9 @@
include(CMakeFindDependencyMacro)
set(PARALLELSTL_BACKEND "@PARALLELSTL_BACKEND@")
set(PSTL_PARALLEL_BACKEND "@PSTL_PARALLEL_BACKEND@")
if (PARALLELSTL_BACKEND STREQUAL "tbb")
if (PSTL_PARALLEL_BACKEND STREQUAL "tbb")
find_dependency(TBB REQUIRED tbb)
endif()