Skip to content

Commit e26bbe2

Browse files
authored
CI: Enable NVCC (#4)
* CI: Enable NVCC * CMake CUDA: Fix Copy-Paste Errors * CMake: CMP0105 Not yet implemented in AMReX' CMake logic.
1 parent 36ab9a2 commit e26bbe2

File tree

4 files changed

+35
-31
lines changed

4 files changed

+35
-31
lines changed

.github/workflows/linux.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,33 @@ jobs:
5151
-DAMReX_MPI=OFF
5252
cmake --build build -j 2
5353
54-
# TODO: target_compile_features no known features for CUDA compiler "" version .
55-
# nvcc11:
56-
57-
# runs-on: ubuntu-20.04
58-
# env: {CXXFLAGS: "-fno-operator-names"}
59-
# steps:
60-
# - uses: actions/checkout@v2
61-
# - name: Dependencies
62-
# run: .github/workflows/dependencies/dependencies_nvcc11.sh
63-
# - name: Build & Install
64-
# run: |
65-
# export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
66-
# export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
67-
# which nvcc || echo "nvcc not in PATH!"
68-
#
69-
# export CC=$(which gcc)
70-
# export CXX=$(which g++)
71-
# export CUDAHOSTCXX=$(which g++)
72-
#
73-
# cmake -S . -B build \
74-
# -DCMAKE_VERBOSE_MAKEFILE=ON \
75-
# -DAMReX_GPU_BACKEND=CUDA \
76-
# -DCMAKE_CUDA_STANDARD=17 \
77-
# -DCMAKE_CXX_STANDARD=17 \
78-
# -DAMReX_CUDA_ARCH=8.0 \
79-
# -DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON \
80-
# -DAMReX_CUDA_ERROR_CAPTURE_THIS=ON
81-
# cmake --build build -j 2
54+
nvcc11:
55+
56+
runs-on: ubuntu-20.04
57+
env: {CXXFLAGS: "-fno-operator-names"}
58+
steps:
59+
- uses: actions/checkout@v2
60+
- name: Dependencies
61+
run: .github/workflows/dependencies/dependencies_nvcc11.sh
62+
- name: Build & Install
63+
run: |
64+
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
65+
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
66+
which nvcc || echo "nvcc not in PATH!"
67+
68+
export CC=$(which gcc)
69+
export CXX=$(which g++)
70+
export CUDAHOSTCXX=$(which g++)
71+
72+
cmake -S . -B build \
73+
-DCMAKE_VERBOSE_MAKEFILE=ON \
74+
-DAMReX_GPU_BACKEND=CUDA \
75+
-DCMAKE_CUDA_STANDARD=17 \
76+
-DCMAKE_CXX_STANDARD=17 \
77+
-DAMReX_CUDA_ARCH=8.0 \
78+
-DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON \
79+
-DAMReX_CUDA_ERROR_CAPTURE_THIS=ON
80+
cmake --build build -j 2
8281
8382
# TODO: in pybind11
8483
# multiple definition of `scalblnl`, `sinhl', `tanhl`, `tanl`, ...

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ endif()
2121
if(POLICY CMP0104)
2222
cmake_policy(SET CMP0104 OLD)
2323
endif()
24+
# device link step not yet fully implemented in AMReX logic
25+
# https://cmake.org/cmake/help/latest/policy/CMP0105.html
26+
if(POLICY CMP0105)
27+
cmake_policy(SET CMP0105 OLD)
28+
endif()
2429

2530

2631
# CCache Support ##############################################################

cmake/dependencies/AMReX.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ macro(find_amrex)
3030

3131
if(pyAMReX_amrex_src)
3232
list(APPEND CMAKE_MODULE_PATH "${pyAMReX_amrex_src}/Tools/CMake")
33-
if(pyAMReX_COMPUTE STREQUAL CUDA)
33+
if(AMReX_GPU_BACKEND STREQUAL CUDA)
3434
enable_language(CUDA)
3535
include(AMReX_SetupCUDA)
3636
endif()
@@ -46,7 +46,7 @@ macro(find_amrex)
4646
if(NOT fetchedamrex_POPULATED)
4747
FetchContent_Populate(fetchedamrex)
4848
list(APPEND CMAKE_MODULE_PATH "${fetchedamrex_SOURCE_DIR}/Tools/CMake")
49-
if(pyAMReX_COMPUTE STREQUAL CUDA)
49+
if(AMReX_GPU_BACKEND STREQUAL CUDA)
5050
enable_language(CUDA)
5151
include(AMReX_SetupCUDA)
5252
endif()

cmake/pyAMReXFunctions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ macro(set_ccache)
44
find_program(CCACHE_PROGRAM ccache)
55
if(CCACHE_PROGRAM)
66
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
7-
if(pyAMReX_COMPUTE STREQUAL CUDA)
7+
if(AMReX_GPU_BACKEND STREQUAL CUDA)
88
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
99
endif()
1010
endif()

0 commit comments

Comments
 (0)