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

[DRAFT][FRONTEND] added support for tuples #5220

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft

Conversation

ptillet
Copy link
Collaborator

@ptillet ptillet commented Nov 21, 2024

cl

assert y[1] == 10
assert y[2] == vals[1]

# -------
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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))
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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:
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant