Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/lazy_array.jl @ 1293:c5cf32fab163 refactor/grids
Add call site @inline in LazyFunctionArray to avoid allocations in eval_on on 3D grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 07 Mar 2023 10:12:33 +0100 |
parents | 6fd97b5ed3e5 |
children | d7bc11053951 |
comparison
equal
deleted
inserted
replaced
1292:6753b210d0ab | 1293:c5cf32fab163 |
---|---|
34 | 34 |
35 Base.size(lfa::LazyFunctionArray) = lfa.size | 35 Base.size(lfa::LazyFunctionArray) = lfa.size |
36 | 36 |
37 function Base.getindex(lfa::LazyFunctionArray{F,T,D}, I::Vararg{Int,D}) where {F,T,D} | 37 function Base.getindex(lfa::LazyFunctionArray{F,T,D}, I::Vararg{Int,D}) where {F,T,D} |
38 @boundscheck checkbounds(lfa, I...) | 38 @boundscheck checkbounds(lfa, I...) |
39 return @inbounds lfa.f(I...) | 39 return @inbounds @inline lfa.f(I...) |
40 end | 40 end |
41 | 41 |
42 | 42 |
43 """ | 43 """ |
44 LazyElementwiseOperation{T,D,Op} <: LazyArray{T,D} | 44 LazyElementwiseOperation{T,D,Op} <: LazyArray{T,D} |