Skip to content

Commit 664d6fa

Browse files
committed
Merge branch 'master' into kmp5/feature/CP
2 parents 63e0bcd + ce692b5 commit 664d6fa

32 files changed

+406
-66
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ jobs:
3131
CCACHE_COMPRESS : true
3232
CCACHE_COMPRESSLEVEL : 6
3333
OMPI_MCA_btl_vader_single_copy_mechanism : none
34-
PARSEC_MCA_runtime_bind_threads : 0
34+
PARSEC_MCA_bind_threads : 0
3535
BUILD_CONFIG : >
3636
-DMADNESS_TASK_BACKEND=${{ matrix.task_backend }}
3737
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
3838
-DMPIEXEC_PREFLAGS='--bind-to;none;--allow-run-as-root'
3939
-DCMAKE_PREFIX_PATH="/usr/local/opt/bison;/usr/local/opt/scalapack;/usr/local/opt/boost"
4040
-DTA_ASSERT_POLICY=TA_ASSERT_THROW
41-
-DENABLE_SCALAPACK=ON
41+
-DTA_SCALAPACK=ON
4242
4343
steps:
4444
- uses: actions/checkout@v4

.gitlab-ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ variables:
1414
TA_ASSERT_POLICY=TA_ASSERT_THROW
1515
TA_UT_CTEST_TIMEOUT=3000
1616
${TA_PYTHON}
17-
${ENABLE_CUDA}
17+
${TA_CUDA}
1818
CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda
1919
${BLA_VENDOR}
2020
${BLA_THREADS}
21-
${ENABLE_SCALAPACK}
21+
${TA_SCALAPACK}
2222
2323
before_script:
2424
# NB: if CMAKE_BUILD_PARALLEL_LEVEL is not set (i.e. using shared runner), use 1 to ensure we have enough memory
@@ -42,7 +42,7 @@ ubuntu:
4242
image: valeevgroup/${IMAGE}
4343
variables:
4444
TA_PYTHON : "TA_PYTHON=ON"
45-
ENABLE_SCALAPACK : "ENABLE_SCALAPACK=OFF"
45+
TA_SCALAPACK : "TA_SCALAPACK=OFF"
4646
script:
4747
- ./ci/.build-project
4848
--build ./build
@@ -69,7 +69,7 @@ ubuntu:
6969
CXX: [ g++ ]
7070
BUILD_TYPE : [ "RelWithDebInfo" ]
7171
TA_PYTHON : [ "TA_PYTHON=OFF" ]
72-
ENABLE_CUDA : [ "ENABLE_CUDA=ON" ]
72+
TA_CUDA : [ "TA_CUDA=ON" ]
7373
TA_TARGETS : [ "tiledarray examples-tiledarray check_serial-tiledarray" ]
7474
RUNNER_TAGS: [ cuda ]
7575

CMakeLists.txt

+13-16
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,17 @@ set(MPI_CXX_SKIP_MPICXX TRUE CACHE BOOL "MPI_CXX_SKIP_MPICXX")
117117
option(ENABLE_MPI "Enable MPI" ON)
118118
add_feature_info(MPI ENABLE_MPI "Message-Passing Interface supports distributed-memory parallel programs")
119119

120-
option(ENABLE_SCALAPACK "Enable ScaLAPACK Bindings in TiledArray" OFF)
121-
add_feature_info(ScaLAPACK ENABLE_SCALAPACK "ScaLAPACK provides distributed linear algebra")
120+
option(TA_SCALAPACK "Enable ScaLAPACK Bindings in TiledArray" OFF)
121+
add_feature_info(ScaLAPACK TA_SCALAPACK "ScaLAPACK provides distributed linear algebra")
122122

123-
option(ENABLE_WFN91_LINALG_DISCOVERY_KIT "Use linear algebra discovery kit from github.com/wavefunction91 [recommended]" ON)
124-
add_feature_info(WFN91LinearAlgebraDiscoveryKit ENABLE_WFN91_LINALG_DISCOVERY_KIT "Linear algebra discovery kit from github.com/wavefunction91 supports many more corner cases than the default CMake modules and/or ICL's BLAS++/LAPACK++ modules")
123+
option(TA_LINALG_DISCOVERY_KIT "Use linear algebra discovery kit from github.com/wavefunction91 [recommended]" ON)
124+
add_feature_info(WFN91LinearAlgebraDiscoveryKit TA_LINALG_DISCOVERY_KIT "Linear algebra discovery kit from github.com/wavefunction91 supports many more corner cases than the default CMake modules and/or ICL's BLAS++/LAPACK++ modules")
125125

