[PYTHON] triton.language is now a submodule rather than a single file (#260)

This commit is contained in:
Philippe Tillet
2021-09-02 13:30:14 -07:00
committed by GitHub
parent 8a882b215f
commit c069ef907e
3 changed files with 5 additions and 3 deletions

View File

@@ -146,7 +146,7 @@ class CodeGenerator(ast.NodeVisitor):
values = [values]
for name, value in zip(names, values):
if not isinstance(value, triton.language.block):
value = triton.language._to_ir(value, self.builder)
value = triton.language.core._to_ir(value, self.builder)
self.set_value(name, value)
def visit_AugAssign(self, node):
@@ -383,7 +383,7 @@ class CodeGenerator(ast.NodeVisitor):
if isinstance(fn, JITFunction):
return fn(*args, generator=self, **kws)
if hasattr(fn, '__self__') and self.is_triton_object(fn.__self__) or \
sys.modules[fn.__module__] is triton.language:
sys.modules[fn.__module__] is triton.language.core:
return fn(*args, _builder=self.builder, **kws)
return fn(*args, **kws)

View File

@@ -0,0 +1,2 @@
from . import core
from .core import *

View File

@@ -25,7 +25,7 @@ def _patch(fn):
if x.type.is_void():
return None
return block(x)
return tl
return x
def wrapper(*args, **kwargs):
builder = args[-1]