Skip to content

Commit

Permalink
CMake: Use loki_transform for CUF variants
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Nov 4, 2024
1 parent 2b59d8f commit 631ac1d
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions src/cloudsc_loki/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ if( HAVE_CLOUDSC_LOKI )
)
# Set specific module directory to avoid aliasing of .mod files
set_target_properties( dwarf-cloudsc-loki-idem
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-idem
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-idem
)

ecbuild_add_test(
Expand Down Expand Up @@ -157,7 +157,7 @@ if( HAVE_CLOUDSC_LOKI )
)
# Set specific module directory to avoid aliasing of .mod files
set_target_properties( dwarf-cloudsc-loki-idem-stack
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-idem-stack
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-idem-stack
)


Expand Down Expand Up @@ -244,7 +244,7 @@ if( HAVE_CLOUDSC_LOKI )
)
# Set specific module directory to avoid aliasing of .mod files
set_target_properties( dwarf-cloudsc-loki-sca
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-sca
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-sca
)

ecbuild_add_test(
Expand Down Expand Up @@ -489,7 +489,7 @@ if( HAVE_CLOUDSC_LOKI )
)
# Set specific module directory to avoid aliasing of .mod files
set_target_properties( dwarf-cloudsc-loki-scc
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc
)


Expand Down Expand Up @@ -547,7 +547,7 @@ if( HAVE_CLOUDSC_LOKI )
)
# Set specific module directory to avoid aliasing of .mod files
set_target_properties( dwarf-cloudsc-loki-scc-stack
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-stack
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-stack
)


Expand Down Expand Up @@ -611,7 +611,7 @@ if( HAVE_CLOUDSC_LOKI )
)
# Set specific module directory to avoid aliasing of .mod files
set_target_properties( dwarf-cloudsc-loki-scc-hoist
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-hoist
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-hoist
)

ecbuild_add_test(
Expand All @@ -637,20 +637,24 @@ if( HAVE_CLOUDSC_LOKI )
if( HAVE_CUDA )

# scc-cuf-parametrise
loki_transform_convert(
MODE cuf-parametrise FRONTEND ${LOKI_FRONTEND} CPP
loki_transform(
COMMAND convert
MODE cuf-parametrise
FRONTEND ${LOKI_FRONTEND}
CPP
CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/cloudsc_cuf_loki.config
PATH ${CMAKE_CURRENT_SOURCE_DIR}
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}
HEADERS
${COMMON_MODULE}/yomcst.F90
${COMMON_MODULE}/yomphyder.F90
${COMMON_MODULE}/yoethf.F90
${COMMON_MODULE}/yoecldp.F90
INCLUDES ${COMMON_INCLUDE}
DEFINITIONS CLOUDSC_GPU_TIMING
DATA_OFFLOAD REMOVE_OPENMP
DATA_OFFLOAD
REMOVE_OPENMP
XMOD ${_TARGET_XMOD_DIR} ${XMOD_DIR}
OUTPATH ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-cuf-parametrise
BUILDDIR ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-cuf-parametrise
OUTPUT
loki-scc-cuf-parametrise/cuf_cloudsc_driver_loki_mod.cuf_parametrise.F90
loki-scc-cuf-parametrise/cuf_cloudsc.cuf_parametrise.F90
Expand All @@ -674,7 +678,7 @@ if( HAVE_CUDA )
)
# Set specific module directory to avoid aliasing of .mod files
set_target_properties( dwarf-cloudsc-loki-scc-cuf-parametrise
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-cuf-parametrise
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-cuf-parametrise
)

target_link_options(dwarf-cloudsc-loki-scc-cuf-parametrise PUBLIC "-cuda")
Expand All @@ -688,24 +692,28 @@ if( HAVE_CUDA )
)

# scc-cuf-hoist
loki_transform_convert(
MODE cuf-hoist FRONTEND ${LOKI_FRONTEND} CPP
loki_transform(
COMMAND convert
MODE cuf-hoist
FRONTEND ${LOKI_FRONTEND}
CPP
CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/cloudsc_cuf_loki.config
PATH ${CMAKE_CURRENT_SOURCE_DIR}
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}
HEADERS
${COMMON_MODULE}/yomcst.F90
${COMMON_MODULE}/yomphyder.F90
${COMMON_MODULE}/yoethf.F90
${COMMON_MODULE}/yoecldp.F90
INCLUDES ${COMMON_INCLUDE}
DEFINITIONS CLOUDSC_GPU_TIMING
DATA_OFFLOAD REMOVE_OPENMP
DATA_OFFLOAD
REMOVE_OPENMP
XMOD ${_TARGET_XMOD_DIR} ${XMOD_DIR}
OUTPATH ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-cuf-hoist
BUILDDIR ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-cuf-hoist
OUTPUT
loki-scc-cuf-hoist/cuf_cloudsc_driver_loki_mod.cuf_hoist.F90
loki-scc-cuf-hoist/cuf_cloudsc.cuf_hoist.F90
DEPENDS cuf_cloudsc.F90 cuf_cloudsc_driver_loki_mod.F90 ${_OMNI_DEPENDENCIES}
DEPENDS cuf_cloudsc.F90 cuf_cloudsc_driver_loki_mod.F90 ${_OMNI_DEPENDENCIES}
)

set_source_files_properties(
Expand All @@ -725,7 +733,7 @@ if( HAVE_CUDA )
)
# Set specific module directory to avoid aliasing of .mod files
set_target_properties( dwarf-cloudsc-loki-scc-cuf-hoist
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-cuf-hoist
PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/loki-scc-cuf-hoist
)

target_link_options(dwarf-cloudsc-loki-scc-cuf-hoist PUBLIC "-cuda")
Expand Down

0 comments on commit 631ac1d

Please sign in to comment.