Skip to content

Commit

Permalink
Review from jbigot
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau committed Nov 6, 2024
1 parent cca8b15 commit 3bda09a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
25 changes: 13 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,24 @@ add_library(DDC INTERFACE)
add_library(DDC::DDC ALIAS DDC)
install(TARGETS DDC EXPORT DDCTargets)

add_library(ddc INTERFACE)
add_library(DDC::ddc ALIAS ddc)
install(TARGETS ddc EXPORT DDCTargets)
target_compile_definitions(ddc INTERFACE MDSPAN_USE_PAREN_OPERATOR=1)
add_library(ddc_core INTERFACE)
add_library(DDC::core ALIAS ddc_core)
install(TARGETS ddc_core EXPORT DDCTargets)
target_compile_definitions(ddc_core INTERFACE MDSPAN_USE_PAREN_OPERATOR=1)
if("${DDC_BUILD_DOUBLE_PRECISION}")
target_compile_definitions(ddc INTERFACE DDC_BUILD_DOUBLE_PRECISION)
target_compile_definitions(ddc_core INTERFACE DDC_BUILD_DOUBLE_PRECISION)
endif()
target_compile_features(ddc INTERFACE cxx_std_17)
target_compile_features(ddc_core INTERFACE cxx_std_17)
target_include_directories(
ddc
ddc_core
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
target_link_libraries(ddc INTERFACE Kokkos::kokkos)
target_link_libraries(ddc_core INTERFACE Kokkos::kokkos)

### DDC legacy target
target_link_libraries(DDC INTERFACE ddc)
target_link_libraries(DDC INTERFACE ddc_core)

# Link library to DDC

Expand Down Expand Up @@ -177,7 +177,7 @@ if("${DDC_BUILD_KERNELS_FFT}")
add_library(DDC::fft ALIAS ddc_fft)
install(TARGETS ddc_fft EXPORT DDCTargets)
target_compile_definitions(ddc_fft INTERFACE "DDC_BUILD_KERNELS_FFT")
target_link_libraries(ddc_fft INTERFACE ddc Kokkos::kokkos KokkosFFT::fft)
target_link_libraries(ddc_fft INTERFACE ddc_core Kokkos::kokkos KokkosFFT::fft)

### DDC legacy target
target_link_libraries(DDC INTERFACE ddc_fft)
Expand Down Expand Up @@ -221,7 +221,7 @@ if("${DDC_BUILD_KERNELS_SPLINES}")
target_include_directories(ddc_splines SYSTEM INTERFACE ${LAPACKE_INCLUDE_DIRS})
target_link_libraries(
ddc_splines
INTERFACE ddc Ginkgo::ginkgo Kokkos::kokkos Kokkos::kokkoskernels ${LAPACKE_LIBRARIES}
INTERFACE ddc_core Ginkgo::ginkgo Kokkos::kokkos Kokkos::kokkoskernels ${LAPACKE_LIBRARIES}
)

### DDC legacy target
Expand All @@ -242,10 +242,11 @@ if("${DDC_BUILD_PDI_WRAPPER}")
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
target_link_libraries(ddc_pdi INTERFACE ddc PDI::PDI_C)
target_link_libraries(ddc_pdi INTERFACE ddc_core PDI::PDI_C)

### PDI_Wrapper legacy target
add_library(PDI_Wrapper INTERFACE)
set_target_properties(PDI_Wrapper PROPERTIES DEPRECATION "Use DDC::pdi instead")
add_library(DDC::PDI_Wrapper ALIAS PDI_Wrapper)
install(TARGETS PDI_Wrapper EXPORT DDCTargets)
target_link_libraries(PDI_Wrapper INTERFACE ddc_pdi)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# SPDX-License-Identifier: MIT

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

if("${DDC_BUILD_KERNELS_SPLINES}")
add_executable(ddc_benchmark_splines splines.cpp)
target_link_libraries(ddc_benchmark_splines PUBLIC benchmark::benchmark DDC::DDC)
target_link_libraries(ddc_benchmark_splines PUBLIC benchmark::benchmark ddc_core ddc_splines)
endif()
2 changes: 1 addition & 1 deletion cmake/DDCConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ endif()

include(${CMAKE_CURRENT_LIST_DIR}/DDCTargets.cmake)

foreach(target fft;pdi;splines)
foreach(target core fft pdi splines)
if(TARGET DDC::ddc_${target})
add_library(DDC::${target} ALIAS DDC::ddc_${target})
endif()
Expand Down
12 changes: 6 additions & 6 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# SPDX-License-Identifier: MIT

add_executable(game_of_life game_of_life.cpp)
target_link_libraries(game_of_life PUBLIC DDC::ddc)
target_link_libraries(game_of_life PUBLIC DDC::core)

add_executable(heat_equation heat_equation.cpp)
target_link_libraries(heat_equation PUBLIC DDC::ddc)
target_link_libraries(heat_equation PUBLIC DDC::core)

add_executable(uniform_heat_equation uniform_heat_equation.cpp)
target_link_libraries(uniform_heat_equation PUBLIC DDC::ddc)
target_link_libraries(uniform_heat_equation PUBLIC DDC::core)

add_executable(non_uniform_heat_equation non_uniform_heat_equation.cpp)
target_link_libraries(non_uniform_heat_equation PUBLIC DDC::ddc)
target_link_libraries(non_uniform_heat_equation PUBLIC DDC::core)

if("${DDC_BUILD_PDI_WRAPPER}")
target_link_libraries(heat_equation PUBLIC DDC::pdi)
Expand All @@ -22,10 +22,10 @@ endif()

if("${DDC_BUILD_KERNELS_FFT}")
add_executable(heat_equation_spectral heat_equation_spectral.cpp)
target_link_libraries(heat_equation_spectral PUBLIC DDC::ddc DDC::fft)
target_link_libraries(heat_equation_spectral PUBLIC DDC::core DDC::fft)
endif()

if("${DDC_BUILD_KERNELS_SPLINES}")
add_executable(characteristics_advection characteristics_advection.cpp)
target_link_libraries(characteristics_advection PUBLIC DDC::ddc DDC::splines)
target_link_libraries(characteristics_advection PUBLIC DDC::core DDC::splines)
endif()
2 changes: 1 addition & 1 deletion install_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ message("DDC_BUILD_KERNELS_SPLINES=${DDC_BUILD_KERNELS_SPLINES}")
message("DDC_BUILD_PDI_WRAPPER=${DDC_BUILD_PDI_WRAPPER}")

add_executable(main main.cpp)
target_link_libraries(main PRIVATE DDC::ddc DDC::fft DDC::pdi DDC::splines)
target_link_libraries(main PRIVATE DDC::core DDC::fft DDC::pdi DDC::splines)

0 comments on commit 3bda09a

Please sign in to comment.