Skip to content

Commit

Permalink
Synchronize DDC
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBourne committed Jan 22, 2024
1 parent 625708f commit 277253a
Show file tree
Hide file tree
Showing 30 changed files with 251 additions and 217 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cmake_tests_Release_GPU:
before_script: |
. /data/gyselarunner/spack-0.20.0/share/spack/setup-env.sh
spack load gcc@11
spack env activate voicexx-env-omp-cuda
spack env activate gyselalibxx-env-omp-cuda
script: |
set -x
export OMP_PROC_BIND=spread
Expand Down
2 changes: 1 addition & 1 deletion docker/gyselalibxx_env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN chmod +x /bin/bash_run \
pdiplugin-set-value \
python3-pip \
libpdi-dev \
&& git clone -b v1.6.0 https://github.com/ginkgo-project/ginkgo.git \
&& git clone -b v1.7.0 https://github.com/ginkgo-project/ginkgo.git \
&& cd ginkgo \
&& cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
&& cmake --build build \
Expand Down
2 changes: 1 addition & 1 deletion vendor/ddc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ endif()

if("${BUILD_SPLINES_KERNEL}")
# Ginkgo
find_package(Ginkgo 1.6.0 EXACT REQUIRED)
find_package(Ginkgo 1.7.0 EXACT REQUIRED)
target_link_libraries(DDC INTERFACE Ginkgo::ginkgo)
target_compile_definitions(DDC INTERFACE ginkgo_AVAIL)
endif()
Expand Down
2 changes: 1 addition & 1 deletion vendor/ddc/docker/doxygen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN chmod +x /bin/bash_run \
git \
graphviz \
texlive \
&& git clone -b v1.6.0 https://github.com/ginkgo-project/ginkgo.git \
&& git clone -b v1.7.0 https://github.com/ginkgo-project/ginkgo.git \
&& cd ginkgo \
&& cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_BUILD_OMP=OFF -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \
&& cmake --build build \
Expand Down
2 changes: 1 addition & 1 deletion vendor/ddc/docker/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ RUN chmod +x /bin/bash_run \
apt-get install -y --no-install-recommends \
rocm-hip-sdk \
;; esac \
&& git clone -b v1.6.0 https://github.com/ginkgo-project/ginkgo.git \
&& git clone -b v1.7.0 https://github.com/ginkgo-project/ginkgo.git \
&& cd ginkgo \
&& case "${BACKEND}" in \
"cpu") \
Expand Down
2 changes: 1 addition & 1 deletion vendor/ddc/docker/oldest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN chmod +x /bin/bash_run \
apt-get install -y --no-install-recommends \
rocm-hip-sdk \
;; esac \
&& git clone -b v1.6.0 https://github.com/ginkgo-project/ginkgo.git \
&& git clone -b v1.7.0 https://github.com/ginkgo-project/ginkgo.git \
&& cd ginkgo \
&& case "${BACKEND}" in \
"cpu") \
Expand Down
6 changes: 6 additions & 0 deletions vendor/ddc/include/ddc/discrete_space.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ KOKKOS_FORCEINLINE_FUNCTION detail::ddim_impl_t<DDim, MemorySpace> const& discre
}
}

template <class DDim>
bool is_discrete_space_initialized() noexcept
{
return detail::g_discrete_space_dual<DDim>.has_value();
}

template <class DDim>
detail::ddim_impl_t<DDim, Kokkos::HostSpace> const& host_discrete_space()
{
Expand Down
4 changes: 0 additions & 4 deletions vendor/ddc/include/ddc/kernels/fft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ void core(
fftw_execute(plan);
fftw_destroy_plan(plan);
}
// std::cout << "performed with fftw";
}
#endif
#if fftw_omp_AVAIL
Expand Down Expand Up @@ -427,7 +426,6 @@ void core(
fftw_execute(plan);
fftw_destroy_plan(plan);
}
// std::cout << "performed with fftw_omp";
}
#endif
#if cufft_AVAIL
Expand Down Expand Up @@ -467,7 +465,6 @@ void core(
reinterpret_cast<typename _cufft_type<Tout>::type*>(out_data));
if (cufft_rt != CUFFT_SUCCESS)
throw std::runtime_error("cufftExec failed");
// std::cout << "performed with cufft";
}
#endif
#if hipfft_AVAIL
Expand Down Expand Up @@ -507,7 +504,6 @@ void core(
reinterpret_cast<typename _hipfft_type<Tout>::type*>(out_data));
if (hipfft_rt != HIPFFT_SUCCESS)
throw std::runtime_error("hipfftExec failed");
// std::cout << "performed with hipfft";
}
#endif

Expand Down
6 changes: 2 additions & 4 deletions vendor/ddc/include/ddc/misc/ginkgo_executors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ inline std::shared_ptr<gko::Executor> create_gko_exec()
return gko::CudaExecutor::
create(exec_space.cuda_device(),
create_default_host_executor(),
false,
gko::default_cuda_alloc_mode,
std::make_shared<gko::CudaAllocator>(),
exec_space.cuda_stream());
}
#endif
Expand All @@ -49,8 +48,7 @@ inline std::shared_ptr<gko::Executor> create_gko_exec()
return gko::HipExecutor::
create(exec_space.hip_device(),
create_default_host_executor(),
false,
gko::default_hip_alloc_mode,
std::make_shared<gko::HipAllocator>(),
exec_space.hip_stream());
}
#endif
Expand Down
1 change: 1 addition & 0 deletions vendor/ddc/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ add_executable(ddc_tests
fill.cpp
discrete_element.cpp
discrete_vector.cpp
discrete_space.cpp
)
target_compile_features(ddc_tests PUBLIC cxx_std_17)
target_link_libraries(ddc_tests
Expand Down
14 changes: 10 additions & 4 deletions vendor/ddc/tests/aligned_allocator.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: MIT

#include <cstddef>
#include <memory>
#include <type_traits>
#include <utility>

#include <ddc/ddc.hpp>

#include <gtest/gtest.h>
Expand Down Expand Up @@ -73,16 +79,16 @@ TEST(AlignedAllocatorTest, RebindMoveAssignment)

TEST(AlignedAllocatorTest, Comparison)
{
constexpr A a1;
constexpr A a2;
A const a1;
A const a2;
EXPECT_TRUE(a1 == a2);
EXPECT_FALSE((a1 != a2));
}

TEST(AlignedAllocatorTest, RebindComparison)
{
constexpr B b;
constexpr A a(b);
B const b;
A const a(b);
EXPECT_EQ(b, B(a));
EXPECT_EQ(a, A(b));
}
Expand Down
Loading

0 comments on commit 277253a

Please sign in to comment.