From eb0a7f95f75301a670279008f94177d106a6d989 Mon Sep 17 00:00:00 2001 From: Ajay Panyala Date: Thu, 2 May 2024 00:48:17 -0700 Subject: [PATCH] rename gpu option --- CMakeLists.txt | 2 +- cmake/check_user_env.cmake | 8 ++++---- docs/install.rst | 24 +++++++++++------------- src/tamm/CMakeLists.txt | 4 ++-- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a9b9e45e..1af71a1b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ elseif(NOT DEFINED USE_LIBNUMA OR USE_LIBNUMA) list(APPEND TAMM_DEPENDENCIES numactl) endif() -if(USE_CUDA OR USE_HIP OR USE_DPCPP) +if(TAMM_ENABLE_CUDA OR TAMM_ENABLE_HIP OR TAMM_ENABLE_DPCPP) if(USE_SYCL_BLAS) #list(APPEND TAMM_DEPENDENCIES sycl-blas) endif() diff --git a/cmake/check_user_env.cmake b/cmake/check_user_env.cmake index c0abdad30..fad16cc4e 100644 --- a/cmake/check_user_env.cmake +++ b/cmake/check_user_env.cmake @@ -13,9 +13,9 @@ if (DEFINED ENV{CONDA_PREFIX}) #VIRTUAL_ENV endif() if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin") - if (USE_CUDA) - message(FATAL_ERROR "TAMM does not support building with GPU support \ - on MACOSX. Please use -DUSE_CUDA=OFF for MACOSX builds.") + if (${PROJECT_NAME}_ENABLE_CUDA) + message(FATAL_ERROR "${PROJECT_NAME} does not support building with GPU support \ + on MACOSX. Please use -D${PROJECT_NAME}_ENABLE_CUDA=OFF for MACOSX builds.") endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" @@ -79,7 +79,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" A endif() endif() -if(USE_CUDA) +if(${PROJECT_NAME}_ENABLE_CUDA) include(CheckLanguage) check_language(CUDA) diff --git a/docs/install.rst b/docs/install.rst index ad7cc70e0..1619257d5 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -32,7 +32,7 @@ CUDA Options :: - -DUSE_CUDA=ON (OFF by default) + -DTAMM_ENABLE_CUDA=ON (OFF by default) One of -DGPU_ARCH=X (OR) -DCMAKE_CUDA_ARCHITECTURES=X is required. Set the arch value X to 70 for Volta, 80 for Ampere, 90 for Hopper and 95 for Blackwell. HIP Options @@ -40,7 +40,7 @@ HIP Options :: - -DUSE_HIP=ON (OFF by default) + -DTAMM_ENABLE_HIP=ON (OFF by default) -DROCM_ROOT=$ROCM_PATH One of -DGPU_ARCH=gfx90a (OR) -DCMAKE_HIP_ARCHITECTURES=gfx90a is required. @@ -50,7 +50,7 @@ DPCPP options :: - -DUSE_DPCPP=ON + -DTAMM_ENABLE_DPCPP=ON (OFF by default) CMake options for developers (optional) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -103,7 +103,7 @@ In addition to the build options chosen, there are various build configurations Default build using BLIS and NETLIB LAPACK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To enable CUDA build, add ``-DUSE_CUDA=ON`` and ``-DGPU_ARCH=`` +To enable CUDA build, add ``-DTAMM_ENABLE_CUDA=ON`` and ``-DGPU_ARCH=`` :: @@ -135,9 +135,7 @@ Default build on MACOS Build using Intel MKL ~~~~~~~~~~~~~~~~~~~~~~ -.. _to-enable-cuda-build-add--duse_cudaon-1: - -To enable CUDA build, add ``-DUSE_CUDA=ON`` and ``-DGPU_ARCH=`` +To enable CUDA build, add ``-DTAMM_ENABLE_CUDA=ON`` and ``-DGPU_ARCH=`` :: @@ -169,7 +167,7 @@ Build instructions for Summit using ESSL CC=gcc CXX=g++ FC=gfortran cmake \ -DCMAKE_INSTALL_PREFIX=$REPO_INSTALL_PATH \ -DBLIS_CONFIG=power9 \ - -DLINALG_VENDOR=IBMESSL -DUSE_CUDA=ON \ + -DLINALG_VENDOR=IBMESSL -DTAMM_ENABLE_CUDA=ON \ -DLINALG_PREFIX=/sw/summit/essl/6.3.0/essl/6.3 .. make -j3 @@ -200,7 +198,7 @@ Build instructions for Summit using ESSL and UPC++ -DBLIS_CONFIG=power9 \ -DLINALG_VENDOR=IBMESSL \ -DLINALG_PREFIX=/sw/summit/essl/6.3.0/essl/6.3 \ - -DUSE_CUDA=ON \ + -DTAMM_ENABLE_CUDA=ON \ -DUSE_UPCXX=ON .. UPCXX_CODEMODE=O3 make -j3 @@ -226,7 +224,7 @@ Build instructions for Frontier CC=cc CXX=CC FC=ftn cmake \ -DCMAKE_INSTALL_PREFIX=$REPO_INSTALL_PATH \ -DGPU_ARCH=gfx90a \ - -DUSE_HIP=ON -DROCM_ROOT=$ROCM_PATH \ + -DTAMM_ENABLE_HIP=ON -DROCM_ROOT=$ROCM_PATH \ -DGCCROOT=/opt/gcc/12.2.0/snos \ -DHDF5_ROOT=$HDF5_ROOT .. @@ -260,7 +258,7 @@ Build instructions for Perlmutter and Polaris cd $REPO_ROOT_PATH/build - cmake -DUSE_CUDA=ON -DGPU_ARCH=80 -DBLIS_CONFIG=generic \ + cmake -DTAMM_ENABLE_CUDA=ON -DGPU_ARCH=80 -DBLIS_CONFIG=generic \ -DCMAKE_INSTALL_PREFIX=$REPO_INSTALL_PATH .. make -j3 @@ -285,7 +283,7 @@ SYCL build instructions using Intel OneAPI CC=icx CXX=icpx FC=ifx cmake \ -DCMAKE_INSTALL_PREFIX=$REPO_INSTALL_PATH \ -DLINALG_VENDOR=IntelMKL -DLINALG_PREFIX=/opt/oneapi/mkl/latest \ - -DUSE_DPCPP=ON -DGCCROOT=$GCC_ROOT_PATH \ + -DTAMM_ENABLE_DPCPP=ON -DGCCROOT=$GCC_ROOT_PATH \ -DTAMM_CXX_FLAGS="-fma -ffast-math -fsycl -fsycl-default-sub-group-size 16 -fsycl-unnamed-lambda -fsycl-device-code-split=per_kernel -sycl-std=2020" make -j3 @@ -310,7 +308,7 @@ Build instructions for Aurora CC=icx CXX=icpx FC=ifx cmake \ -DCMAKE_INSTALL_PREFIX=$REPO_INSTALL_PATH \ -DLINALG_VENDOR=IntelMKL -DLINALG_PREFIX=$MKLROOT \ - -DUSE_DPCPP=ON -DUSE_MEMKIND=ON -DGCCROOT=$GCC_ROOT_PATH \ + -DTAMM_ENABLE_DPCPP=ON -DGCCROOT=$GCC_ROOT_PATH \ -DTAMM_CXX_FLAGS="-march=sapphirerapids -mtune=sapphirerapids -ffast-math -fsycl -fsycl-default-sub-group-size 16 -fsycl-unnamed-lambda -fsycl-device-code-split=per_kernel -sycl-std=2020" make -j12 diff --git a/src/tamm/CMakeLists.txt b/src/tamm/CMakeLists.txt index dbf555f06..7e4e753fb 100644 --- a/src/tamm/CMakeLists.txt +++ b/src/tamm/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(TAMM VERSION ${PROJECT_VERSION} LANGUAGES CXX) include(TargetMacros) #For cmsb_add_library -if(USE_CUDA OR USE_HIP OR USE_DPCPP) +if(${PROJECT_NAME}_HAS_CUDA OR ${PROJECT_NAME}_HAS_HIP OR ${PROJECT_NAME}_HAS_DPCPP) set(tamm_gpu_INCS gpu_streams.hpp mr/gpu_memory_resource.hpp @@ -12,7 +12,7 @@ if(USE_CUDA OR USE_HIP OR USE_DPCPP) set(tamm_gpu_SRCS kernels/gpu_blas.cpp) endif() -if(USE_DPCPP) +if(${PROJECT_NAME}_HAS_DPCPP) list(APPEND tamm_gpu_INCS sycl_device.hpp) endif()