Skip to content

Commit

Permalink
[FRONTEND] Fixed bugs in global symbols resolution of @triton.jit'd f…
Browse files Browse the repository at this point in the history
…unctions (triton-lang#136)
  • Loading branch information
ptillet committed Jul 27, 2021
1 parent 94ce6aa commit 298aead
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/triton/code_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,12 @@ def parse(self):

def __call__(self, *args, generator: CodeGenerator, **meta):
try:
gscope = generator.gscope.copy()
lscope = generator.lscope.copy()
values = generator.module.get_values().copy()
generator.gscope = sys.modules[self.fn.__module__].__dict__
ret = generator.visit_FunctionDef(self.parse().body[0], inline=True, arg_values=args)
generator.gscope = gscope
generator.lscope = lscope
generator.module.set_values(values)
return ret
Expand Down

0 comments on commit 298aead

Please sign in to comment.