MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / exec

Method exec

python/CuTeDSL/cutlass/base_dsl/ast_preprocessor.py:653–673  ·  view source on GitHub ↗

Requires an active DSL preprocessor session.

(
        self,
        function_name: str,
        original_function: Callable[..., Any],
        code_object: types.CodeType,
        exec_globals: dict[str, Any],
    )

Source from the content-addressed store, hash-verified

651 self.exec_imports(import_info.finally_imports, exec_globals)
652
653 def exec(
654 self,
655 function_name: str,
656 original_function: Callable[..., Any],
657 code_object: types.CodeType,
658 exec_globals: dict[str, Any],
659 ) -> Callable[..., Any] | None:
660 """Requires an active DSL preprocessor session."""
661 # Get imports from the original module
662 module_imports = self._get_module_imports(original_function)
663
664 # Import all required modules
665 self.exec_imports(module_imports, exec_globals)
666
667 # Execute the transformed code
668 log().info(
669 "ASTPreprocessor Executing transformed code for function [%s]",
670 function_name,
671 )
672 exec(code_object, exec_globals)
673 return exec_globals.get(function_name)
674
675 @staticmethod
676 def print_ast(transformed_tree: ast.AST | None = None) -> None:

Callers 7

run_preprocessorMethod · 0.80
StemmerFunction · 0.80
jquery.jsFile · 0.80
YFunction · 0.80
byFunction · 0.80
bMFunction · 0.80
bvFunction · 0.80

Calls 4

_get_module_importsMethod · 0.95
exec_importsMethod · 0.95
logFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected