Add Umpire options to CMake and finish Caliper option (#762)
* Update cmake to include umpire options * Finish caliper cmake option
This commit is contained in:
parent
247c168ee7
commit
843e8c71ef
@ -95,7 +95,7 @@ option(HYPRE_WITH_OPENMP "Use OpenMP" OFF)
|
||||
option(HYPRE_ENABLE_HOPSCOTCH "Use hopscotch hashing with OpenMP" OFF)
|
||||
option(HYPRE_WITH_SUPERLU "Use TPL SuperLU" OFF)
|
||||
option(HYPRE_WITH_DSUPERLU "Use TPL SuperLU_Dist" OFF)
|
||||
option(HYPRE_WITH_CALIPER "Use Caliper" OFF) # TODO: Finish this cmake feature
|
||||
option(HYPRE_WITH_CALIPER "Use Caliper" OFF)
|
||||
option(HYPRE_PRINT_ERRORS "Print HYPRE errors" OFF)
|
||||
option(HYPRE_TIMING "Use HYPRE timing routines" OFF)
|
||||
option(HYPRE_BUILD_EXAMPLES "Build examples" OFF)
|
||||
@ -123,6 +123,14 @@ option(HYPRE_ENABLE_ONEMKLBLAS "Use oneMKL blas" ON)
|
||||
option(HYPRE_ENABLE_ONEMKLRAND "Use oneMKL rand" ON)
|
||||
set(HYPRE_SYCL_TARGET "" CACHE STRING "Target SYCL architecture, e.g. 'spir64_gen'.")
|
||||
set(HYPRE_SYCL_TARGET_BACKEND "" CACHE STRING "Additional SYCL backend options, e.g. '-device 12.1.0,12.4.0'.")
|
||||
# Umpire resource management options
|
||||
option(HYPRE_WITH_UMPIRE "Use Umpire Allocator for device and unified memory" OFF)
|
||||
option(HYPRE_WITH_UMPIRE_HOST "Use Umpire Allocator for host memory" OFF)
|
||||
option(HYPRE_WITH_UMPIRE_DEVICE "Use Umpire Allocator for device memory" OFF)
|
||||
option(HYPRE_WITH_UMPIRE_UM "Use Umpire Allocator for unified memory" OFF)
|
||||
option(HYPRE_WITH_UMPIRE_PINNED "Use Umpire Allocator for pinned memory" OFF)
|
||||
option(TPL_UMPIRE_LIBRARIES "List of absolute paths to Umpire link libraries [].")
|
||||
option(TPL_UMPIRE_INCLUDE_DIRS "List of absolute paths to Umpire include directories [].")
|
||||
|
||||
option(TPL_SUPERLU_LIBRARIES "List of absolute paths to SuperLU link libraries [].")
|
||||
option(TPL_SUPERLU_INCLUDE_DIRS "List of absolute paths to SuperLU include directories [].")
|
||||
@ -217,6 +225,32 @@ if (HYPRE_SEQUENTIAL)
|
||||
set(HYPRE_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
if (HYPRE_WITH_UMPIRE)
|
||||
set(HYPRE_USING_UMPIRE ON CACHE BOOL "" FORCE)
|
||||
set(HYPRE_USING_UMPIRE_DEVICE ON CACHE BOOL "" FORCE)
|
||||
set(HYPRE_USING_UMPIRE_UM ON CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
if (HYPRE_WITH_UMPIRE_HOST)
|
||||
set(HYPRE_USING_UMPIRE ON CACHE BOOL "" FORCE)
|
||||
set(HYPRE_USING_UMPIRE_HOST ON CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
if (HYPRE_WITH_UMPIRE_DEVICE)
|
||||
set(HYPRE_USING_UMPIRE ON CACHE BOOL "" FORCE)
|
||||
set(HYPRE_USING_UMPIRE_DEVICE ON CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
if (HYPRE_WITH_UMPIRE_UM)
|
||||
set(HYPRE_USING_UMPIRE ON CACHE BOOL "" FORCE)
|
||||
set(HYPRE_USING_UMPIRE_UM ON CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
if (HYPRE_WITH_UMPIRE_PINNED)
|
||||
set(HYPRE_USING_UMPIRE ON CACHE BOOL "" FORCE)
|
||||
set(HYPRE_USING_UMPIRE_PINNED ON CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
# CUDA
|
||||
if (HYPRE_WITH_CUDA)
|
||||
enable_language(CXX)
|
||||
@ -529,10 +563,39 @@ if (HYPRE_USING_SYCL)
|
||||
endif()
|
||||
|
||||
if (HYPRE_USING_CALIPER)
|
||||
find_package(caliper REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC caliper)
|
||||
if (NOT TPL_CALIPER_LIBRARIES OR NOT TPL_CALIPER_INCLUDE_DIRS)
|
||||
message(FATAL_ERROR "Both TPL_CALIPER_LIBRARIES and TPL_CALIPER_INCLUDE_DIRS options must be set for Caliper support.")
|
||||
endif ()
|
||||
|
||||
foreach (dir ${TPL_CALIPER_INCLUDE_DIRS})
|
||||
if (NOT EXISTS ${dir})
|
||||
message(FATAL_ERROR "Caliper include directory not found: ${dir}")
|
||||
endif ()
|
||||
set(CMAKE_C_FLAGS "-I${dir} ${CMAKE_C_FLAGS}")
|
||||
endforeach ()
|
||||
message(STATUS "Enabled support for using Caliper.")
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${TPL_CALIPER_LIBRARIES})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${TPL_CALIPER_INCLUDE_DIRS})
|
||||
|
||||
endif()
|
||||
|
||||
# Find Umpire, if requested
|
||||
if (HYPRE_USING_UMPIRE)
|
||||
if (NOT TPL_UMPIRE_LIBRARIES OR NOT TPL_UMPIRE_INCLUDE_DIRS)
|
||||
message(FATAL_ERROR "Both TPL_UMPIRE_LIBRARIES and TPL_UMPIRE_INCLUDE_DIRS options must be set for Umpire support.")
|
||||
endif ()
|
||||
|
||||
foreach (dir ${TPL_UMPIRE_INCLUDE_DIRS})
|
||||
if (NOT EXISTS ${dir})
|
||||
message(FATAL_ERROR "Umpire include directory not found: ${dir}")
|
||||
endif ()
|
||||
set(CMAKE_C_FLAGS "-I${dir} ${CMAKE_C_FLAGS}")
|
||||
endforeach ()
|
||||
message(STATUS "Enabled support for using Umpire.")
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${TPL_UMPIRE_LIBRARIES})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${TPL_UMPIRE_INCLUDE_DIRS})
|
||||
endif ()
|
||||
|
||||
# Configure a header file to pass CMake settings to the source code
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/config/HYPRE_config.h.cmake.in"
|
||||
|
||||
@ -39,6 +39,11 @@ set(HYPRE_ENABLE_GPU_PROFILING @HYPRE_ENABLE_GPU_PROFILING@)
|
||||
set(HYPRE_ENABLE_ONEMKLSPARSE @HYPRE_ENABLE_ONEMKLSPARSE@)
|
||||
set(HYPRE_ENABLE_ONEMKLBLAS @HYPRE_ENABLE_ONEMKLBLAS@)
|
||||
set(HYPRE_ENABLE_ONEMKLRAND @HYPRE_ENABLE_ONEMKLRAND@)
|
||||
set(HYPRE_WITH_UMPIRE @HYPRE_WITH_UMPIRE@)
|
||||
set(HYPRE_WITH_UMPIRE_HOST @HYPRE_WITH_UMPIRE_HOST@)
|
||||
set(HYPRE_WITH_UMPIRE_DEVICE @HYPRE_WITH_UMPIRE_DEVICE@)
|
||||
set(HYPRE_WITH_UMPIRE_UM @HYPRE_WITH_UMPIRE_UM@)
|
||||
set(HYPRE_WITH_UMPIRE_PINNED @HYPRE_WITH_UMPIRE_PINNED@)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
|
||||
@ -68,6 +68,21 @@
|
||||
/* Use Caliper instrumentation */
|
||||
#cmakedefine HYPRE_USING_CALIPER 1
|
||||
|
||||
/* Use UMPIRE */
|
||||
#cmakedefine HYPRE_USING_UMPIRE 1
|
||||
|
||||
/* Use UMPIRE for device memory */
|
||||
#cmakedefine HYPRE_USING_UMPIRE_DEVICE 1
|
||||
|
||||
/* Use UMPIRE for host memory */
|
||||
#cmakedefine HYPRE_USING_UMPIRE_HOST 1
|
||||
|
||||
/* Use UMPIRE for pinned memory */
|
||||
#cmakedefine HYPRE_USING_UMPIRE_PINNED 1
|
||||
|
||||
/* Use UMPIRE for unified memory */
|
||||
#cmakedefine HYPRE_USING_UMPIRE_UM 1
|
||||
|
||||
/* Use if executing on device with CUDA */
|
||||
#cmakedefine HYPRE_USING_CUDA 1
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ else()
|
||||
list(APPEND EXPORT_INTERFACE_CUDA_LIBS CUDA::cublas_static CUDA::cublasLt_static)
|
||||
else ()
|
||||
list(APPEND EXPORT_INTERFACE_CUDA_LIBS CUDA::cublas CUDA::cublasLt)
|
||||
endif (HYPRE_SHARED)
|
||||
endif (HYPRE_CUDA_TOOLKIT_STATIC)
|
||||
endif (HYPRE_ENABLE_CUBLAS)
|
||||
|
||||
if (HYPRE_ENABLE_CUSOLVER)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user