Skip to content

Commit

Permalink
Merge branch 'main' into ci/update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pzehner authored Nov 4, 2024
2 parents e4372bd + bbd4ec6 commit c5e1f05
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 43 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/__build_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ jobs:
sudo apt-get install ./singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb
- name: Login in GitHub Containers Repository with Docker
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login in GitHub Containers Repository with Singularity
run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,22 +312,26 @@ jobs:
strategy:
matrix:
backend:
# run CUDA tests on Ruche supercomputer
# run CUDA tests on Ruche supercomputer with Singularity
- name: cuda
image: nvcc
runner: [self-hosted, cuda]
use_singularity: true
# run OpenMP tests on Azure server
- name: openmp
image: gcc
runner: ubuntu-latest
use_singularity: false
# run Threads tests on Azure server
- name: threads
image: gcc
runner: ubuntu-latest
use_singularity: false
# run Serial tests on Azure server
- name: serial
image: gcc
runner: ubuntu-latest
use_singularity: false

steps:
- name: Get artifacts
Expand All @@ -338,13 +342,28 @@ jobs:
- name: Deploy artifacts
run: tar -xvf tests_${{ matrix.backend.name }}.tar

- name: Login in GitHub Containers Repository with Singularity
run: |
run \
-m "singularity/3.8.3/gcc-11.2.0" \
"echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io"
if: ${{ matrix.backend.use_singularity }}

- name: Login in GitHub Containers Repository with Docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ ! matrix.backend.use_singularity }}

- name: Pull Singularity image
# pulling the image in advance seems necessary as sometimes invoking `singularity run` on the image URL fails because it cannot find ghcr.io
run: |
run \
-m "singularity/3.8.3/gcc-11.2.0" \
singularity pull oras://ghcr.io/kokkos/kokkos-fft/base_${{ matrix.backend.image }}_singularity_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }}
if: ${{ matrix.backend.name == 'cuda' }}
if: ${{ matrix.backend.use_singularity }}

- name: Run CUDA tests within Slurm job and Singularity image
run: |
Expand All @@ -353,10 +372,10 @@ jobs:
-m "singularity/3.8.3/gcc-11.2.0" \
singularity run --nv --bind $PWD/build:/work/build -H /work/build base_${{ matrix.backend.image }}_singularity_${{ needs.check_docker_files.outputs.image_suffix }}_${{ needs.check_docker_files.outputs.image_tag }}.sif \
ctest --output-on-failure
if: ${{ matrix.backend.name == 'cuda' }}
if: ${{ matrix.backend.use_singularity }}

