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

feat[next][dace]: Add more debug info to DaCe #1384

Merged
merged 38 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
caebdff
Add more debug info to DaCe
kotsaloscv Nov 7, 2023
f14d091
Merge branch 'main' into more_debinfo
kotsaloscv Nov 27, 2023
bebb122
Add more debug info to DaCe
kotsaloscv Nov 27, 2023
7eeaddb
Add more debug info to DaCe : WIP
kotsaloscv Nov 27, 2023
7447807
Add more debug info to DaCe : WIP
kotsaloscv Nov 29, 2023
6d89149
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Nov 29, 2023
16bc489
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Nov 30, 2023
0ed8090
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 4, 2023
3e38756
merge main
kotsaloscv Dec 4, 2023
0b1fe1a
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 4, 2023
55abb29
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 4, 2023
54dd79d
merge main
kotsaloscv Dec 5, 2023
774b2f5
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 5, 2023
1622866
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 5, 2023
7baedb8
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 5, 2023
223de4e
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
6c636ae
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
93fcb14
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
d6da4ab
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
8460c67
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
5632def
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
b59fd83
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
68dde06
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 13, 2023
a1a91c4
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
1ed9764
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
371dc36
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
bb880dd
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
e0a254f
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Dec 14, 2023
ea2f672
merge main
kotsaloscv Jan 4, 2024
50f96a8
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 4, 2024
9c9c8ae
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
6fb28a1
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
3f4e9d1
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
b29bc5f
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
1a2e978
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
bf33827
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 12, 2024
616a833
merge main
kotsaloscv Jan 23, 2024
371b1da
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
kotsaloscv Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more debug info to DaCe (pass SourceLocation from past/foast to i…
…tir, and from itir to the SDFG): Preserve Location through Visitors [WIP]
kotsaloscv committed Dec 13, 2023
commit 5632def34ee1e5e70de7563df99e8e48df7fc7a2
4 changes: 1 addition & 3 deletions src/gt4py/eve/visitors.py
Original file line number Diff line number Diff line change
@@ -21,8 +21,6 @@
import copy
from typing import ClassVar

from gt4py.next.ffront.field_operator_ast import Name

from . import concepts, trees
from .extended_typing import Any
from .type_definitions import NOTHING
@@ -203,6 +201,6 @@ def generic_visit(self, node: concepts.RootNode, **kwargs: Any) -> Any:
class PreserveLocation(NodeVisitor):
def visit(self, node: concepts.RootNode, **kwargs: Any) -> Any:
result = super().visit(node, **kwargs)
if hasattr(node, "location") and hasattr(result, "location") and not isinstance(node, Name):
if hasattr(node, "location") and hasattr(result, "location"):
result.location = node.location
return result
15 changes: 12 additions & 3 deletions src/gt4py/next/ffront/foast_to_itir.py
Original file line number Diff line number Diff line change
@@ -15,9 +15,8 @@
import dataclasses
from typing import Any, Callable, Optional

from gt4py.eve import NodeTranslator
from gt4py.eve import NodeTranslator, concepts, extended_typing
from gt4py.eve.utils import UIDGenerator
from gt4py.eve.visitors import PreserveLocation
from gt4py.next.ffront import (
dialect_ast_enums,
fbuiltins,
@@ -40,7 +39,7 @@ def promote_to_list(


@dataclasses.dataclass
class FieldOperatorLowering(PreserveLocation, NodeTranslator):
class FieldOperatorLowering(NodeTranslator):
"""
Lower FieldOperator AST (FOAST) to Iterator IR (ITIR).

@@ -72,6 +71,16 @@ class FieldOperatorLowering(PreserveLocation, NodeTranslator):
def apply(cls, node: foast.LocatedNode) -> itir.Expr:
return cls().visit(node)

def visit(self, node: concepts.RootNode, **kwargs: extended_typing.Any) -> extended_typing.Any:
result = super().visit(node, **kwargs)
if (
hasattr(node, "location")
and hasattr(result, "location")
and not isinstance(node, foast.Name)
):
result.location = node.location
return result

def visit_FunctionDefinition(
self, node: foast.FunctionDefinition, **kwargs
) -> itir.FunctionDefinition: