Example #1
0
    def __init__(self,
                 api="",
                 invoke_name="invoke",
                 kernel_path="",
                 line_length=False):

        self._invoke_name = invoke_name
        self._kernel_path = kernel_path
        self._line_length = line_length

        _config = Config.get()
        if not api:
            api = _config.default_api
        else:
            check_api(api)
        self._api = api

        self._arg_name_to_module_name = {}
        self._unique_invoke_labels = []

        # Use the get_builtin_defs helper function to access
        # information about the builtins supported by this API. The
        # first argument contains the names of the builtins and the
        # second is the file where these names are defined.
        self._builtin_name_map, \
            self._builtin_defs_file = get_builtin_defs(self._api)

        self._alg_filename = None
Example #2
0
def get_builtin_defs(api):
    '''
    Get the names of the supported built-in operations and the file
    containing the associated meta-data for the supplied API

    :param str api: the specified PSyclone API.
    :returns: a 2-tuple containing a dictionary of the supported \
              built-ins and the filename where these built-ins are specified.
    :rtype: (dict, str)

    '''

    # Check that the supplied API is valid
    check_api(api)

    # pylint: disable=import-outside-toplevel
    if api == "dynamo0.3":
        from psyclone.domain.lfric.lfric_builtins import BUILTIN_MAP \
            as builtins
        from psyclone.domain.lfric.lfric_builtins import \
            BUILTIN_DEFINITIONS_FILE as fname
    else:
        # We don't support any built-ins for this API
        builtins = {}
        fname = None
    return builtins, fname
Example #3
0
 def __init__(self, api=""):
     if not api:
         _config = Config.get()
         self._type = _config.default_api
     else:
         check_api(api)
         self._type = api
Example #4
0
    def __init__(self,
                 api="",
                 invoke_name="invoke",
                 kernel_path="",
                 line_length=False):

        self._invoke_name = invoke_name
        self._kernel_path = kernel_path
        self._line_length = line_length

        _config = Config.get()
        if not api:
            api = _config.default_api
        else:
            check_api(api)
        self._api = api

        self._arg_name_to_module_name = {}
        # Dict holding a 2-tuple consisting of type and precision
        # information for each variable declared in the algorithm
        # file, indexed by variable name.
        self._arg_type_defns = {}
        self._unique_invoke_labels = []

        # Use the get_builtin_defs helper function to access
        # information about the builtins supported by this API. The
        # first argument contains the names of the builtins and the
        # second is the file where these names are defined.
        self._builtin_name_map, \
            self._builtin_defs_file = get_builtin_defs(self._api)

        self._alg_filename = None