-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
LangJulia generator sometimes has incorrect usage of axpby!
:
julia> (graph,_)=gen_ps([4.0;3.0]);
julia> gen_code("/tmp/bla.jl",graph,lang=LangJulia())
julia> include("/tmp/bla.jl");
julia> dummy(randn(3,3))
ERROR: MethodError: no method matching axpby!(::Float64, ::UniformScaling{Bool}, ::Float64, ::Array{Float64,2})
Closest candidates are:
axpby!(::Number, ::Union{AbstractArray{T,1}, DenseArray{T,N} where N}, ::Number, ::Union{AbstractArray{T,1}, DenseArray{T,N} where N}) where T<:Union{Complex{Float32}, Complex{Float64}, Float32, Float64} at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/LinearAlgebra/src/blas.jl:566
However, if we enable explicit allocation of the I
-matrix it works:
julia> gen_code("/tmp/bla.jl",graph,lang=LangJulia(true,false))
julia> include("/tmp/bla.jl");
julia> dummy(randn(3,3))
3×3 Array{Float64,2}:
0.360612 -0.800875 0.650747
-3.79275 3.97425 0.794266
3.81051 0.342539 3.8338
The reason is: BLAS does not support usage of the built-in I
operator. This should be fixable with if-statements in execute_operation!
.
Metadata
Metadata
Assignees
Labels
No labels