def expand_subst(kernel, within=None): logger.debug("%s: expand subst" % kernel.name) from loopy.symbolic import RuleAwareSubstitutionRuleExpander from loopy.context_matching import parse_stack_match rule_mapping_context = SubstitutionRuleMappingContext( kernel.substitutions, kernel.get_var_name_generator()) submap = RuleAwareSubstitutionRuleExpander( rule_mapping_context, kernel.substitutions, parse_stack_match(within)) return rule_mapping_context.finish_kernel(submap.map_kernel(kernel))
def expand_subst(kernel, within=None): if not kernel.substitutions: return kernel logger.debug("%s: expand subst" % kernel.name) from loopy.symbolic import RuleAwareSubstitutionRuleExpander from loopy.match import parse_stack_match rule_mapping_context = SubstitutionRuleMappingContext( kernel.substitutions, kernel.get_var_name_generator()) submap = RuleAwareSubstitutionRuleExpander(rule_mapping_context, kernel.substitutions, parse_stack_match(within)) return rule_mapping_context.finish_kernel(submap.map_kernel(kernel))
def expand_subst(kernel, within=None): """ Returns an instance of :class:`loopy.LoopKernel` with the substitutions referenced in instructions of *kernel* matched by *within* expanded. :arg within: a stack match as understood by :func:`loopy.match.parse_stack_match`. """ if not kernel.substitutions: return kernel logger.debug("%s: expand subst" % kernel.name) from loopy.symbolic import RuleAwareSubstitutionRuleExpander from loopy.match import parse_stack_match rule_mapping_context = SubstitutionRuleMappingContext( kernel.substitutions, kernel.get_var_name_generator()) submap = RuleAwareSubstitutionRuleExpander(rule_mapping_context, kernel.substitutions, parse_stack_match(within)) return rule_mapping_context.finish_kernel(submap.map_kernel(kernel))
def expand_subst(kernel, within=None): """ Returns an instance of :class:`loopy.LoopKernel` with the substitutions referenced in instructions of *kernel* matched by *within* expanded. :arg within: a stack match as understood by :func:`loopy.match.parse_stack_match`. """ if not kernel.substitutions: return kernel logger.debug("%s: expand subst" % kernel.name) from loopy.symbolic import RuleAwareSubstitutionRuleExpander from loopy.match import parse_stack_match rule_mapping_context = SubstitutionRuleMappingContext( kernel.substitutions, kernel.get_var_name_generator()) submap = RuleAwareSubstitutionRuleExpander( rule_mapping_context, kernel.substitutions, parse_stack_match(within)) return rule_mapping_context.finish_kernel(submap.map_kernel(kernel))