Esempio n. 1
0
    def validate(self, sdfg, state):
        if not data.validate_name(self.label):
            raise NameError('Invalid nested SDFG name "%s"' % self.label)
        for in_conn in self.in_connectors:
            if not data.validate_name(in_conn):
                raise NameError('Invalid input connector "%s"' % in_conn)
        for out_conn in self.out_connectors:
            if not data.validate_name(out_conn):
                raise NameError('Invalid output connector "%s"' % out_conn)
        connectors = self.in_connectors | self.out_connectors
        for dname, desc in self.sdfg.arrays.items():
            # TODO(later): Disallow scalars without access nodes (so that this
            #              check passes for them too).
            if isinstance(desc, data.Scalar):
                continue
            if not desc.transient and dname not in connectors:
                raise NameError('Data descriptor "%s" not found in nested '
                                'SDFG connectors' % dname)

        # Validate undefined symbols
        symbols = set(k for k in self.sdfg.undefined_symbols(False).keys()
                      if k not in connectors)
        missing_symbols = [s for s in symbols if s not in self.symbol_mapping]
        if missing_symbols:
            raise ValueError('Missing symbols on nested SDFG: %s' %
                             (missing_symbols))

        # Recursively validate nested SDFG
        self.sdfg.validate()
Esempio n. 2
0
 def validate(self, sdfg, state):
     if not data.validate_name(self.label):
         raise NameError('Invalid tasklet name "%s"' % self.label)
     for in_conn in self.in_connectors:
         if not data.validate_name(in_conn):
             raise NameError('Invalid input connector "%s"' % in_conn)
     for out_conn in self.out_connectors:
         if not data.validate_name(out_conn):
             raise NameError('Invalid output connector "%s"' % out_conn)
Esempio n. 3
0
    def validate(self, sdfg, state):
        if not data.validate_name(self.label):
            raise NameError('Invalid nested SDFG name "%s"' % self.label)
        for in_conn in self.in_connectors:
            if not data.validate_name(in_conn):
                raise NameError('Invalid input connector "%s"' % in_conn)
        for out_conn in self.out_connectors:
            if not data.validate_name(out_conn):
                raise NameError('Invalid output connector "%s"' % out_conn)

        # Recursively validate nested SDFG
        self.sdfg.validate()
Esempio n. 4
0
 def validate(self, sdfg, state, node):
     if not data.validate_name(self.label):
         raise NameError('Invalid consume name "%s"' % self.label)