Skip to content

Commit

Permalink
Merge branch 'kokkos:develop' into Contributingmd
Browse files Browse the repository at this point in the history
  • Loading branch information
vlkale authored Oct 27, 2023
2 parents cb9afb8 + 2ddedef commit ca9b2a1
Show file tree
Hide file tree
Showing 118 changed files with 236,365 additions and 4,196 deletions.
5 changes: 5 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BasedOnStyle: google
SortIncludes: false
AlignConsecutiveAssignments: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
15 changes: 15 additions & 0 deletions .github/workflows/build-standalone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Simple build without Kokkos
on: [push, pull_request]
jobs:
simple-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure using CMake and compile.
run : |
# The Kokkos Tools systemtap connector requires 'dtrace'
sudo apt update
sudo apt --yes --no-install-recommends install systemtap-sdt-dev
cmake -B build -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror"
cmake --build build
cmake --install build --prefix ${PWD}/install
96 changes: 96 additions & 0 deletions .github/workflows/build-with-kokkos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
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
compiler: default
- image: nvidia/cuda:12.1.0-devel-ubuntu22.04
preset: Cuda
compiler: default
- image: nvidia/cuda:12.2.0-devel-ubuntu22.04
preset: Cuda
compiler: {cpp: g++-12, c: gcc-12}
- image: rocm/dev-ubuntu-22.04:5.4
preset: ROCm
compiler: default
- image: rocm/dev-ubuntu-22.04:5.7
preset: ROCm
compiler: default
container:
image: ${{ matrix.image }}
env:
Kokkos_ROOT: /opt/kokkos
steps:
- name: Checkout Kokkos Tools
uses: actions/checkout@v4
- name: Checkout Kokkos repository at latest develop
uses: actions/checkout@v4
with:
repository: kokkos/kokkos
path: kokkos
ref: develop
- name: Install compilers
run : |
apt update
if [ ${{ matrix.compiler }} != 'default' ];then
apt --yes --no-install-recommends install ${{ matrix.compiler.c }} ${{ matrix.compiler.cpp }}
export CC=${{ matrix.compiler.c }}
export CXX=${{ matrix.compiler.cpp }}
else
apt --yes --no-install-recommends install gcc g++
export CC=gcc
export CXX=g++
fi
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
case ${{ matrix.preset }} in
*OpenMP* )
echo "Preset is OpenMP, nothing to do."
;;
*Cuda* )
echo "Preset is Cuda. Setting 'NVCC_WRAPPER_DEFAULT_COMPILER' to '$CXX'."
echo "NVCC_WRAPPER_DEFAULT_COMPILER=$CXX" >> $GITHUB_ENV
;;
*ROCm* )
echo "Preset is ROCm, nothing to do."
;;
* )
echo "Unsupported preset '${{ matrix.preset }}'."
exit -1
esac
- name: Install CMake, OpenMPI and dtrace
run: |
apt --yes --no-install-recommends install \
cmake make \
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 }}
13 changes: 13 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Clang-Format Check
on: [push, pull_request]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '8'
check-path: './'
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "tpls/Caliper"]
path = tpls/Caliper
url = https://github.com/NexGenAnalytics/Caliper.git
branch = feature/make-multitool-safe # Until Caliper gets full support for Kokkos EventSet
[submodule "tpls/apex"]
path = tpls/apex
url = https://github.com/UO-OACISS/apex.git
branch = develop
22 changes: 22 additions & 0 deletions Build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# How to Build

# With Cmake

1. Create your build directory and go to it

2. Type `ccmake ..` and change any options, including tools you want turned on (some are by default off). (Optional)

3. Type `cmake ..`

4. Type `make`

5. Specify the generated .dylib file in the environment variable KOKKOS_TOOLS_LIBRARY when running your Kokkos-based application.


# With Makefile (recommended)

1. Go into the directory of the particular tool, e.g., `cd debugging/kernel_logger`

2. Type `make`

3. Specify the generated .so file in the environment variable KOKKOS_TOOLS_LIBRARY when running your Kokkos-based application.
Loading

0 comments on commit ca9b2a1

Please sign in to comment.