JuliaSIMD / JuliaSIMD/Polyester.jl

cannot convert Expr to object of type Symbol

Open
#25 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
285
Forks
20
PR merge metrics
No merged PRs in 30d

Description

I got this error for (since it errors on the expression directly, I omit other parts, but let me know if you need other definitions), I currently need to wrap the thread task inside a function manually to workaround this

```julia
@inbounds @batch for tid in 1:nthreads
range = BQCESubroutine.schedule_task(space, tid, nthreads)
for (k, b, _j) in range
j = _j << plain_locs
i = j+k
ST1 = U11 * S[b, i+1] + U12 * S[b, i+step_1+1]
ST2 = U21 * S[b, i+1] + U22 * S[b, i+step_1+1]

S[b, i+1] = ST1
S[b, i+step_1+1] = ST2
end
end
```

```julia
ERROR: LoadError: MethodError: Cannot `convert` an object of type Expr to an object of type Symbol
Closest candidates are:
convert(::Type{T}, ::T) where T at essentials.jl:205
Symbol(::Any...) at strings/basic.jl:229
Stacktrace:
[1] setindex!(h::Dict{Symbol, Nothing}, v0::Nothing, key0::Expr)
@ Base ./dict.jl:374
[2] push!(s::Set{Symbol}, x::Expr)
@ Base ./set.jl:57
[3] define_induction_variables!(defined::Set{Symbol}, ex::Expr)
@ CheapThreads ~/.julia/packages/CheapThreads/BWiwl/src/closure.jl:34
[4] extractargs!(arguments::Vector{Symbol}, defined::Set{Symbol}, expr::Expr)
@ CheapThreads ~/.julia/packages/CheapThreads/BWiwl/src/closure.jl:49
[5] extractargs!(arguments::Vector{Symbol}, defined::Set{Symbol}, expr::Expr) (repeats 2 times)
@ CheapThreads ~/.julia/packages/CheapThreads/BWiwl/src/closure.jl:75
[6] enclose(exorig::Expr, reserve_per::Int64, minbatchsize::Int64)
@ CheapThreads ~/.julia/packages/CheapThreads/BWiwl/src/closure.jl:91
[7] enclose(exorig::Expr)
@ CheapThreads ~/.julia/packages/CheapThreads/BWiwl/src/closure.jl:80
[8] var"@batch"(__source__::LineNumberNode, __module__::Module, ex::Any)
@ CheapThreads ~/.julia/packages/CheapThreads/BWiwl/src/closure.jl:160
in expression starting at REPL[48]:1
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.