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

@gflops UndefVarError #32

Closed
ederag opened this issue Apr 16, 2021 · 3 comments · Fixed by #33
Closed

@gflops UndefVarError #32

ederag opened this issue Apr 16, 2021 · 3 comments · Fixed by #33

Comments

@ederag
Copy link

ederag commented Apr 16, 2021

julia> x = 0.5; coeffs = rand(10);

julia> cnt = @count_ops evalpoly($x, $coeffs)
Flop Counter: 18 flop
┌────────┬─────────┐
│        │ Float64 │
├────────┼─────────┤
│ muladd │       9 │
└────────┴─────────┘

julia> @gflops evalpoly($x, $coeffs);
ERROR: UndefVarError: x not defined
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/BenchmarkTools/ms0Xc/src/execution.jl:440 [inlined]
 [2] top-level scope
   @ ~/.julia/packages/GFlops/16nkd/src/count_ops.jl:44

julia> x
0.5

Julia Version 1.6.0
[2ea8233c] GFlops v0.1.4

@ffevotte
Copy link
Member

Thanks!

I can reproduce this with Julia 1.6.0 but not 1.5.4. Is that the case for you as well?

I just looked at the issue real quick, and it looks like it's not trivial. I'll try and understand a bit more what's going on...

@ffevotte
Copy link
Member

Looks like this is fixed by #33:

julia> using GFlops
[ Info: Precompiling GFlops [2ea8233c-34d4-5acc-88b4-02f326385bcc]

julia> x = 0.5; coeffs = rand(10);

julia> cnt = @count_ops evalpoly($x, $coeffs)
Flop Counter: 18 flop
┌────────┬─────────┐
│        │ Float64 │
├────────┼─────────┤
│ muladd │       9 │
└────────┴─────────┘

julia> @gflops evalpoly($x, $coeffs);
  1.60 GFlops,  7.67% peak  (1.80e+01 flop, 1.13e-08 s, 0 alloc: 0 bytes)

ffevotte added a commit that referenced this issue Apr 19, 2021
ffevotte referenced this issue Apr 19, 2021
Fix hygiene-related bug with Julia 1.6.0
@ederag
Copy link
Author

ederag commented Apr 19, 2021

Confirmed, it works on both julia-1.5.4 and julia-1.6.0 now, thanks !

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 a pull request may close this issue.

2 participants