This generates code with an additional allocation since the code becomes
max_memslots=8
memslots=Vector{Matrix{T}}(undef,max_memslots)
n=size(A,1)
for j=1:max_memslots
memslots[j]=Matrix{T}(undef,n,n)
end
# The first slots are precomputed nodes [:A]
memslots[1]=A # overwrite A
The first memslot should just be A which can be overwritten.
When I wanted to fix the memslots (in the previous issue) I copied that problem so the generated code looks a bit different now.
At some point
start_j
disappeared in this codegen_code/gen_julia_code.jl
and was replaced by a hard-coded 1.This generates code with an additional allocation since the code becomes
The first memslot should just be
A
which can be overwritten.When I wanted to fix the memslots (in the previous issue) I copied that problem so the generated code looks a bit different now.