You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However if I include LoopVectorization and TensorCast next:
using LoopVectorization,TensorCast
@btime @tullio test2[n]:=nb(t[n])
7.850 μs (49 allocations: 7.62 KiB)
┌ Warning: #= C:\Users\.julia\packages\Tullio\NGyNM\src\macro.jl:1093 =#:
│ `LoopVectorization.check_args` on your inputs failed; running fallback `@inbounds @fastmath` loop instead.
│ Use `warn_check_args=false`, e.g. `@turbo warn_check_args=false ...`, to disable this warning.
└ @ Main C:\Users\.julia\packages\LoopVectorization\FMfT8\src\condense_loopset.jl:1049
601-element Vector{Float64}:
After I several times tries, I found this error is related with function type declear. When I define function, no matter declear argument type of return type, with the coexistence with LoopVectorization and TensorCast, LoopVectorization would throw this error.
The text was updated successfully, but these errors were encountered:
I think the issue is the ::Float64 annotation with LoopVectorization:
julia>using Tullio, LoopVectorization
julia> t=collect(range(start=-3,step=0.01,stop=3));
julia>nb(e)::Float64=inv(expm1(e/1e-4));
julia>@tullio test1[n] :=nb(t[n]);
┌ Warning:#= /Users/me/.julia/packages/Tullio/NGyNM/src/macro.jl:1093 =#:
│ `LoopVectorization.check_args` on your inputs failed; running fallback `@inbounds @fastmath` loop instead.
│ Use `warn_check_args=false`, e.g. `@turbo warn_check_args=false ...`, to disable this warning.
└ @ Main ~/.julia/packages/LoopVectorization/7xFHi/src/condense_loopset.jl:1053
julia>nb_any(e) =inv(expm1(e/1e-4)); # the same, without ::Float64
julia>@tullio test1[n] :=nb_any(t[n]);
LoopVectorization works by sending special Vec types contianing several floats through your code, and I presume the above warning comes from noticing that this will fail:
julia> x = LoopVectorization.VectorizationBase.Vec{4,Float64}(1,2,3,4) *1e-6
VectorizationBase.Vec{4, Float64}<1.0e-6, 2.0e-6, 3.0e-6, 4.0e-6>
julia>nb_any(x)
VectorizationBase.Vec{4, Float64}<99.50083333194446, 49.50166665555567, 32.835833295834135, 24.503333244447838>
julia>nb(x)
ERROR: TypeError:in typeassert, expected Float64, got a value of type VectorizationBase.Vec{4, Float64}
BenchmarkTools and TensorCast are uninvolved.
mcabbott
changed the title
Reporting a bug when Tullio being included with TensorCast and LoopVectorization together
Reporting a bug when Tullio being included with LoopVectorization
Nov 18, 2022
In this simple example, if just including Tullio, everythings works well.
However if I include
LoopVectorization
andTensorCast
next:After I several times tries, I found this error is related with function type declear. When I define function, no matter declear argument type of return type, with the coexistence with
LoopVectorization
andTensorCast
,LoopVectorization
would throw this error.The text was updated successfully, but these errors were encountered: