Skip to content

Commit fb8e8bd

Browse files
committed
Some subsetview fixes, sin/cos_fast cost update
1 parent 4dcff7d commit fb8e8bd

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LoopVectorization"
22
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
33
authors = ["Chris Elrod <[email protected]>"]
4-
version = "0.12.74"
4+
version = "0.12.75"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/modeling/costs.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,19 @@ const COST = Dict{Symbol,InstructionCost}(
228228
:(^) => InstructionCost(-3.0,200.0,400.0,26), # FIXME
229229
:pow_fast => InstructionCost(-3.0,200.0,400.0,26), # FIXME
230230
:sin => InstructionCost(-3,30.0,60.0,23),
231-
:cos => InstructionCost(-3,27.0,60.0,26),
231+
:cos => InstructionCost(-3,30.0,60.0,26),
232232
:sincos => InstructionCost(-3,37.0,85.0,26),
233-
:sincos_fast => InstructionCost(-3,37.0,85.0,26),
233+
:sincos_fast => InstructionCost(-3,30.0,60.0,26),
234234
:sinpi => InstructionCost(18,15.0,68.0,23),
235235
:cospi => InstructionCost(18,15.0,68.0,26),
236236
:sincospi => InstructionCost(25,37.0,70.0,26),
237237
:log_fast => InstructionCost(20,20.0,40.0,20),
238238
:exp_fast => InstructionCost(20,20.0,20.0,18),
239-
:sin_fast => InstructionCost(18,15.0,68.0,23),
240-
:cos_fast => InstructionCost(18,15.0,68.0,26),
241-
:sinpi_fast => InstructionCost(18,15.0,68.0,23),
242-
:cospi_fast => InstructionCost(18,15.0,68.0,26),
243-
:sincospi_fast => InstructionCost(25,22.0,70.0,26),
239+
:sin_fast => InstructionCost(18,25.0,50.0,23),
240+
:cos_fast => InstructionCost(18,25.0,50.0,26),
241+
:sinpi_fast => InstructionCost(18,25.0,50.0,23),
242+
:cospi_fast => InstructionCost(18,25.0,50.0,26),
243+
:sincospi_fast => InstructionCost(25,25.0,50.0,26),
244244
:tanh => InstructionCost(-3.0,80.0,160.0,26), # FIXME
245245
:tanh_fast => InstructionCost(-3.0,30.0,60.0,20), # FIXME
246246
:sigmoid_fast => InstructionCost(-3.0,16.0,66.0,15), # FIXME

src/vectorizationbase_compat/subsetview.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ end
3030
stridedpointer($gptr, si, StaticInt{$B}())
3131
end
3232
end
33+
@inline _subsetview(ptr::AbstractStridedPointer, ::StaticInt{I}, J::Tuple{}) where {I} = ptr
34+
@inline _subsetview(ptr::AbstractStridedPointer, ::StaticInt{I}, J::Tuple{J1}) where {I,J1} = subsetview(ptr, StaticInt{I}(), first(J))
35+
@inline _subsetview(ptr::AbstractStridedPointer, ::StaticInt{I}, J::Tuple{J1,J2,Vararg}) where {I,J1,J2} = _subsetview(subsetview(ptr, StaticInt{I}(), first(J)), StaticInt{I}(), Base.tail(J))
36+
@inline subsetview(ptr::AbstractStridedPointer, ::StaticInt{I}, J::CartesianIndex) where {I} = _subsetview(ptr, StaticInt{I}(), Tuple(J))
37+
3338
@inline _gesp(sp::VectorizationBase.FastRange, ::StaticInt{1}, i) = gesp(sp, (i,))
3439
@generated function _gesp(sp::AbstractStridedPointer{T,N}, ::StaticInt{I}, i::Integer) where {I,N,T}
3540
t = Expr(:tuple)

0 commit comments

Comments
 (0)