Skip to content

Commit

Permalink
ci: add baseline builds
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs committed Dec 13, 2023
1 parent 457afc9 commit 2f2dc3e
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 6 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci-baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: ci-baseline

on:
pull_request:
types: [ opened, reopened, synchronize ]
push:
branches:
- 'main'

concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
CI:
name: baseline
continue-on-error: false
strategy:
fail-fast: false
matrix:
image:
- amd64-ubuntu-22.04-clang-14-clang-14-cpp
- amd64-ubuntu-20.04-gcc-9-11.2.0-cpp
build_type:
- Release
- Debug

runs-on: ubuntu-latest
container:
image: lifflander1/vt:${{ matrix.image }}
# env:

steps:
- uses: actions/checkout@v4

- name: Checkout vt
uses: actions/checkout@v4
with:
repository: DARMA-tasking/vt
path: vt

- name: Checkout magistrate
uses: actions/checkout@v4
with:
repository: DARMA-tasking/magistrate
path: vt/lib/checkpoint

- name: Checkout kokkos
uses: actions/checkout@v4
with:
repository: kokkos/kokkos
path: kokkos
ref: develop

- name: Configure vt
working-directory: vt
run: |
cmake -B builddir \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DVT_BUILD_EXAMPLES=OFF \
-DVT_BUILD_TESTS=OFF \
-Dvt_trace_enabled=ON
- name: Build vt
working-directory: vt
run: |
cmake --build builddir --target install
- name: Configure kokkos
working-directory: kokkos
run: |
cmake -B builddir \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build kokkos
working-directory: kokkos
run: |
cmake --build builddir --target install
- name: Configure distBVH
run: |
cmake -B builddir \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build distBVH
run: |
cmake --build builddir --target install
- name: Run tests
working-directory: builddir
run: |
ctest --output-on-failure
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Building is done via CMake (version 3.15 required). Detailed instructions can be
BVH requires a compiler that supports C++17. This includes at least clang 5 or gcc version 7.0.

BVH uses [DARMA/vt](https://github.com/DARMA-tasking/vt) for asynchronous tasking. For more information about DARMA/vt
please consult the [documentation](https://darma-tasking.github.io/docs/html/index.html).
please consult the [documentation](https://darma-tasking.github.io/docs/html/index.html).
BVH requires [Kokkos](https://github.com/kokkos/kokkos) version `4.0` or later.

VTK can also be used for visualizing the the tree data structure.

Expand Down
19 changes: 19 additions & 0 deletions docs/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ that are summarized here:

- :ref:`vt_DIR <cmake-vt-dir>`
- :ref:`vt_ROOT <cmake-vt-root>`
- :ref:`Kokkos_DIR <cmake-kokkos-dir>`
- :ref:`Kokkos_ROOT <cmake-kokkos-root>`
- :ref:`BVH_VT_INSERTABLE_COLLECTIONS <cmake-bvh-vt-insertable-collections>`
- :ref:`VTK_ROOT <cmake-vtk-root>`
- :ref:`BVH_DEBUG_LEVEL <cmake-bvh-debug-level>`
Expand Down Expand Up @@ -67,6 +69,23 @@ BVH can optionally use insertable collections. Use the following to turn off ins
-DBVH_VT_INSERTABLE_COLLECTIONS=OFF
Locating Kokkos
-----------------

BVH is dependent on `Kokkos`_.

.. _cmake-kokkos-dir:

.. code-block:: sh
-DKokkos_DIR=path/to/kokkos/install/cmake
.. _cmake-kokkos-root:

.. code-block:: sh
-DKokkos_ROOT=path/to/kokkos/install
Building with VTK
-----------------

Expand Down
1 change: 1 addition & 0 deletions src/bvh/math/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ namespace bvh

#ifdef __CUDA_ARCH__
constexpr double epsilon = DBL_EPSILON;
constexpr double epsilonf = FLT_EPSILON;
#else
constexpr double epsilon = std::numeric_limits< double >::epsilon();
constexpr double epsilonf = std::numeric_limits< float >::epsilon();
Expand Down
20 changes: 15 additions & 5 deletions src/bvh/util/bits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
#include <cstdint>
#include <type_traits>

#if !defined(KOKKOS_COMPILER_NVCC)
#include <immintrin.h>
#endif

namespace bvh
{
Expand Down Expand Up @@ -75,7 +77,7 @@ namespace bvh
#error "unsupported compiler for find first set"
#endif
}

inline std::uint64_t ffs( std::uint64_t _val )
{
#ifdef __GNUC__
Expand All @@ -84,17 +86,25 @@ namespace bvh
#error "unsupported compiler for find first set"
#endif
}

inline std::uint32_t clz( std::uint32_t _val )
{
#if !defined(KOKKOS_COMPILER_NVCC)
return _lzcnt_u32( _val );
#else
return 0u;
#endif
}

inline std::uint64_t clz( std::uint64_t _val )
{
#if !defined(KOKKOS_COMPILER_NVCC)
return _lzcnt_u64( _val );
#else
return 0u;
#endif
}

inline int bsr( unsigned long _val )
{
#ifdef __GNUC__
Expand All @@ -109,7 +119,7 @@ namespace bvh
{
return bsr( _val );
}

inline bool is_pow2( unsigned _val )
{
return _val & ( _val - 1 );
Expand Down

0 comments on commit 2f2dc3e

Please sign in to comment.