Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FixBug] Don't instantiate symbol for primitive functions #291

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/hidet/transforms/instantiate_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from hidet.ir.func import Function
from hidet.ir.module import IRModule
from hidet.ir.functors import IRRewriter
from hidet.ir.primitives import is_primitive_function
from hidet.ir.primitives.runtime import get_symbol_value
from hidet.ir.stmt import LetStmt, LaunchKernelStmt
from hidet.ir.tools import collect
Expand Down Expand Up @@ -59,6 +60,9 @@ def visit_Function(self, func: Function):
else:
assert False

if is_primitive_function(func.name):
return func

ordered_symbols: List[SymbolVar] = list(symbols)
symbol_params: List[Var] = [Var(symbol.name, symbol.type) for symbol in ordered_symbols]
self.func_symbols[func.name] = FuncSymbols(
Expand Down