Don't tie implementation to oneTBB specific headers
Fix wrong TBB_ROOT detection
This commit is contained in:
parent
742f0629be
commit
7a130a59bc
12
TBB.cmake
12
TBB.cmake
@ -1,8 +1,16 @@
|
|||||||
|
|
||||||
register_flag_required(TBB_DIR
|
register_flag_optional(ONE_TBB_DIR
|
||||||
"Absolute path to oneTBB distribution, the directory should contains at least `include/` and `lib/")
|
"Absolute path to oneTBB (with header `onetbb/tbb.h`) distribution, the directory should contain at least `include/` and `lib/.
|
||||||
|
If unspecified, the system TBB (with header `tbb/tbb.h`) will be used via CMake's find_package(TBB)."
|
||||||
|
"")
|
||||||
|
|
||||||
macro(setup)
|
macro(setup)
|
||||||
|
if(ONE_TBB_DIR)
|
||||||
|
set(TBB_ROOT "${ONE_TBB_DIR}") # see https://github.com/Kitware/VTK/blob/0a31a9a3c1531ae238ac96a372fec4be42282863/CMake/FindTBB.cmake#L34
|
||||||
|
# docs on Intel's website refers to TBB_DIR which hasn't been correct for 6 years
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14) # we use auto in lambda parameters for the different partitioners
|
set(CMAKE_CXX_STANDARD 14) # we use auto in lambda parameters for the different partitioners
|
||||||
# see https://github.com/oneapi-src/oneTBB/blob/master/cmake/README.md#tbbconfig---integration-of-binary-packages
|
# see https://github.com/oneapi-src/oneTBB/blob/master/cmake/README.md#tbbconfig---integration-of-binary-packages
|
||||||
find_package(TBB REQUIRED)
|
find_package(TBB REQUIRED)
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
// source code
|
// source code
|
||||||
|
|
||||||
#include "TBBStream.hpp"
|
#include "TBBStream.hpp"
|
||||||
#include "oneapi/tbb.h"
|
#include "tbb/tbb.h"
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
TBBStream<T>::TBBStream(const int ARRAY_SIZE, int device)
|
TBBStream<T>::TBBStream(const int ARRAY_SIZE, int device)
|
||||||
|
|||||||
@ -86,40 +86,40 @@ run_build() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
###
|
###
|
||||||
#KOKKOS_SRC="/home/tom/Downloads/kokkos-3.3.00"
|
# KOKKOS_SRC="/home/tom/Downloads/kokkos-3.3.00"
|
||||||
#RAJA_SRC="/home/tom/Downloads/RAJA-v0.13.0"
|
# RAJA_SRC="/home/tom/Downloads/RAJA-v0.13.0"
|
||||||
#
|
|
||||||
#GCC_CXX="/usr/bin/g++"
|
# GCC_CXX="/usr/bin/g++"
|
||||||
#CLANG_CXX="/usr/bin/clang++"
|
# CLANG_CXX="/usr/bin/clang++"
|
||||||
#
|
|
||||||
#NVSDK="/home/tom/Downloads/nvhpc_2021_212_Linux_x86_64_cuda_11.2/install_components/Linux_x86_64/21.2/"
|
# NVSDK="/home/tom/Downloads/nvhpc_2021_212_Linux_x86_64_cuda_11.2/install_components/Linux_x86_64/21.2/"
|
||||||
#NVHPC_NVCXX="$NVSDK/compilers/bin/nvc++"
|
# NVHPC_NVCXX="$NVSDK/compilers/bin/nvc++"
|
||||||
#NVHPC_NVCC="$NVSDK/cuda/11.2/bin/nvcc"
|
# NVHPC_NVCC="$NVSDK/cuda/11.2/bin/nvcc"
|
||||||
#NVHPC_CUDA_DIR="$NVSDK/cuda/11.2"
|
# NVHPC_CUDA_DIR="$NVSDK/cuda/11.2"
|
||||||
#"$NVSDK/compilers/bin/makelocalrc" "$NVSDK/compilers/bin/" -x
|
# "$NVSDK/compilers/bin/makelocalrc" "$NVSDK/compilers/bin/" -x
|
||||||
#
|
|
||||||
#AOCC_CXX="/opt/AMD/aocc-compiler-2.3.0/bin/clang++"
|
# AOCC_CXX="/opt/AMD/aocc-compiler-2.3.0/bin/clang++"
|
||||||
#AOMP_CXX="/usr/lib/aomp/bin/clang++"
|
# AOMP_CXX="/usr/lib/aomp/bin/clang++"
|
||||||
#OCL_LIB="/home/tom/Downloads/oclcpuexp-2020.11.11.0.04_rel/x64/libOpenCL.so"
|
# OCL_LIB="/home/tom/Downloads/oclcpuexp-2020.11.11.0.04_rel/x64/libOpenCL.so"
|
||||||
#
|
|
||||||
## AMD needs this rocm_path thing exported...
|
# # AMD needs this rocm_path thing exported...
|
||||||
#export ROCM_PATH="/opt/rocm-4.0.0"
|
# export ROCM_PATH="/opt/rocm-4.0.0"
|
||||||
#HIP_CXX="/opt/rocm-4.0.0/bin/hipcc"
|
# HIP_CXX="/opt/rocm-4.0.0/bin/hipcc"
|
||||||
#COMPUTECPP_DIR="/home/tom/Desktop/computecpp_archive/ComputeCpp-CE-2.3.0-x86_64-linux-gnu"
|
# COMPUTECPP_DIR="/home/tom/Desktop/computecpp_archive/ComputeCpp-CE-2.3.0-x86_64-linux-gnu"
|
||||||
#DPCPP_DIR="/home/tom/Downloads/dpcpp_compiler"
|
# DPCPP_DIR="/home/tom/Downloads/dpcpp_compiler"
|
||||||
#HIPSYCL_DIR="/opt/hipsycl/cff515c/"
|
# HIPSYCL_DIR="/opt/hipsycl/cff515c/"
|
||||||
#
|
|
||||||
#ICPX_CXX="/opt/intel/oneapi/compiler/2021.1.2/linux/bin/icpx"
|
# ICPX_CXX="/opt/intel/oneapi/compiler/2021.1.2/linux/bin/icpx"
|
||||||
#ICPC_CXX="/opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/icpc"
|
# ICPC_CXX="/opt/intel/oneapi/compiler/2021.1.2/linux/bin/intel64/icpc"
|
||||||
#
|
|
||||||
#TBB_LIB="/home/tom/Downloads/oneapi-tbb-2021.1.1/"
|
# TBB_LIB="/home/tom/Downloads/oneapi-tbb-2021.1.1/"
|
||||||
#
|
|
||||||
#GCC_STD_PAR_LIB="tbb"
|
# GCC_STD_PAR_LIB="tbb"
|
||||||
#CLANG_STD_PAR_LIB="tbb"
|
# CLANG_STD_PAR_LIB="tbb"
|
||||||
#GCC_OMP_OFFLOAD_AMD=false
|
# GCC_OMP_OFFLOAD_AMD=false
|
||||||
#GCC_OMP_OFFLOAD_NVIDIA=true
|
# GCC_OMP_OFFLOAD_NVIDIA=true
|
||||||
#CLANG_OMP_OFFLOAD_AMD=false
|
# CLANG_OMP_OFFLOAD_AMD=false
|
||||||
#CLANG_OMP_OFFLOAD_NVIDIA=false
|
# CLANG_OMP_OFFLOAD_NVIDIA=false
|
||||||
###
|
###
|
||||||
|
|
||||||
AMD_ARCH="gfx_903"
|
AMD_ARCH="gfx_903"
|
||||||
@ -140,7 +140,10 @@ build_gcc() {
|
|||||||
# some distributions like Ubuntu bionic implements std par with TBB, so conditionally link it here
|
# some distributions like Ubuntu bionic implements std par with TBB, so conditionally link it here
|
||||||
run_build $name "${GCC_CXX:?}" STD "$cxx -DCXX_EXTRA_LIBRARIES=${GCC_STD_PAR_LIB:-}"
|
run_build $name "${GCC_CXX:?}" STD "$cxx -DCXX_EXTRA_LIBRARIES=${GCC_STD_PAR_LIB:-}"
|
||||||
run_build $name "${GCC_CXX:?}" STD20 "$cxx -DCXX_EXTRA_LIBRARIES=${GCC_STD_PAR_LIB:-}"
|
run_build $name "${GCC_CXX:?}" STD20 "$cxx -DCXX_EXTRA_LIBRARIES=${GCC_STD_PAR_LIB:-}"
|
||||||
run_build $name "${GCC_CXX:?}" TBB "$cxx -DTBB_DIR=$TBB_LIB"
|
|
||||||
|
run_build $name "${GCC_CXX:?}" TBB "$cxx -DONE_TBB_DIR=$TBB_LIB"
|
||||||
|
run_build $name "${GCC_CXX:?}" TBB "$cxx" # build TBB again with the system TBB
|
||||||
|
|
||||||
if [ "${GCC_OMP_OFFLOAD_AMD:-false}" != "false" ]; then
|
if [ "${GCC_OMP_OFFLOAD_AMD:-false}" != "false" ]; then
|
||||||
run_build "amd_$name" "${GCC_CXX:?}" ACC "$cxx -DCXX_EXTRA_FLAGS=-foffload=amdgcn-amdhsa"
|
run_build "amd_$name" "${GCC_CXX:?}" ACC "$cxx -DCXX_EXTRA_FLAGS=-foffload=amdgcn-amdhsa"
|
||||||
run_build "amd_$name" "${GCC_CXX:?}" OMP "$cxx -DOFFLOAD=AMD:$AMD_ARCH"
|
run_build "amd_$name" "${GCC_CXX:?}" OMP "$cxx -DOFFLOAD=AMD:$AMD_ARCH"
|
||||||
@ -190,7 +193,10 @@ build_clang() {
|
|||||||
run_build $name "${CLANG_CXX:?}" OCL "$cxx -DOpenCL_LIBRARY=${OCL_LIB:?}"
|
run_build $name "${CLANG_CXX:?}" OCL "$cxx -DOpenCL_LIBRARY=${OCL_LIB:?}"
|
||||||
run_build $name "${CLANG_CXX:?}" STD "$cxx -DCXX_EXTRA_LIBRARIES=${CLANG_STD_PAR_LIB:-}"
|
run_build $name "${CLANG_CXX:?}" STD "$cxx -DCXX_EXTRA_LIBRARIES=${CLANG_STD_PAR_LIB:-}"
|
||||||
# run_build $name "${LANG_CXX:?}" STD20 "$cxx -DCXX_EXTRA_LIBRARIES=${CLANG_STD_PAR_LIB:-}" # not yet supported
|
# run_build $name "${LANG_CXX:?}" STD20 "$cxx -DCXX_EXTRA_LIBRARIES=${CLANG_STD_PAR_LIB:-}" # not yet supported
|
||||||
run_build $name "${CLANG_CXX:?}" TBB "$cxx -DTBB_DIR=$TBB_LIB"
|
|
||||||
|
run_build $name "${CLANG_CXX:?}" TBB "$cxx -DONE_TBB_DIR=$TBB_LIB"
|
||||||
|
run_build $name "${CLANG_CXX:?}" TBB "$cxx" # build TBB again with the system TBB
|
||||||
|
|
||||||
run_build $name "${CLANG_CXX:?}" RAJA "$cxx -DRAJA_IN_TREE=${RAJA_SRC:?}"
|
run_build $name "${CLANG_CXX:?}" RAJA "$cxx -DRAJA_IN_TREE=${RAJA_SRC:?}"
|
||||||
# no clang /w RAJA+cuda because it needs nvcc which needs gcc
|
# no clang /w RAJA+cuda because it needs nvcc which needs gcc
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user