Skip to content

Commit

Permalink
Little adjustments for the C++ std and cuda archs
Browse files Browse the repository at this point in the history
  • Loading branch information
ViNN280801 committed Nov 5, 2024
1 parent 9c28d9b commit 1d8b2e1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 145 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/fedora.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/rhl.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/ubuntu.yml

This file was deleted.

26 changes: 16 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ function(set_compiler_if_not_defined env_var cmake_var default_value
endfunction()

# ──► Setting compilers ◄──
set_compiler_if_not_defined(CC CMAKE_C_COMPILER "/usr/bin/gcc-13" "C compiler")
set_compiler_if_not_defined(CXX CMAKE_CXX_COMPILER "/usr/bin/g++-13"
set_compiler_if_not_defined(CC CMAKE_C_COMPILER "/usr/bin/gcc" "C compiler")
set_compiler_if_not_defined(CXX CMAKE_CXX_COMPILER "/usr/bin/g++"
"C++ compiler")

if(GPU_CUDA_ON)
set(CUDAHOSTCXX "/usr/bin/g++-13")
set(CUDAHOSTCXX "/usr/bin/g++")
message(STATUS "⚙️ Using ${CUDAHOSTCXX} as the CUDA host compiler.")
set(CMAKE_CUDA_HOST_COMPILER ${CUDAHOSTCXX})

Expand Down Expand Up @@ -206,15 +206,14 @@ if(GPU_CUDA_ON)

# Include CUDA as a language in the project only if GPU_CUDA_ON is enabled
set(CMAKE_CUDA_ARCHITECTURES "89")
set_property(GLOBAL PROPERTY CUDA_ARCHITECTURES ${CUDA_ARCHITECTURES})
set_property(GLOBAL PROPERTY CMAKE_CUDA_ARCHITECTURES
${CMAKE_CUDA_ARCHITECTURES})
message(
STATUS
"⚙️ CUDA support enabled with CUDA_ARCHITECTURES={${CUDA_ARCHITECTURES}}"
"⚙️ CUDA support enabled with CMAKE_CUDA_ARCHITECTURES={${CMAKE_CUDA_ARCHITECTURES}}"
)

set(CMAKE_CUDA_FLAGS
"${CMAKE_CUDA_FLAGS} --expt-extended-lambda -Xcompiler -mno-amx-bf16 -Xcompiler -mno-amx-int8 -Xcompiler -mno-amx-tile"
)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-extended-lambda")
message(STATUS "⚙️ Compiling with CUDA flags: [${CMAKE_CUDA_FLAGS}]")
# ############################################################################
# End of CUDA Setup #
Expand Down Expand Up @@ -552,11 +551,18 @@ if(VECTORIZATION_ON)
set(VECTORIZATION_FLAGS "-restrict" "-xHost" "-vecabi=cmdtarget"
"-qopt-zmm-usage=high")
set(INTEL_COMPILER_FLAGS "-flarge-source-files")

# Add Intel-specific flag to suppress warning 68: To supress warnings from
# CGAL like this:
# /usr/local/CGAL/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h(126):
# warning #68-D: integer conversion resulted in a change of sign
set(DIAG_SUPPRESS "-diag-suppress=68")

add_compile_options(${INTEL_COMPILER_FLAGS} ${VECTORIZATION_FLAGS}
${ANTI_ALIASING_FLAG})
${ANTI_ALIASING_FLAG} ${DIAG_SUPPRESS})
message(
STATUS
"⚙️ Intel-specific vectorization flags added: [${INTEL_COMPILER_FLAGS} ${VECTORIZATION_FLAGS} ${ANTI_ALIASING_FLAG}]"
"⚙️ Intel-specific vectorization flags added: [${INTEL_COMPILER_FLAGS} ${VECTORIZATION_FLAGS} ${ANTI_ALIASING_FLAG} ${DIAG_SUPPRESS}]"
)
endif()
message(STATUS "⚙️ Vector width set to: ${VECTOR_WIDTH}")
Expand Down
4 changes: 2 additions & 2 deletions Trilinos_compile_on_Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ make -j<n> install
cd .. && rm -rvf build/
mkdir -pv build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Trilinos \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpicxx \
-DKOKKOSKERNELS_ENABLE_TPL_CUSPARSE=ON \
Expand Down Expand Up @@ -90,7 +90,7 @@ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Trilinos \

Building without CUDA but with MPI:
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Trilinos \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpicxx \
-DTPL_ENABLE_MPI=ON \
Expand Down

0 comments on commit 1d8b2e1

Please sign in to comment.