-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[DRAFT][FRONTEND] added support for tuples #5220
base: main
Are you sure you want to change the base?
Conversation
assert y[1] == 10 | ||
assert y[2] == vals[1] | ||
|
||
# ------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: add more unit tests
from abc import ABCMeta, abstractmethod | ||
from dataclasses import dataclass | ||
from typing import Dict, List, Tuple, Union | ||
from types import ModuleType | ||
|
||
def find_paths_if(iterable, pred): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove duplicate
@@ -57,8 +60,7 @@ def _is_triton_tensor(o: Any) -> bool: | |||
|
|||
|
|||
def _is_constexpr(o: Any) -> bool: | |||
return isinstance(o, constexpr) | |||
|
|||
return o is None or isinstance(o, (constexpr, language.core.dtype, int, bool)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: condition should be more generic
@@ -1304,30 +1299,92 @@ def kernel_suffix(signature, specialization): | |||
return suffix | |||
|
|||
|
|||
def find_paths_if(iterable, pred): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove duplication
return ret | ||
|
||
|
||
class ASTFunction: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: is it the right place?
@@ -261,6 +264,31 @@ | |||
] | |||
|
|||
|
|||
def parse_list_string(s): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: is it the right place ?
@@ -38,6 +38,14 @@ def wrapper(*args, **kwargs): | |||
return wrapper | |||
|
|||
|
|||
def _flatten_list(lst): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: is it the right place ?
@@ -17,6 +17,29 @@ | |||
libraries = ['cuda'] | |||
|
|||
|
|||
def parse_list_string(s): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: a lot of this file should be reused between different backends
cl