Exemple #1
0
    def __init__(self, f, args, kwargs):
        self.f = f
        self.args = args
        self.kwargs = kwargs
        self._name = f.__name__
        self.argnames = _get_argnames(f)

        global_vars = _get_locals_and_globals(f)

        self.global_vars = {
            k: v
            for k, v in global_vars.items()
            if dtypes.isallowed(v, allow_recursive=True)
        }
        if self.argnames is None:
            self.argnames = []
Exemple #2
0
    def __init__(self, f, args, kwargs):
        self.f = f
        self.args = args
        self.kwargs = kwargs
        self._name = f.__name__
        self.argnames = _get_argnames(f)

        # NOTE: Important to call this outside list/dict comprehensions
        global_vars = _get_locals_and_globals()

        self.global_vars = {
            k: v
            for k, v in global_vars.items() if dtypes.isallowed(v)
        }
        if self.argnames is None:
            self.argnames = []
Exemple #3
0
    def __init__(self, f, args, kwargs, auto_optimize, device):
        from dace.codegen import compiled_sdfg  # Avoid import loops

        self.f = f
        self.dec_args = args
        self.dec_kwargs = kwargs
        self.name = f.__name__
        self.argnames = _get_argnames(f)
        self.auto_optimize = auto_optimize
        self.device = device

        global_vars = _get_locals_and_globals(f)

        self.global_vars = {
            k: v
            for k, v in global_vars.items()
            if dtypes.isallowed(v, allow_recursive=True)
        }
        if self.argnames is None:
            self.argnames = []

        # Cache SDFG with last used arguments
        self._cache: Tuple[ArgTypes, SDFG,
                           compiled_sdfg.CompiledSDFG] = (None, None, None)