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

@benchmark creates new symbol for each interpolation of a symbol #329

Open
omlins opened this issue Aug 29, 2023 · 3 comments
Open

@benchmark creates new symbol for each interpolation of a symbol #329

omlins opened this issue Aug 29, 2023 · 3 comments
Labels

Comments

@omlins
Copy link

omlins commented Aug 29, 2023

It should instead create only one new symbol per interpolated symbol and reuse it for multiple interpolations of the same symbol.

The current situation can lead to errors in subsequent code generation as for example here:

julia> @benchmark @parallel=($A->$Ā, $B->$B̄) f!($A, $B, $a) # automatic differentiation of f!
ERROR: LoadError: KeywordArgumentError: variable ##A#440 in ((var"##A#440"->begin
            #= REPL[18]:1 =#
            var"##Ā#441"
        end), (var"##B#442"->begin
            #= REPL[18]:1 =#
            var"##B̄#443"
        end)) is not a positional argument of the kernel call f!(var"##A#444", var"##B#445", var"##a#446").

@benchmark should generate the following in this case (reuse var"##A#440" and var"##B#442"):

@parallel=(var"##A#440"->var"##Ā#441", var"##B#442"->var"##B̄#443") f!(var"##A#440", var"##B#442", var"##a#443")
@gdalle gdalle added the bug label Aug 29, 2023
@gdalle
Copy link
Collaborator

gdalle commented Sep 18, 2023

Hey @omlins, thanks for the issue. Do you have any idea how to fix it? I'm a little out of my depth with macros here

@gdalle
Copy link
Collaborator

gdalle commented Sep 18, 2023

Also, a complete MWE would be lovely if you can provide one

@willow-ahrens
Copy link
Collaborator

Does anyone know if this is related to #339?

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

No branches or pull requests

3 participants