Skip to content

Commit 11f4a64

Browse files
authored
Optimize solve_unroll_lagrange (#264)
``` julia> @Btime LoopVectorization.solve_unroll_lagrange(view($(ls.cost_vec),:,1), view($(ls.reg_pres),:,1), 1025, 1025, 1, 1, true) #before 330.934 ns (20 allocations: 480 bytes) (3, 9, 1.055816625e8) julia> @Btime LoopVectorization.solve_unroll_lagrange(view($(ls.cost_vec),:,1), view($(ls.reg_pres),:,1), 1025, 1025, 1, 1, true) #after 131.151 ns (0 allocations: 0 bytes) (3, 9, 1.055816625e8) ```
1 parent 4c91232 commit 11f4a64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modeling/determinestrategy.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ function determine_unroll_factor(ls::LoopSet, order::Vector{Symbol}, vloopsym::S
393393
UF, best_unrolled
394394
end
395395

396-
function unroll_cost(X, u₁, u₂, u₁L, u₂L)
396+
@inline function unroll_cost(X, u₁, u₂, u₁L, u₂L)
397397
u₂factor = (num_iterations(u₂L, u₂)/u₂L)
398398
u₁factor = (num_iterations(u₁L, u₁)/u₁L)
399399
# X[1]*u₂factor*u₁factor + X[4] + X[2] * u₂factor + X[3] * u₁factor

0 commit comments

Comments
 (0)