def get_problem_vars(p): inout = set.union(*([set(xs) for xs in p.outputs.itervalues()] + [set(args) for (_, _, _, args) in p.entries])) vs = dict(inout) for node in p.nodes.itervalues(): syntax.get_node_vars(node, vs) return vs
def check_compile (func): for node in func.nodes.itervalues (): vs = {} get_node_vars (node, vs) for (v_nm, typ) in vs.iteritems (): if typ.kind == 'Struct': print 'Failed to compile struct %s in %s' % (v_nm, func) print node assert not 'compiled' if typ.kind == 'Array': print 'Failed to compile array %s in %s' % (v_nm, func) print node assert not 'compiled'
def check_compile(func): for node in func.nodes.itervalues(): vs = {} get_node_vars(node, vs) for (v_nm, typ) in vs.iteritems(): if typ.kind == 'Struct': print 'Failed to compile struct %s in %s' % (v_nm, func) print node assert not 'compiled' if typ.kind == 'Array': print 'Failed to compile array %s in %s' % (v_nm, func) print node assert not 'compiled'