Skip to content

Commit

Permalink
Merge branch 'main' into mirroring
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau committed Nov 14, 2023
2 parents 016b161 + 50b2da3 commit 5f4c08c
Show file tree
Hide file tree
Showing 70 changed files with 6,458 additions and 432 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Identify repository
id: identify_repo
run: |
echo "in_base_repo=${{ (github.event_name == 'push' && github.repository == 'Maison-de-la-Simulation/ddc') || github.event.pull_request.head.repo.full_name == 'Maison-de-la-Simulation/ddc' }}" >> "$GITHUB_OUTPUT"
echo "in_base_repo=${{ (github.event_name == 'push' && github.repository == 'CExA-project/ddc') || github.event.pull_request.head.repo.full_name == 'CExA-project/ddc' }}" >> "$GITHUB_OUTPUT"
docker-build:
needs: id_repo
Expand All @@ -25,24 +25,24 @@ jobs:
- name: Build
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin || true
docker pull ghcr.io/maison-de-la-simulation/ddc/doxygen || true
docker pull ghcr.io/cexa-project/ddc/doxygen || true
docker build \
--cache-from ghcr.io/maison-de-la-simulation/ddc/doxygen \
-t ghcr.io/maison-de-la-simulation/ddc/doxygen \
-t ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} \
--cache-from ghcr.io/cexa-project/ddc/doxygen \
-t ghcr.io/cexa-project/ddc/doxygen \
-t ghcr.io/cexa-project/ddc/doxygen:${GITHUB_SHA:0:7} \
docker/doxygen
- name: Publish image for current SHA
if: needs.id_repo.outputs.in_base_repo == 'true'
run: |
docker push ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7}
docker push ghcr.io/cexa-project/ddc/doxygen:${GITHUB_SHA:0:7}
- name: Publish latest (default) image
if: github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo == 'true'
run: |
docker push ghcr.io/maison-de-la-simulation/ddc/doxygen
docker push ghcr.io/cexa-project/ddc/doxygen
- name: Create image tarball
if: needs.id_repo.outputs.in_base_repo == 'false'
run: |
docker save ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} > doxygen.tar
docker save ghcr.io/cexa-project/ddc/doxygen:${GITHUB_SHA:0:7} > doxygen.tar
- name: Generate docker artifact from image
if: needs.id_repo.outputs.in_base_repo == 'false'
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
EOF
mkdir docs_out
chmod a+rwx docs_out
docker run -v ${PWD}:/src ghcr.io/maison-de-la-simulation/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh
docker run -v ${PWD}:/src ghcr.io/cexa-project/ddc/doxygen:${GITHUB_SHA:0:7} bash /src/run.sh
- name: Publish site
if: ${{ github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo == 'true' }}
run: |
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Identify repository
id: identify_repo
run: |
echo "in_base_repo=${{ (github.event_name == 'push' && github.repository == 'Maison-de-la-Simulation/ddc') || github.event.pull_request.head.repo.full_name == 'Maison-de-la-Simulation/ddc' }}" >> "$GITHUB_OUTPUT"
echo "in_base_repo=${{ (github.event_name == 'push' && github.repository == 'CExA-project/ddc') || github.event.pull_request.head.repo.full_name == 'CExA-project/ddc' }}" >> "$GITHUB_OUTPUT"
outputs: { in_base_repo: '${{ steps.identify_repo.outputs.in_base_repo }}' }

docker-build:
Expand All @@ -43,25 +43,25 @@ jobs:
- name: Build
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin || true
docker pull ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}_${{matrix.backend}} || true
docker pull ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}} || true
docker build \
--build-arg BACKEND=${{matrix.backend}} \
--cache-from ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}_${{matrix.backend}} \
-t ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}_${{matrix.backend}} \
-t ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}_${{matrix.backend}}:${GITHUB_SHA:0:7} \
--cache-from ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}} \
-t ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}} \
-t ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}}:${GITHUB_SHA:0:7} \
docker/${{matrix.image}}
- name: Publish image for current SHA
if: needs.id_repo.outputs.in_base_repo == 'true'
run: |
docker push ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}_${{matrix.backend}}:${GITHUB_SHA:0:7}
docker push ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}}:${GITHUB_SHA:0:7}
- name: Publish latest (default) image
if: github.event_name == 'push' && github.ref_name == 'main' && needs.id_repo.outputs.in_base_repo == 'true'
run: |
docker push ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}_${{matrix.backend}}
docker push ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}}
- name: Create image tarball
if: needs.id_repo.outputs.in_base_repo == 'false'
run: |
docker save ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}_${{matrix.backend}}:${GITHUB_SHA:0:7} > ${{matrix.image}}_${{matrix.backend}}.tar
docker save ghcr.io/cexa-project/ddc/${{matrix.image}}_${{matrix.backend}}:${GITHUB_SHA:0:7} > ${{matrix.image}}_${{matrix.backend}}.tar
- name: Generate docker artifact from image
if: needs.id_repo.outputs.in_base_repo == 'false'
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
docker run \
--cidfile='docker.cid' \
-v ${PWD}:/src:ro \
ghcr.io/maison-de-la-simulation/ddc/${{matrix.image}}_${{fromJSON('{"cpu-gcc":"cpu","cpu-clang":"cpu"}')[matrix.backend] || matrix.backend}}:${GITHUB_SHA:0:7} \
ghcr.io/cexa-project/ddc/${{matrix.image}}_${{fromJSON('{"cpu-gcc":"cpu","cpu-clang":"cpu"}')[matrix.backend] || matrix.backend}}:${GITHUB_SHA:0:7} \
bash /src/run.sh
if docker cp "$(cat docker.cid)":/data/tests.xml /home/runner/work/ddc/ddc/tests.xml
then echo "with_report=true" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -221,5 +221,5 @@ jobs:
find /src/benchmarks /src/examples /src/tests -name '*.cpp' -exec clang-tidy-14 -p build -header-filter="(/src/include/ddc/.*|/src/tests/.*)" '{}' '+'
EOF
docker run \
-v ${PWD}:/src:ro ghcr.io/maison-de-la-simulation/ddc/latest_cpu:${GITHUB_SHA:0:7} \
-v ${PWD}:/src:ro ghcr.io/cexa-project/ddc/latest_cpu:${GITHUB_SHA:0:7} \
bash /src/run.sh
38 changes: 9 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ project(DDC VERSION 0.0.0 LANGUAGES CXX)

