-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from uliegecsm/build-kokkos
ci: build kokkos tools with kokkos
- Loading branch information
Showing
10 changed files
with
199 additions
and
10 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build Kokkos alongside with Kokkos Tools for various configurations | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-kokkos: | ||
name: Build Kokkos Tools alongside Kokkos | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- image: ubuntu:22.04 | ||
preset: OpenMP | ||
- image: nvidia/cuda:12.1.0-devel-ubuntu22.04 | ||
preset: Cuda | ||
- image: rocm/dev-ubuntu-22.04:5.4 | ||
preset: ROCm | ||
container: | ||
image: ${{ matrix.image }} | ||
env: | ||
Kokkos_ROOT: /opt/kokkos | ||
steps: | ||
- name: Checkout Kokkos Tools | ||
uses: actions/checkout@v3 | ||
- name: Checkout Kokkos repository at latest develop | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kokkos/kokkos | ||
path: kokkos | ||
ref: develop | ||
- name: Install CMake, compilers, OpenMPI and dtrace | ||
run: | | ||
apt update | ||
apt --yes --no-install-recommends install \ | ||
cmake make \ | ||
gcc g++ \ | ||
libopenmpi-dev \ | ||
systemtap-sdt-dev | ||
- name: Compile and install Kokkos | ||
working-directory: kokkos | ||
run: | | ||
cp ${GITHUB_WORKSPACE}/kokkos.presets.json CMakePresets.json | ||
cmake -S . --preset=${{ matrix.preset }} | ||
cmake --build --preset=${{ matrix.preset }} | ||
cmake --install build-with-${{ matrix.preset }} --prefix=${Kokkos_ROOT} | ||
- name: Build Kokkos Tools, enabling examples | ||
run: | | ||
cmake -S . --preset=${{ matrix.preset }} | ||
cmake --build --preset=${{ matrix.preset }} | ||
cmake --install build-with-${{ matrix.preset }} --prefix=/opt/kokkos-tools | ||
# For now, GitHub runners are used. These runner don't have GPUs. Therefore, testing can only be done for OpenMP. | ||
- name: Run tests | ||
if: ${{ matrix.preset == 'OpenMP' }} | ||
run: | | ||
ctest --preset=${{ matrix.preset }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ jobs: | |
name: Formatting Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Run clang-format style check for C/C++/Protobuf programs. | ||
uses: jidicula/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"version" : 3, | ||
"configurePresets" : [ | ||
{ | ||
"name" : "default", | ||
"binaryDir" : "${sourceDir}/build-with-${presetName}", | ||
"cacheVariables" : { | ||
"CMAKE_BUILD_TYPE" : "Release", | ||
"CMAKE_CXX_STANDARD" : "17", | ||
"KokkosTools_ENABLE_EXAMPLES" : "ON", | ||
"KokkosTools_ENABLE_SINGLE" : "ON", | ||
"KokkosTools_ENABLE_MPI" : "ON" | ||
} | ||
}, | ||
{ | ||
"name" : "OpenMP", | ||
"inherits" : "default" | ||
}, | ||
{ | ||
"name" : "Cuda", | ||
"inherits" : "default", | ||
"cacheVariables" : { | ||
"CMAKE_CXX_COMPILER" : "$env{Kokkos_ROOT}/bin/nvcc_wrapper" | ||
} | ||
}, | ||
{ | ||
"name" : "ROCm", | ||
"inherits" : "default", | ||
"environment" : { | ||
"ROCM_PATH" : "/opt/rocm" | ||
}, | ||
"cacheVariables" : { | ||
"CMAKE_CXX_COMPILER" : "hipcc" | ||
} | ||
} | ||
], | ||
"buildPresets" : [ | ||
{ | ||
"name" : "OpenMP", | ||
"configurePreset" : "OpenMP", | ||
"inheritConfigureEnvironment" : true | ||
}, | ||
{ | ||
"name" : "Cuda", | ||
"configurePreset" : "Cuda", | ||
"inheritConfigureEnvironment" : true | ||
}, | ||
{ | ||
"name" : "ROCm", | ||
"configurePreset" : "ROCm", | ||
"inheritConfigureEnvironment" : true | ||
} | ||
], | ||
"testPresets" : [ | ||
{ | ||
"name" : "default", | ||
"configurePreset" : "default", | ||
"inheritConfigureEnvironment" : true, | ||
"output" : {"outputOnFailure": true}, | ||
"execution" : {"noTestsAction": "error", "stopOnFailure": false} | ||
}, | ||
{ | ||
"name" : "OpenMP", | ||
"configurePreset" : "OpenMP", | ||
"inherits" : "default" | ||
}, | ||
{ | ||
"name" : "Cuda", | ||
"configurePreset" : "Cuda", | ||
"inherits" : "default" | ||
}, | ||
{ | ||
"name" : "ROCm", | ||
"configurePreset" : "ROCm", | ||
"inherits" : "default" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"version" : 3, | ||
"configurePresets" : [ | ||
{ | ||
"name" : "default", | ||
"binaryDir" : "${sourceDir}/build-with-${presetName}", | ||
"cacheVariables" : { | ||
"CMAKE_BUILD_TYPE" : "Release", | ||
"CMAKE_CXX_STANDARD" : "17", | ||
"CMAKE_CXX_EXTENSIONS" : "OFF", | ||
"BUILD_SHARED_LIBS" : "ON" | ||
} | ||
}, | ||
{ | ||
"name" : "OpenMP", | ||
"inherits" : "default", | ||
"cacheVariables" : { | ||
"Kokkos_ENABLE_OPENMP" : "ON" | ||
} | ||
}, | ||
{ | ||
"name" : "Cuda", | ||
"inherits" : "default", | ||
"cacheVariables" : { | ||
"Kokkos_ENABLE_CUDA" : "ON", | ||
"Kokkos_ARCH_VOLTA70" : "ON", | ||
"CMAKE_CXX_COMPILER" : "${sourceDir}/bin/nvcc_wrapper" | ||
} | ||
}, | ||
{ | ||
"name" : "ROCm", | ||
"inherits" : "default", | ||
"cacheVariables" : { | ||
"Kokkos_ENABLE_HIP" : "ON", | ||
"Kokkos_ARCH_VEGA906" : "ON", | ||
"CMAKE_CXX_COMPILER" : "hipcc" | ||
} | ||
} | ||
], | ||
"buildPresets" : [ | ||
{ | ||
"name" : "OpenMP", | ||
"configurePreset" : "OpenMP" | ||
}, | ||
{ | ||
"name" : "Cuda", | ||
"configurePreset" : "Cuda" | ||
}, | ||
{ | ||
"name" : "ROCm", | ||
"configurePreset" : "ROCm" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
kp_add_library(kp_chrome_tracing kp_chrome_tracing.cpp) | ||
|
||
if(USE_MPI) | ||
if(KokkosTools_ENABLE_MPI) | ||
target_link_libraries(kp_chrome_tracing PRIVATE MPI::MPI_CXX) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
find_library(ROCM_ROCTX_LIB roctx64 HINTS $ENV{ROCM_PATH}/lib) | ||
find_path(ROCM_ROCTX_INCLUDE roctx.h HINTS $ENV{ROCM_PATH}/include/roctracer) | ||
find_library(ROCM_ROCTX_LIB roctx64 REQUIRED HINTS $ENV{ROCM_PATH}/lib) | ||
find_path(ROCM_ROCTX_INCLUDE roctx.h REQUIRED HINTS $ENV{ROCM_PATH}/include/roctracer) | ||
|
||
kp_add_library(kp_roctx_connector kp_roctx_connector.cpp) | ||
|
||
target_include_directories(kp_roctx_connector PRIVATE ${ROCM_ROCTX_INCLUDE}) | ||
target_link_libraries(kp_roctx_connector ${ROCM_ROCTX_LIB}) | ||
target_link_libraries(kp_roctx_connector PRIVATE ${ROCM_ROCTX_LIB}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
kp_add_library(kp_space_time_stack kp_space_time_stack.cpp) | ||
|
||
if(USE_MPI) | ||
if(KokkosTools_ENABLE_MPI) | ||
target_link_libraries(kp_space_time_stack PRIVATE MPI::MPI_CXX) | ||
endif() | ||
endif() |