126-
redefaultable_option(ENABLE_TBB "Enable use of TBB with MADNESS" OFF)
127-
add_feature_info(TBB ENABLE_TBB "Intel Thread-Building Blocks (TBB) supports programming shared-memory systems")
126+
option(TA_CUDA "Enables use of NVIDIA CUDA-supported hardware (such as NVIDIA GPUs) by TiledArray" OFF)
127+
add_feature_info(CUDA TA_CUDA "Use of NVIDIA CUDA-supported hardware by TiledArray")
128128

129-
option(ENABLE_CUDA "Enable use of CUDA with TiledArray" OFF)
130-
add_feature_info(CUDA ENABLE_CUDA "NVIDIA CUDA support for GPU")
131-
132-
option(ENABLE_HIP "Enable use of HIP with TiledArray" OFF)
133-
add_feature_info(HIP ENABLE_HIP "AMD HIP/ROCm support for GPU")
129+
option(TA_HIP "Enables use of AMD HIP-supported hardware (such as AMD GPUs) by TiledArray" OFF)
130+
add_feature_info(HIP TA_HIP "Use of AMD HIP-supported hardware by TiledArray")
134131

135132
option(ENABLE_GPERFTOOLS "Enable linking with Gperftools" OFF)
136133
add_feature_info(GPERFTOOLS ENABLE_GPERFTOOLS "Google Performance Tools provide fast memory allocation and performance profiling")
@@ -310,10 +307,10 @@ endif(CCACHE)
310307

311308
# required deps:
312309
# 1. derive runtime (CUDA/HIP/...) first since others may depend on it
313-
if(ENABLE_CUDA)
310+
if(TA_CUDA)
314311
include(external/cuda.cmake)
315312
endif()
316-
if(ENABLE_HIP)
313+
if(TA_HIP)
317314
include(external/hip.cmake)
318315
endif()
319316
include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchRangeV3.cmake)
@@ -334,14 +331,14 @@ include(external/umpire.cmake)
334331
# - yes => Invoke first to configure the correct libraries config and run modules to find BLAS/LAPACK/ScaLAPACK(if needed)
335332
# - no => BLAS/LAPACK will be discovered by BLAS++/LAPACK++ (loaded by BTAS) which use standard CMake modules or
336333
# their custom modules; if needed, ScaLAPACK will be discovered by BLACS++
337-
if (ENABLE_WFN91_LINALG_DISCOVERY_KIT)
334+
if (TA_LINALG_DISCOVERY_KIT)
338335
include(FetchWfn91LinAlgModules)
339336
include(FindLinalg)
340-
endif(ENABLE_WFN91_LINALG_DISCOVERY_KIT)
337+
endif(TA_LINALG_DISCOVERY_KIT)
341338
# Boost is to be discovered by the top cmake project, and every (sub)project needs to make sure it has all of its targets
342339
include(external/boost.cmake)
343340
include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchBTAS.cmake)
344-
if(ENABLE_SCALAPACK)
341+
if(TA_SCALAPACK)
345342
include(external/scalapackpp.cmake)
346343
endif()
347344

INSTALL.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ ASLR is a standard technique for increasing platform security implemented by the
200200
* `CMAKE_POSITION_INDEPENDENT_CODE` -- This standard CMake variable controls whether targets are compiled by default as position-independent code or not. If `BUILD_SHARED_LIBS=OFF` need to set this to `ON` if want to use the TiledArray libraries to build shared libraries or position-independent executables.
201201

202202
To make things more concrete, consider the following 2 scenarios:
203-
* Platform with ASLR disabled -- set `TA_ASSUMES_ASLR_DISABLED=ON` to set the defaults correctly and enable the ASLR check. `BUILD_SHARED_LIBS` can be set to `ON` (to produce shared TA/MADworld libraries, e.g., to minimize the executable size) or to `OFF` to produce static libraries. If the TA+MADworld static libraries will be linked into shared libraries set `CMAKE_POSITION_INDEPENDENT_CODE=ON`, otherwise `CMAKE_POSITION_INDEPENDENT_CODE` will be set to OFF for maximum efficiency of function calls.
204-
* Platform with ASLR enabled -- this is the default. Setting `BUILD_SHARED_LIBS=ON` in this scenario will produce executables that can only be safely used with 1 MPI rank, thus `BUILD_SHARED_LIBS` will be defaulted to OFF (i.e. TA+MADworld libraries will be built as static libraries). `CMAKE_POSITION_INDEPENDENT_CODE` is by default set to `ON`, thus TA+MADworld libraries can be linked into position-independent executables safely. TA+MADworld libraries can also be linked into a shared library, provided that *ALL* code using TA+MADworld is part of the *SAME* shared library. E.g. to link TA+MADworld into a Python module compile TA+MADworld libraries and their dependents as static libraries (with `CMAKE_POSITION_INDEPENDENT_CODE=ON`) and link them all together into a single module (same logic applies to shared libraries using TA+MADworld).
203+
* Platform with ASLR disabled -- set `TA_ASSUMES_ASLR_DISABLED=ON` to set the defaults correctly and enable the ASLR check. `BUILD_SHARED_LIBS` can be set to `ON` (to produce shared TA/MADworld libraries, e.g., to minimize the executable size) or to `OFF` to produce static libraries. If the TA+MADworld static libraries will be linked into shared libraries set `CMAKE_POSITION_INDEPENDENT_CODE=ON`, otherwise `CMAKE_POSITION_INDEPENDENT_CODE` will be set to `OFF` for maximum efficiency of function calls.
204+
* Platform with ASLR enabled -- this is the default. Setting `BUILD_SHARED_LIBS=ON` in this scenario will produce executables that can only be safely used with 1 MPI rank, thus `BUILD_SHARED_LIBS` will be defaulted to `OFF` (i.e. TA+MADworld libraries will be built as static libraries). `CMAKE_POSITION_INDEPENDENT_CODE` is by default set to `ON`, thus TA+MADworld libraries can be linked into position-independent executables safely. TA+MADworld libraries can also be linked into a shared library, provided that *ALL* code using TA+MADworld is part of the *SAME* shared library. E.g. to link TA+MADworld into a Python module compile TA+MADworld libraries and their dependents as static libraries (with `CMAKE_POSITION_INDEPENDENT_CODE=ON`) and link them all together into a single module (same logic applies to shared libraries using TA+MADworld).
205205

206206
## MPI
207207

@@ -212,7 +212,7 @@ following CMake cache variables:
212212
* MPI_C_COMPILER -- The MPI C compiler wrapper
213213
* MPI_CXX_COMPILER -- The MPI C++ compiler wrapper
214214

215-
You can build TiledArray without MPI support by setting ENABLE_MPI to OFF.
215+
You can build TiledArray without MPI support by setting `ENABLE_MPI` to `OFF`.
216216
Though we strongly recommend compiling with MPI even if you do not intend
217217
to use TiledArray in a distributed memory environment. Note, if you
218218
build MADNESS yourself, you must also configure MADNESS with `ENABLE_MPI=OFF`
@@ -236,7 +236,7 @@ as needed.
236236
As of version 1.0 TiledArray also provides a direct (non-iterative) linear solvers API
237237
implemented using LAPACK and (optionally) ScaLAPACK. Therefore LAPACK is now a mandatory
238238
prerequisite of TiledArray. The use of ScaLAPACK can be enabled by setting CMake cache
239-
variable `ENABLE_SCALAPACK` to `ON`.
239+
variable `TA_SCALAPACK` to `ON`.
240240

241241
Robust discovery of linear algebra libraries, and _especially_ their distributed-memory
242242
variants, is a complex process. Unfortunately even for serial/shared-memory linear
@@ -245,7 +245,7 @@ algebra libraries only basic scenarios are supported by the standard CMake modul
245245
[LAPACK](https://cmake.org/cmake/help/latest/module/FindLAPACK.html)).
246246
There are several discovery mechanisms available for robust discovery of linear
247247
algebra in TA:
248-
- By specifying the `BLAS_LIBRARIES`, `LAPACK_LIBRARIES`, and (if `ENABLE_SCALAPACK` is on)
248+
- By specifying the `BLAS_LIBRARIES`, `LAPACK_LIBRARIES`, and (if `TA_SCALAPACK` is on)
249249
`ScaLAPACK_LIBRARIES` CMake cache variables via CMake command line or via a toolchain.
250250
Doing this overrides all other mechanisms of discovery described below and is recommended
251251
if the discovery fails for some reason. To help with setting these variables for specific
@@ -270,7 +270,7 @@ algebra in TA:
270270
- `Accelerate`: Apple's Accelerate framework
271271
- `FLAME`: (LAPACK-only) [libFLAME](https://www.cs.utexas.edu/~flame/web/libFLAME.html)
272272
*N.B.* These differ from the recognized values of the `BLA_VENDOR` variable used by the [BLAS+LAPACK CMake modules](https://cmake.org/cmake/help/latest/module/FindBLAS.html).
273-
- If the use of the NWChemEx kit is disabled by setting CMake cache variable `ENABLE_WFN91_LINALG_DISCOVERY_KIT` to `OFF`
273+
- If the use of the NWChemEx kit is disabled by setting CMake cache variable `TA_LINALG_DISCOVERY_KIT` to `OFF`
274274
BLAS/LAPACK are imported transitively via the BLAS++/LAPACK++ libraries (which are themselves
275275
imported transitively via the BTAS library). Under the most common scenario, where TiledArray
276276
will configure and compile BTAS dependency and its BLAS++/LAPACK++ prerequisites from source
@@ -329,9 +329,9 @@ Also note that even if OpenMP or TBB backends are used, TiledArray will be defau
329329

330330
Support for execution on NVIDIA and AMD GPGPUs is controlled by the following variables:
331331

332-
* `ENABLE_CUDA` -- Set to `ON` to turn on CUDA support. [Default=OFF].
332+
* `TA_CUDA` -- Set to `ON` to turn on CUDA support. [Default=OFF].
333333
* `CMAKE_CUDA_HOST_COMPILER` -- Set to the path to the host C++ compiler to be used by CUDA compiler. CUDA compilers used to be notorious for only being able to use specific C++ host compilers, but support for more recent C++ host compilers has improved. The default is determined by the CUDA compiler and the user environment variables (`PATH` etc.).
334-
* `ENABLE_HIP` -- Set to `ON` to turn on HIP/ROCm support. [Default=OFF].
334+
* `TA_HIP` -- Set to `ON` to turn on HIP/ROCm support. [Default=OFF].
335335
* `LIBRETT_INSTALL_DIR` -- the installation prefix of the pre-installed LibreTT library. This should not be normally needed; it is strongly recommended to let TiledArray build and install LibreTT.
336336
* `UMPIRE_INSTALL_DIR` -- the installation prefix of the pre-installed Umpire library. This should not be normally needed; it is strongly recommended to let TiledArray build and install Umpire.
337337

@@ -367,12 +367,10 @@ the correct revision of MADNESS.
367367
The following CMake options may be used to modify build behavior or find MADNESS:
368368

369369
* `ENABLE_MPI` -- Enable MPI [Default=ON]
370-
* `ENABLE_SCALAPACK` -- Enable the use of ScaLAPACK bindings [Default=OFF]
371370
* `ENABLE_TBB` -- Enable the use of TBB when building MADNESS [Default=ON]
372371
* `ENABLE_GPERFTOOLS` -- Enable the use of gperftools when building MADNESS [Default=OFF]
373372
* `ENABLE_TCMALLOC_MINIMAL` -- Enable the use of gperftool's tcmalloc_minimal library only (the rest of gperftools is skipped) when building MADNESS [Default=OFF]
374373
* `ENABLE_LIBUNWIND` -- Force the discovery of libunwind library when building MADNESS [Default=OFF]
375-
* `ENABLE_WFN91_LINALG_DISCOVERY_KIT` -- Enable the use of NWChemEx's linear algebra discovery [Default=ON]
376374
* `MADNESS_SOURCE_DIR` -- Path to the MADNESS source directory
377375
* `MADNESS_BINARY_DIR` -- Path to the MADNESS build directory
378376
* `MADNESS_URL` -- Path to the MADNESS repository [Default=MADNESS git repository]

bin/docker-cuda-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y python3 python3-pip python3-test python
3030
RUN CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz" && wget --no-check-certificate -O - \$CMAKE_URL | tar --strip-components=1 -xz -C /usr/local
3131
ENV CMAKE=/usr/local/bin/cmake
3232
# 3. download and build TiledArray
33-
RUN cd /usr/local/src && git clone --depth=1 https://github.com/ValeevGroup/tiledarray.git && cd /usr/local/src/tiledarray && mkdir build && cd build && \$CMAKE .. -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_CUDA=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo && \$CMAKE --build . --target tiledarray && \$CMAKE --build . --target examples && \$CMAKE --build . --target install
33+
RUN cd /usr/local/src && git clone --depth=1 https://github.com/ValeevGroup/tiledarray.git && cd /usr/local/src/tiledarray && mkdir build && cd build && \$CMAKE .. -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_INSTALL_PREFIX=/usr/local -DTA_CUDA=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo && \$CMAKE --build . --target tiledarray && \$CMAKE --build . --target examples && \$CMAKE --build . --target install
3434
3535
# Clean up APT when done.
3636
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ci/.build-project

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if [[ "$vars" =~ \"-DBLAS_PREFERENCE_LIST=IntelMKL ]]; then
8989
cmd "source /opt/intel/oneapi/tbb/latest/env/vars.sh"
9090
cmd "echo TBBROOT=\$TBBROOT"
9191
fi
92-
if [[ "$vars" =~ \"-D([a-zA-Z]+_)?ENABLE_CUDA=(ON|TRUE|1|YES)\" ]]; then
92+
if [[ "$vars" =~ \"-D([a-zA-Z]+_)?TA_CUDA=(ON|TRUE|1|YES)\" ]]; then
9393
cmd "make -C /home/ValeevGroup install/cuda"
9494
cmd "rm -fr /usr/local/bin/nvcc"
9595
cmd "export CUDACXX=/usr/local/cuda/bin/nvcc"

ci/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
To run CI in docker use `docker-run-ci` and give build parameters, eg:
22

33
```
4-
$ ./ci/docker-run-ci TA_PYTHON=OFF ENABLE_CUDA=ON all check
4+
$ ./ci/docker-run-ci TA_PYTHON=OFF TA_CUDA=ON all check
55
Removing previous build container: andrey.tiledarray.build
66
77
Running new build of /home/andrey/github/tiledarray on andrey.tiledarray.build

ci/docker-run-ci

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# build project via docker run, eg
44
# usage: docker-run-ci [ VAR=VALUE ... ] [ target ... ]
5-
# example: ./ci/docker-run-ci TA_PYTHON=OFF ENABLE_CUDA=ON all check
5+
# example: ./ci/docker-run-ci TA_PYTHON=OFF TA_CUDA=ON all check
66

77
project=$(basename $PWD)
88
image=valeevgroup/ubuntu:${VALEEVGROUP_UBUNTU_TAG:-latest}

cmake/toolchains/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export CUDA_GCC_DIR=/sw/summit/gcc/7.4.0
2727
2828
cmake ../../tiledarray \
2929
-DCMAKE_TOOLCHAIN_FILE=cmake/vg/toolchains/olcf-summit-gcc-essl.cmake \
30-
-DENABLE_CUDA=ON \
30+
-DTA_CUDA=ON \
3131
-DCMAKE_CUDA_HOST_COMPILER=${CUDA_GCC_DIR}/bin/g++ \
3232
-DCUDAToolkit_ROOT=/sw/summit/cuda/10.1.243 \
3333
-DENABLE_TBB=OFF \

examples/device/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#
2424

2525

26-
if(TILEDARRAY_HAS_HIP OR TILEDARRAY_HAS_HIP)
26+
if(TILEDARRAY_HAS_CUDA OR TILEDARRAY_HAS_HIP)
2727

2828
foreach(_exec device_task ta_dense_device ta_cc_abcd_device ta_vector_device ta_reduce_device)
2929

examples/scalapack/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Create example executable
2626

27-
if(ENABLE_SCALAPACK)
27+
if(TA_SCALAPACK)
2828

2929
foreach(_exec conversion evp)
3030

@@ -35,4 +35,4 @@ foreach(_exec conversion evp)
3535

3636
endforeach()
3737

38-
endif(ENABLE_SCALAPACK)
38+
endif(TA_SCALAPACK)

external/eigen.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ include(AppendFlags)
66

77
# if CUDA is enabled (assuming CUDA version is 9 or 10) need Eigen 3.3.7
88
# see https://gitlab.com/libeigen/eigen/issues/1491
9-
if (ENABLE_CUDA)
9+
if (TA_CUDA)
1010
set(_tiledarray_required_eigen_version 3.3.7)
11-
else(ENABLE_CUDA)
11+
else(TA_CUDA)
1212
set(_tiledarray_required_eigen_version ${TA_TRACKED_EIGEN_VERSION})
13-
endif(ENABLE_CUDA)
13+
endif(TA_CUDA)
1414

1515
# Check for existing Eigen
1616
# prefer CMake-configured-and-installed instance

external/librett.cmake

+12-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ else()
6969
-DCMAKE_PREFIX_PATH=${LIBRETT_CMAKE_PREFIX_PATH}
7070
-DENABLE_NO_ALIGNED_ALLOC=ON
7171
)
72-
if (ENABLE_CUDA)
72+
if (TA_CUDA)
7373
list(APPEND LIBRETT_CMAKE_ARGS
7474
-DENABLE_CUDA=ON
7575
-DCMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}
@@ -82,7 +82,7 @@ else()
8282
list(APPEND LIBRETT_CMAKE_ARGS "-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}")
8383
endif(DEFINED CMAKE_CUDA_ARCHITECTURES)
8484
endif()
85-
if (ENABLE_HIP)
85+
if (TA_HIP)
8686
list(APPEND LIBRETT_CMAKE_ARGS
8787
-DENABLE_HIP=ON
8888
-DCMAKE_HIP_COMPILER=${CMAKE_HIP_COMPILER}
@@ -97,6 +97,14 @@ else()
9797
set(LIBRETT_CMAKE_ARGS "${LIBRETT_CMAKE_ARGS}"
9898
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
9999
endif(CMAKE_TOOLCHAIN_FILE)
100+
if (DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
101+
set(LIBRETT_CMAKE_ARGS "${LIBRETT_CMAKE_ARGS}"
102+
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=${CMAKE_INTERPROCEDURAL_OPTIMIZATION}")
103+
endif(DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
104+
if (DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION_${CMAKE_BUILD_TYPE})
105+
set(LIBRETT_CMAKE_ARGS "${LIBRETT_CMAKE_ARGS}"
106+
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION_${CMAKE_BUILD_TYPE}=${CMAKE_INTERPROCEDURAL_OPTIMIZATION_${CMAKE_BUILD_TYPE}}")
107+
endif(DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION_${CMAKE_BUILD_TYPE})
100108

101109
foreach(lang C CXX CUDA)
102110
if (DEFINED CMAKE_${lang}_COMPILER_LAUNCHER)
@@ -170,14 +178,14 @@ set_target_properties(TiledArray_LIBRETT
170178
INTERFACE_LINK_LIBRARIES
171179
"$<BUILD_INTERFACE:${LIBRETT_BUILD_BYPRODUCTS}>;$<INSTALL_INTERFACE:${_LIBRETT_INSTALL_DIR}/lib/librett.${LIBRETT_DEFAULT_LIBRARY_SUFFIX}>"
172180
)
173-
if (ENABLE_CUDA)
181+
if (TA_CUDA)
174182
set_target_properties(TiledArray_LIBRETT
175183
PROPERTIES
176184
INTERFACE_COMPILE_DEFINITIONS
177185
"LIBRETT_USES_CUDA=1"
178186
)
179187
endif()
180-
if (ENABLE_HIP)
188+
if (TA_HIP)
181189
set_target_properties(TiledArray_LIBRETT
182190
PROPERTIES
183191
INTERFACE_COMPILE_DEFINITIONS

0 commit comments

Comments
 (0)