# List of options

option(BUILD_FFT_KERNEL "Build DDC kernel for FFT" ON)
option(BUILD_SPLINES_KERNEL "Build DDC kernel for splines" ON)
option(BUILD_BENCHMARKS "Build DDC benchmarks." OFF)
option(BUILD_DOCUMENTATION "Build DDC documentation/website" OFF)
option(BUILD_EXAMPLES "Build DDC examples" ON)
option(DDC_BUILD_PDI_WRAPPER "Build DDC PDI wrapper" ON)
option(DDC_ENABLE_DOUBLE "Build DDC with double precision support, float is used otherwise" ON)
option(HIP_FOR_NVIDIA "Use the HIP wrapper for CUDA on NVIDIA plateforms, for development purpose" OFF)
if(NOT(Kokkos_ENABLE_CUDA) AND HIP_FOR_NVIDIA)
message(FATAL_ERROR "Kokkos_ENABLE_CUDA has to be ON to use HIP wrapper on NVIDIA plateforms")
endif()

# Dependencies

Expand Down Expand Up @@ -94,12 +92,12 @@ endif()

# FFTW
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ) # Maybe not specific to FFTW
if(NOT FFTW_FOUND)
if("${BUILD_FFT_KERNEL}" AND NOT FFTW_FOUND)
find_package( FFTW MODULE REQUIRED )
endif()

## CUDA + CUDAToolkit
if("${Kokkos_ENABLE_CUDA}" AND NOT("${HIP_FOR_NVIDIA}"))
if("${BUILD_FFT_KERNEL}" AND "${Kokkos_ENABLE_CUDA}")
find_package( CUDAToolkit MODULE REQUIRED )
if( NOT(CUDAToolkit_FOUND) )
message(FATAL_ERROR "CUDAToolkit not found." )
Expand Down Expand Up @@ -237,31 +235,13 @@ if("${Kokkos_ENABLE_HIP}")
target_compile_definitions(DDC INTERFACE hipfft_AVAIL)
endif()

if("${HIP_FOR_NVIDIA}")
find_package( HIP REQUIRED )

target_include_directories(DDC
SYSTEM INTERFACE
"$<BUILD_INTERFACE:${HIP_ROOT_DIR}/include>"
)
target_compile_definitions(DDC INTERFACE hip_AVAIL)
target_compile_definitions(DDC INTERFACE HIP_FOR_NVIDIA)

if( DEFINED HIP_TOOLKIT_PATH ) # Usually called ROCM_PATH in the HIP documentation. By default : /opt/rocm
list( APPEND CMAKE_PREFIX_PATH ${HIP_TOOLKIT_PATH}/hipfft/lib )
find_library(HIPFFT_LIB hipfft REQUIRED)
target_link_libraries( DDC INTERFACE ${HIPFFT_LIB} )
target_include_directories(DDC
SYSTEM INTERFACE
"$<BUILD_INTERFACE:${HIP_TOOLKIT_PATH}/include>"
)
target_compile_definitions(DDC INTERFACE hipfft_AVAIL)
else()
message( "HIP_TOOLKIT_PATH is not defined. Kernels functions may be unaccessible. To get them, add -DHIP_TOOLKIT_PATH=\"path_to_hip_toolkit\" in your cmake line" )
endif()
if("${BUILD_SPLINES_KERNEL}")
# Ginkgo
find_package(Ginkgo 1.6.0 EXACT REQUIRED)
target_link_libraries(DDC INTERFACE Ginkgo::ginkgo)
target_compile_definitions(DDC INTERFACE ginkgo_AVAIL)
endif()


## The PDI wrapper

if("${DDC_BUILD_PDI_WRAPPER}")
Expand Down
13 changes: 11 additions & 2 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# SPDX-License-Identifier: MIT

add_executable(ddc_benchmarks deepcopy.cpp)
target_link_libraries(ddc_benchmarks
add_executable(ddc_benchmark_deepcopy deepcopy.cpp)
target_link_libraries(ddc_benchmark_deepcopy
PUBLIC
benchmark::benchmark
DDC::DDC
)

if("${BUILD_SPLINES_KERNEL}")
add_executable(ddc_benchmark_splines splines.cpp)
target_link_libraries(ddc_benchmark_splines
PUBLIC
benchmark::benchmark
DDC::DDC
)
endif()
Loading

0 comments on commit 5f4c08c

Please sign in to comment.