Skip to content

Commit

Permalink
[pstl] Rename PARALLELSTL_BACKEND to PSTL_PARALLEL_BACKEND
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ldionne committed Aug 13, 2019
1 parent 58f03f2 commit 5065e78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pstl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions pstl/cmake/ParallelSTLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 5065e78

Please sign in to comment.