-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
At some point start_j
disappeared in this code gen_code/gen_julia_code.jl
and was replaced by a hard-coded 1.
push_code!(code, "memslots=Vector{Matrix{T}}(undef,max_memslots)")
push_code!(code, "n=size(A,1)")
push_code!(code, "for j=1:max_memslots")
push_code!(code, "memslots[j]=Matrix{T}(undef,n,n)", ind_lvl = 2)
push_code!(code, "end")
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.
Metadata
Metadata
Assignees
Labels
No labels