Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure renamings #866

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
22 changes: 11 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,12 @@ option(HYPRE_ENABLE_DEVICE_POOL "Use device memory pool" OFF)
option(HYPRE_ENABLE_CUBLAS "Use cuBLAS" OFF)
option(HYPRE_ENABLE_CURAND "Use cuRAND" ON)
option(HYPRE_ENABLE_GPU_PROFILING "Use NVTX on CUDA" OFF)
set(HYPRE_CUDA_SM "70" CACHE STRING "Target CUDA architecture.")
set(GPU_ARCH "" CACHE STRING "GPU architecture (e.g. CUDA/HIP SM number or Intel GPU device number)")
victorapm marked this conversation as resolved.
Show resolved Hide resolved
set(HYPRE_CUDA_SM "70" CACHE STRING "(DEPRECATED: use GPU_ARCH instead) Target CUDA architecture.")
# oneAPI options
option(HYPRE_ENABLE_ONEMKLSPARSE "Use oneMKL sparse" ON)
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)
Expand Down Expand Up @@ -321,12 +320,16 @@ if (HYPRE_WITH_CUDA)
set(HYPRE_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
endif ()

# Default to cuda sm 70 if not specified
if (GPU_ARCH STREQUAL "")
set(GPU_ARCH "70" CACHE STRING "" FORCE)
endif ()
if (CMAKE_VERSION VERSION_LESS 3.18.0)
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:-arch=sm_${HYPRE_CUDA_SM}>")
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:-arch=sm_${GPU_ARCH}>")
else ()
set(CMAKE_CUDA_ARCHITECTURES "${HYPRE_CUDA_SM}")
set(CMAKE_CUDA_ARCHITECTURES "${GPU_ARCH}")
endif ()
message(STATUS "Using CUDA architecture: ${HYPRE_CUDA_SM}")
message(STATUS "Using GPU architecture: ${GPU_ARCH}")

add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:-expt-extended-lambda>")

Expand Down Expand Up @@ -401,11 +404,8 @@ if (HYPRE_WITH_SYCL)
add_link_options("-fsycl-device-code-split=per_kernel")
add_link_options("-Wl,--no-relax")

if (HYPRE_SYCL_TARGET)
add_link_options("SHELL:-fsycl-targets=${HYPRE_SYCL_TARGET}")
endif ()
if (HYPRE_SYCL_TARGET_BACKEND)
add_link_options("SHELL:-Xsycl-target-backend '${HYPRE_SYCL_TARGET_BACKEND}'")
if (GPU_ARCH)
add_link_options("SHELL:-fsycl-targets=spir64_gen -Xs '-device ${GPU_ARCH}'")
endif ()

set(HYPRE_USING_HOST_MEMORY OFF CACHE BOOL "" FORCE)
Expand Down
18 changes: 11 additions & 7 deletions src/config/Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ CFLAGS = @CFLAGS@ @DEFS@ $(C_COMPILE_FLAGS)
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@ @DEFS@ $(CXX_COMPILE_FLAGS)

CUCC = @CUCC@ ${CUDA_ARCH}
CUFLAGS = @CUFLAGS@ @DEFS@ ${C_COMPILE_FLAGS}
GPUCC = @GPUCC@ ${HYPRE_GPU_ARCH}
GPUFLAGS = @GPUFLAGS@ @DEFS@ ${C_COMPILE_FLAGS}

.f.o:
$(FC) $(FFLAGS) -c $<
Expand All @@ -58,12 +58,12 @@ CUFLAGS = @CUFLAGS@ @DEFS@ ${C_COMPILE_FLAGS}
$(CXX) $(CXXFLAGS) -c $<
.cc.o:
$(CXX) $(CXXFLAGS) -c $<
ifeq ($(CUCC), )
ifeq ($(GPUCC), )
.c.obj:
$(CC) $(CFLAGS) -c $< -o $@
else
.c.obj:
$(CUCC) $(CUFLAGS) -c $< -o $@
$(GPUCC) $(GPUFLAGS) -c $< -o $@
endif

LINK_FC = @LINK_FC@
Expand Down Expand Up @@ -117,13 +117,17 @@ MPIFLAGS = @MPIFLAGS@
##################################################################
HYPRE_NAP_INCLUDE = @HYPRE_NAP_INCLUDE@

##################################################################
## GPU architecture
##################################################################
HYPRE_GPU_ARCH = @HYPRE_GPU_GENCODE@

##################################################################
## CUDA options
##################################################################
HYPRE_CUDA_PATH = @HYPRE_CUDA_PATH@
HYPRE_CUDA_INCLUDE = @HYPRE_CUDA_INCLUDE@
HYPRE_CUDA_LIBS = @HYPRE_CUDA_LIBS@
CUDA_ARCH = @HYPRE_CUDA_GENCODE@

##################################################################
## HIP options
Expand All @@ -134,8 +138,8 @@ HYPRE_HIP_LIBS = @HYPRE_HIP_LIBS@
##################################################################
## SYCL options
##################################################################
HYPRE_SYCL_INCLUDE=@HYPRE_SYCL_INCL@
HYPRE_SYCL_LIBS=@HYPRE_SYCL_LIBS@
HYPRE_SYCL_INCLUDE = @HYPRE_SYCL_INCL@
HYPRE_SYCL_LIBS = @HYPRE_SYCL_LIBS@

##################################################################
## Caliper options
Expand Down
Loading