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

Operator print tweak for schedule display #690

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/FinchLogic/nodes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ alias
"""
table(tns, idxs...)

Logical AST expression for a tensor object `val`, indexed by fields `idxs...`.
Logical AST expression for a tensor object `tns`, indexed by fields `idxs...`.
"""
table

Expand Down
7 changes: 6 additions & 1 deletion src/scheduler/LogicCompiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@

function compile_logic_constant(node)
if node.kind === immediate
node.val
val = node.val
if Base.isoperator(Symbol(val))
Symbol(val)
else
val

Check warning on line 77 in src/scheduler/LogicCompiler.jl

View check run for this annotation

Codecov / codecov/patch

src/scheduler/LogicCompiler.jl#L77

Added line #L77 was not covered by tests
end
Comment on lines +73 to +78
Copy link
Member Author

@mtsokol mtsokol Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could just always return Symbol(val) anyway - I see that it's no-op for functions:

julia> :(1 << $(Symbol(map)) >>= 1)
:(1 << map >>= 1)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is always true. Different functions in different modules can have the same name.

elseif node.kind === deferred
:($(node.ex)::$(node.type))
else
Expand Down
Loading