-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHiOpConfig.cmake.in
65 lines (54 loc) · 1.98 KB
/
HiOpConfig.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Author(s):
# - Cameron Rutherford <cameron.rutherford@pnnl.gov>
include( "${CMAKE_CURRENT_LIST_DIR}/HiOpTargets.cmake" )
# Configure TPLs if not already in an export set
# If using MPI, make sure module is loaded
if(@HIOP_USE_MPI@ AND NOT TARGET MPI::MPI_CXX)
find_package(MPI REQUIRED)
include_directories(@MPI_CXX_ADDITIONAL_INCLUDE_DIRS@ @MPI_CXX_COMPILER_INCLUDE_DIRS@)
if(NOT DEFINED MPI_CXX_COMPILER)
set(CMAKE_CXX_COMPILER @MPI_CXX_COMPILER@)
set(CMAKE_C_COMPILER @MPI_C_COMPILER@)
endif()
include_directories(@MPI_Fortran_ADDITIONAL_INCLUDE_DIRS@ @MPI_Fortran_COMPILER_INCLUDE_DIRS@)
endif()
if(@HIOP_USE_RAJA@ AND NOT TARGET OpenMP::OpenMP_CXX)
find_package(OpenMP)
endif()
# Need to export RAJA and umpire as they have find_package
if(@HIOP_USE_RAJA@ AND NOT TARGET RAJA)
find_package(RAJA PATHS @RAJA_DIR@)
find_package(umpire PATHS @umpire_DIR@)
endif()
set(HiOp::SPARSE @HIOP_SPARSE@ CACHE BOOL "indicates if hiop sparse is enabled")
if(@HIOP_USE_GINKGO@ AND NOT TARGET Ginkgo)
find_package(Ginkgo PATHS @Ginkgo_DIR@)
endif()
if(@HIOP_USE_GPU@)
if(@HIOP_USE_CUDA@)
include(CheckLanguage)
# This must come before enable_language(CUDA)
set(CMAKE_CUDA_COMPILER @CMAKE_CUDA_COMPILER@)
enable_language(CUDA)
check_language(CUDA)
set(CMAKE_CUDA_FLAGS "@CMAKE_CUDA_FLAGS@")
find_package(CUDAToolkit REQUIRED)
elseif(@HIOP_USE_HIP@)
find_package(hip REQUIRED)
find_package(hipfft REQUIRED)
find_package(hiprand REQUIRED)
find_package(rocrand REQUIRED)
find_package(hipblas REQUIRED)
find_package(rocblas REQUIRED)
find_package(hipcub REQUIRED)
find_package(rocprim REQUIRED)
add_definitions(-DHAVE_HIP) # For hipmagma
endif()
endif()
# Add HiOp::HiOp alias library
if(@HIOP_BUILD_SHARED@ AND NOT TARGET HiOp::HiOp)
add_library(HiOp::HiOp ALIAS HiOp::@hiop_default_library_name@)
endif()
if(@HIOP_BUILD_STATIC@ AND NOT TARGET HiOp::HiOp)
add_library(HiOp::HiOp ALIAS HiOp::@hiop_default_library_name@)
endif()