Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loki-transform: Remove custom entry point options #465

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
repository: ecmwf-ifs/dwarf-p-cloudsc
path: cloudsc
ref: develop
ref: naml-loki-c-pipeline

- name: Clone CLOUDSC2 TL AD
uses: actions/checkout@v4
Expand Down
111 changes: 0 additions & 111 deletions cmake/loki_transform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -291,26 +291,6 @@ function( loki_transform_target )
list( APPEND _TRANSFORM_OPTIONS CPP )
endif()

if( _PAR_T_INLINE_MEMBERS )
list( APPEND _TRANSFORM_OPTIONS INLINE_MEMBERS )
endif()

if( _PAR_T_RESOLVE_SEQUENCE_ASSOCIATION )
list( APPEND _TRANSFORM_OPTIONS RESOLVE_SEQUENCE_ASSOCIATION )
endif()

if( _PAR_T_DERIVE_ARGUMENT_ARRAY_SHAPE )
list( APPEND _TRANSFORM_OPTIONS DERIVE_ARGUMENT_ARRAY_SHAPE )
endif()

if( _PAR_T_TRIM_VECTOR_SECTIONS )
list( APPEND _TRANSFORM_OPTIONS TRIM_VECTOR_SECTIONS )
endif()

if( _PAR_T_GLOBAL_VAR_OFFLOAD )
list( APPEND _TRANSFORM_OPTIONS GLOBAL_VAR_OFFLOAD )
endif()

loki_transform(
COMMAND ${_PAR_T_COMMAND}
OUTPUT ${LOKI_SOURCES_TO_APPEND}
Expand Down Expand Up @@ -383,97 +363,6 @@ function( loki_transform_target )

endfunction()

##############################################################################
# .rst:
#
# loki_transform_convert
# ======================
#
# Deprecated interface to loki-transform.py. Use loki_transform( COMMAND convert ) instead.::
#
##############################################################################

function( loki_transform_convert )

ecbuild_warn( "\
loki_transform_convert() is deprecated and will be removed in a future version!
Please use
loki_transform( COMMAND convert [...] )
or
loki_transform_target( COMMAND convert [...] ).
"
)

set( options
CPP DATA_OFFLOAD REMOVE_OPENMP ASSUME_DEVICEPTR GLOBAL_VAR_OFFLOAD
TRIM_VECTOR_SECTIONS REMOVE_DERIVED_ARGS INLINE_MEMBERS
RESOLVE_SEQUENCE_ASSOCIATION DERIVE_ARGUMENT_ARRAY_SHAPE
)
set( oneValueArgs
MODE DIRECTIVE FRONTEND CONFIG PATH OUTPATH
)
set( multiValueArgs
OUTPUT DEPENDS INCLUDES HEADERS DEFINITIONS OMNI_INCLUDE XMOD
)

cmake_parse_arguments( _PAR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

if( _PAR_UNPARSED_ARGUMENTS )
ecbuild_critical( "Unknown keywords given to loki_transform_convert(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
endif()

#
# Rewrite old argument names
#

# PATH -> SOURCES
list( TRANSFORM ARGV REPLACE "^PATH$" "SOURCES" )

# OUTPATH -> BUILDDIR
list( TRANSFORM ARGV REPLACE "^OUTPATH$" "BUILDDIR" )

#
# Call loki_transform
#
loki_transform( COMMAND "convert" ${ARGV} )

endfunction()

##############################################################################
# .rst:
#
# loki_transform_transpile
# ========================
#
# **Removed:** Apply Loki transformation in transpile mode.::
#
# loki_transform_transpile(
# )
#
# ..warning::
# loki_transform_transpile() was removed!
#
# Please use
# loki_transform( COMMAND convert [...] )
# or
# loki_transform_target( COMMAND convert [...] ).
#
##############################################################################

function( loki_transform_transpile )

ecbuild_critical( "\
loki_transform_transpile() was removed!
Please use
loki_transform( COMMAND convert [...] )
or
loki_transform_target( COMMAND convert [...] ).
"
)

endfunction()


##############################################################################
# .rst:
#
Expand Down
35 changes: 0 additions & 35 deletions cmake/loki_transform_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,41 +84,6 @@ macro( _loki_transform_parse_options )
list( APPEND _ARGS --cpp )
endif()

if( _PAR_DATA_OFFLOAD )
list( APPEND _ARGS --data-offload )
endif()

if( _PAR_REMOVE_OPENMP )
list( APPEND _ARGS --remove-openmp )
endif()

if( _PAR_ASSUME_DEVICEPTR )
list( APPEND _ARGS --assume-deviceptr )
endif()

if( _PAR_GLOBAL_VAR_OFFLOAD )
list( APPEND _ARGS --global-var-offload )
endif()

if( _PAR_TRIM_VECTOR_SECTIONS )
list( APPEND _ARGS --trim-vector-sections )
endif()

if( _PAR_REMOVE_DERIVED_ARGS )
list( APPEND _ARGS --remove-derived-args )
endif()

if( _PAR_INLINE_MEMBERS )
list( APPEND _ARGS --inline-members )
endif()

if( _PAR_RESOLVE_SEQUENCE_ASSOCIATION )
list( APPEND _ARGS --resolve-sequence-association )
endif()

if( _PAR_DERIVE_ARGUMENT_ARRAY_SHAPE )
list( APPEND _ARGS --derive-argument-array-shape )
endif()

endmacro()

Expand Down
Loading
Loading