Skip to content

Commit

Permalink
rename gpu option
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaypanyala committed May 2, 2024
1 parent 40062c5 commit eb0a7f9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions cmake/check_user_env.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down
24 changes: 11 additions & 13 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ 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
~~~~~~~~~~~~

::

-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.

Expand All @@ -50,7 +50,7 @@ DPCPP options

::

-DUSE_DPCPP=ON
-DTAMM_ENABLE_DPCPP=ON (OFF by default)

CMake options for developers (optional)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -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=<value>``
To enable CUDA build, add ``-DTAMM_ENABLE_CUDA=ON`` and ``-DGPU_ARCH=<value>``


::
Expand Down Expand Up @@ -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=<value>``
To enable CUDA build, add ``-DTAMM_ENABLE_CUDA=ON`` and ``-DGPU_ARCH=<value>``

::

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 ..

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/tamm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

Expand Down

0 comments on commit eb0a7f9

Please sign in to comment.