- name: Run OpenMP/Threads/Serial tests within Docker image
run: |
docker run -v $PWD/build:/work/build -w /work/build ghcr.io/kokkos/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \
ctest --output-on-failure
if: ${{ matrix.backend.name == 'openmp' || matrix.backend.name == 'threads' || matrix.backend.name == 'serial' }}
if: ${{ ! matrix.backend.use_singularity }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception

#ifndef KOKKOSFFT_LAYOUTS_HPP
#define KOKKOSFFT_LAYOUTS_HPP
#ifndef KOKKOSFFT_EXTENTS_HPP
#define KOKKOSFFT_EXTENTS_HPP

#include <vector>
#include <tuple>
Expand All @@ -16,9 +16,20 @@

namespace KokkosFFT {
namespace Impl {
/* Input and output extents exposed to the fft library
i.e extents are converted into Layout Right
*/
/// \brief Compute input, output and fft extents required for FFT
/// libraries based on the input view, output view, axes and shape.
/// Extents are converted into Layout Right
///
/// \tparam InViewType The input view type
/// \tparam OutViewType The output view type
/// \tparam DIM The dimensionality of the axes
///
/// \param in [in] Input view
/// \param out [in] Output view
/// \param axes [in] Axes over which the FFT operations are performed.
/// \param shape [in] The new shape of the input view. If the shape is zero,
/// no modifications are made.
/// \param is_inplace [in] Whether the FFT is inplace or not
template <typename InViewType, typename OutViewType, std::size_t DIM = 1>
auto get_extents(const InViewType& in, const OutViewType& out,
axis_type<DIM> axes, shape_type<DIM> shape = {},
Expand Down
2 changes: 1 addition & 1 deletion common/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_executable(unit-tests-kokkos-fft-common
Test_Traits.cpp
Test_Normalization.cpp
Test_Transpose.cpp
Test_Layouts.cpp
Test_Extents.cpp
Test_Padding.cpp
Test_Helpers.cpp
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
#include <gtest/gtest.h>
#include <Kokkos_Random.hpp>
#include <vector>
#include "KokkosFFT_layouts.hpp"
#include "KokkosFFT_Extents.hpp"
#include "Test_Types.hpp"
#include "Test_Utils.hpp"

using test_types = ::testing::Types<Kokkos::LayoutLeft, Kokkos::LayoutRight>;

// Basically the same fixtures, used for labeling tests
template <typename T>
struct Layouts1D : public ::testing::Test {
struct Extents1D : public ::testing::Test {
using layout_type = T;
};

template <typename T>
struct Layouts2D : public ::testing::Test {
struct Extents2D : public ::testing::Test {
using layout_type = T;
};

TYPED_TEST_SUITE(Layouts1D, test_types);
TYPED_TEST_SUITE(Layouts2D, test_types);
TYPED_TEST_SUITE(Extents1D, test_types);
TYPED_TEST_SUITE(Extents2D, test_types);

// Tests for 1D FFT
template <typename LayoutType>
void test_layouts_1d() {
void test_extents_1d() {
const int n0 = 6;
using axes_type = KokkosFFT::axis_type<1>;
using RealView1Dtype = Kokkos::View<double*, LayoutType, execution_space>;
Expand Down Expand Up @@ -90,7 +90,7 @@ void test_layouts_1d() {
}

template <typename LayoutType>
void test_layouts_1d_batched_FFT_2d() {
void test_extents_1d_batched_FFT_2d() {
const int n0 = 6, n1 = 10;
using axes_type = KokkosFFT::axis_type<1>;
using RealView2Dtype = Kokkos::View<double**, LayoutType, execution_space>;
Expand Down Expand Up @@ -179,7 +179,7 @@ void test_layouts_1d_batched_FFT_2d() {
}

template <typename LayoutType>
void test_layouts_1d_batched_FFT_3d() {
void test_extents_1d_batched_FFT_3d() {
const int n0 = 6, n1 = 10, n2 = 8;
using axes_type = KokkosFFT::axis_type<1>;
using RealView3Dtype = Kokkos::View<double***, LayoutType, execution_space>;
Expand Down Expand Up @@ -308,27 +308,27 @@ void test_layouts_1d_batched_FFT_3d() {
EXPECT_EQ(howmany_c2c_axis2, ref_howmany_r2c_axis2);
}

TYPED_TEST(Layouts1D, 1DFFT_1DView) {
TYPED_TEST(Extents1D, 1DFFT_1DView) {
using layout_type = typename TestFixture::layout_type;

test_layouts_1d<layout_type>();
test_extents_1d<layout_type>();
}

TYPED_TEST(Layouts1D, 1DFFT_batched_2DView) {
TYPED_TEST(Extents1D, 1DFFT_batched_2DView) {
using layout_type = typename TestFixture::layout_type;

test_layouts_1d_batched_FFT_2d<layout_type>();
test_extents_1d_batched_FFT_2d<layout_type>();
}

TYPED_TEST(Layouts1D, 1DFFT_batched_3DView) {
TYPED_TEST(Extents1D, 1DFFT_batched_3DView) {
using layout_type = typename TestFixture::layout_type;

test_layouts_1d_batched_FFT_3d<layout_type>();
test_extents_1d_batched_FFT_3d<layout_type>();
}

// Tests for 2D FFT
template <typename LayoutType>
void test_layouts_2d() {
void test_extents_2d() {
const int n0 = 6, n1 = 10;
using axes_type = KokkosFFT::axis_type<2>;
using RealView2Dtype = Kokkos::View<double**, LayoutType, execution_space>;
Expand Down Expand Up @@ -432,7 +432,7 @@ void test_layouts_2d() {
}

template <typename LayoutType>
void test_layouts_2d_batched_FFT_3d() {
void test_extents_2d_batched_FFT_3d() {
const int n0 = 6, n1 = 10, n2 = 8;
using axes_type = KokkosFFT::axis_type<2>;
using RealView3Dtype = Kokkos::View<double***, LayoutType, execution_space>;
Expand Down Expand Up @@ -711,14 +711,14 @@ void test_layouts_2d_batched_FFT_3d() {
EXPECT_EQ(howmany_c2c_axis_21, ref_howmany_r2c_axis_21);
}

TYPED_TEST(Layouts2D, 2DFFT_2DView) {
TYPED_TEST(Extents2D, 2DFFT_2DView) {
using layout_type = typename TestFixture::layout_type;

test_layouts_2d<layout_type>();
test_extents_2d<layout_type>();
}

TYPED_TEST(Layouts2D, 2DFFT_3DView) {
TYPED_TEST(Extents2D, 2DFFT_3DView) {
using layout_type = typename TestFixture::layout_type;

test_layouts_2d_batched_FFT_3d<layout_type>();
test_extents_2d_batched_FFT_3d<layout_type>();
}
2 changes: 1 addition & 1 deletion examples/01_1DFFT/01_1DFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using View1D = Kokkos::View<T*, execution_space>;
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128;
const int n0 = 128;
const Kokkos::complex<double> z(1.0, 1.0);

// 1D C2C FFT (Forward and Backward)
Expand Down
2 changes: 1 addition & 1 deletion examples/02_2DFFT/02_2DFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using View2D = Kokkos::View<T**, execution_space>;
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128, n1 = 128;
const int n0 = 128, n1 = 128;
const Kokkos::complex<double> z(1.0, 1.0);

// 2D C2C FFT (Forward and Backward)
Expand Down
2 changes: 1 addition & 1 deletion examples/03_NDFFT/03_NDFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using axis_type = KokkosFFT::axis_type<DIM>;
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128, n1 = 128, n2 = 16;
const int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> z(1.0, 1.0);

// 3D C2C FFT (Forward and Backward)
Expand Down
2 changes: 1 addition & 1 deletion examples/04_batchedFFT/04_batchedFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using View3D = Kokkos::View<T***, execution_space>;
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128, n1 = 128, n2 = 16;
const int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> z(1.0, 1.0);

// 1D batched C2C FFT (Forward and Backward)
Expand Down
2 changes: 1 addition & 1 deletion examples/05_1DFFT_HOST_DEVICE/05_1DFFT_HOST_DEVICE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using HostView1D = Kokkos::View<T*, host_execution_space>;
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128;
const int n0 = 128;
const Kokkos::complex<double> z(1.0, 1.0);

// 1D C2C FFT (Forward and Backward)
Expand Down
2 changes: 1 addition & 1 deletion examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using View1D = Kokkos::View<T*, execution_space>;
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128;
const int n0 = 128;
const Kokkos::complex<double> z(1.0, 1.0);

// 1D C2C FFT (Forward and Backward)
Expand Down
2 changes: 1 addition & 1 deletion examples/07_unmanaged_views/07_unmanaged_views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using shape_type = KokkosFFT::shape_type<DIM>;
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128, n1 = 128, n2 = 16;
const int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> z(1.0, 1.0);

shape_type<3> shape;
Expand Down
2 changes: 1 addition & 1 deletion fft/src/KokkosFFT_Cuda_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <numeric>
#include "KokkosFFT_Cuda_types.hpp"
#include "KokkosFFT_layouts.hpp"
#include "KokkosFFT_Extents.hpp"
#include "KokkosFFT_traits.hpp"
#include "KokkosFFT_asserts.hpp"

Expand Down
2 changes: 1 addition & 1 deletion fft/src/KokkosFFT_HIP_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <numeric>
#include "KokkosFFT_HIP_types.hpp"
#include "KokkosFFT_layouts.hpp"
#include "KokkosFFT_Extents.hpp"
#include "KokkosFFT_traits.hpp"
#include "KokkosFFT_asserts.hpp"

Expand Down
2 changes: 1 addition & 1 deletion fft/src/KokkosFFT_Host_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <numeric>
#include "KokkosFFT_default_types.hpp"
#include "KokkosFFT_layouts.hpp"
#include "KokkosFFT_Extents.hpp"
#include "KokkosFFT_traits.hpp"

namespace KokkosFFT {
Expand Down
2 changes: 1 addition & 1 deletion fft/src/KokkosFFT_ROCM_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <numeric>
#include <algorithm>
#include "KokkosFFT_ROCM_types.hpp"
#include "KokkosFFT_layouts.hpp"
#include "KokkosFFT_Extents.hpp"
#include "KokkosFFT_traits.hpp"
#include "KokkosFFT_asserts.hpp"
#include "KokkosFFT_utils.hpp"
Expand Down
2 changes: 1 addition & 1 deletion fft/src/KokkosFFT_SYCL_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <numeric>
#include <algorithm>
#include "KokkosFFT_SYCL_types.hpp"
#include "KokkosFFT_layouts.hpp"
#include "KokkosFFT_Extents.hpp"
#include "KokkosFFT_traits.hpp"
#include "KokkosFFT_utils.hpp"

Expand Down

0 comments on commit c5e1f05

Please sign in to comment.