Skip to content

Commit

Permalink
Rebase on KokkosFFT
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau committed Sep 24, 2024
1 parent 371ffb8 commit 712386a
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 949 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ jobs:
export benchmark_ROOT=$PWD/opt/benchmark
export GTest_ROOT=$PWD/opt/gtest
export Kokkos_ROOT=$PWD/opt/kokkos
export KokkosFFT_ROOT=$PWD/opt/kokkos-fft
export KokkosKernels_ROOT=$PWD/opt/kokkos-kernels
export mdspan_ROOT=$PWD/opt/mdspan
Expand Down Expand Up @@ -197,6 +198,16 @@ jobs:
cmake --install build --prefix $Kokkos_ROOT
rm -rf build
cmake \
-DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON \
-B build \
-S /src/vendor/kokkos-fft
cmake --build build --parallel 2
cmake --install build --prefix $KokkosFFT_ROOT
rm -rf build
cmake \
-DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
Expand Down Expand Up @@ -234,6 +245,7 @@ jobs:
-DDDC_benchmark_DEPENDENCY_POLICY=INSTALLED \
-DDDC_GTest_DEPENDENCY_POLICY=INSTALLED \
-DDDC_Kokkos_DEPENDENCY_POLICY=INSTALLED \
-DDDC_KokkosFFT_DEPENDENCY_POLICY=INSTALLED \
-DDDC_mdspan_DEPENDENCY_POLICY=INSTALLED \
-B build \
-S /src
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
[submodule "vendor/doxygen-awesome-css"]
path = vendor/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "vendor/kokkos-fft"]
path = vendor/kokkos-fft
url = https://github.com/kokkos/kokkos-fft.git
55 changes: 19 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,6 @@ endif()
# Custom cmake modules
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )

# FFTW
if("${DDC_BUILD_KERNELS_FFT}" AND NOT FFTW_FOUND)
find_package( FFTW MODULE REQUIRED )
endif()

## CUDA + CUDAToolkit
if("${DDC_BUILD_KERNELS_FFT}" AND "${Kokkos_ENABLE_CUDA}")
find_package( CUDAToolkit MODULE REQUIRED )
if( NOT(CUDAToolkit_FOUND) )
message(FATAL_ERROR "CUDAToolkit not found." )
endif()
endif()


## PDI

Expand Down Expand Up @@ -196,30 +183,26 @@ install(

# Link library to DDC

if( FFTW_FOUND )
target_link_libraries( DDC INTERFACE FFTW::Float )
target_link_libraries( DDC INTERFACE FFTW::Double )
endif()

if( FFTW_FOUND AND "${Kokkos_ENABLE_SERIAL}")
target_compile_definitions(DDC INTERFACE fftw_serial_AVAIL)
endif()

if( FFTW_FOUND AND "${Kokkos_ENABLE_OPENMP}")
target_link_libraries( DDC INTERFACE FFTW::FloatOpenMP )
target_link_libraries( DDC INTERFACE FFTW::DoubleOpenMP )
target_compile_definitions(DDC INTERFACE fftw_omp_AVAIL)
endif()

if( CUDAToolkit_FOUND AND "${Kokkos_ENABLE_CUDA}")
target_link_libraries( DDC INTERFACE CUDA::cufft )
target_compile_definitions(DDC INTERFACE cufft_AVAIL)
endif()
if("${DDC_BUILD_KERNELS_FFT}")
# Kokkos-fft
set(DDC_KokkosFFT_DEPENDENCY_POLICY "AUTO" CACHE STRING "Policy to find the `Kokkos-fft` package. Options: ${DDC_DEPENDENCY_POLICIES}")
set_property(CACHE DDC_KokkosFFT_DEPENDENCY_POLICY PROPERTY STRINGS "${DDC_DEPENDENCY_POLICIES}")
if("${DDC_KokkosFFT_DEPENDENCY_POLICY}" STREQUAL "AUTO")
if(NOT TARGET KokkosFFT::fft)
find_package(KokkosFFT CONFIG QUIET)
if(NOT KokkosFFT_FOUND)
set(KokkosFFT_ENABLE_HOST_AND_DEVICE ON)
add_subdirectory(vendor/kokkos-fft)
endif()
endif()
elseif("${DDC_KokkosFFT_DEPENDENCY_POLICY}" STREQUAL "EMBEDDED")
set(KokkosFFT_ENABLE_HOST_AND_DEVICE ON)
add_subdirectory(vendor/kokkos-fft)
elseif("${DDC_KokkosFFT_DEPENDENCY_POLICY}" STREQUAL "INSTALLED")
find_package(KokkosFFT CONFIG REQUIRED)
endif()

if("${Kokkos_ENABLE_HIP}")
find_package( hipfft REQUIRED ) # Not compatible with nvidia
target_link_libraries( DDC INTERFACE hip::hipfft )
target_compile_definitions(DDC INTERFACE hipfft_AVAIL)
target_link_libraries(DDC INTERFACE KokkosFFT::fft)
endif()

if("${DDC_BUILD_KERNELS_SPLINES}")
Expand Down
11 changes: 0 additions & 11 deletions LICENSES/BSD-3-Clause.txt

This file was deleted.

Loading

0 comments on commit 712386a

Please sign in to comment.