Skip to content

Commit acf388a

Browse files
committed
Renamed benchmarks -> benchmark, and made tweaks, including finally fixing and testing LowDimArray.
1 parent 20544db commit acf388a

13 files changed

+68
-18
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.3.3"
4+
version = "0.3.4"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
File renamed without changes.

benchmark/benchmarks.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
using BenchmarkTools
3+
4+
suite = BenchmarkGroup()
5+
suite["linalg"] = BenchmarkGroup(["matmul","dot"])
6+
7+
include(joinpath(@__DIR__, "looptests.jl"))
8+
9+
for n 1:256
10+
11+
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/broadcast.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,14 @@ end
8888
struct LowDimArray{D,T,N,A<:DenseArray{T,N}} <: DenseArray{T,N}
8989
data::A
9090
end
91-
@inline Base.pointer(A::LowDimArray) = pointer(A)
91+
@inline Base.pointer(A::LowDimArray) = pointer(A.data)
92+
Base.size(A::LowDimArray) = Base.size(A.data)
93+
@generated function VectorizationBase.stridedpointer(A::LowDimArray{D,T,N}) where {D,T,N}
94+
s = Expr(:tuple, [Expr(:ref, :strideA, n) for n 1+D[1]:N if D[n]]...)
95+
f = D[1] ? :PackedStridedPointer : :SparseStridedPointer
96+
Expr(:block, Expr(:meta,:inline), Expr(:(=), :strideA, Expr(:call, :strides, Expr(:(.), :A, QuoteNode(:data)))),
97+
Expr(:call, Expr(:(.), :VectorizationBase, QuoteNode(f)), Expr(:call, :pointer, Expr(:(.), :A, QuoteNode(:data))), s))
98+
end
9299
function LowDimArray{D}(data::A) where {D,T,N,A <: AbstractArray{T,N}}
93100
LowDimArray{D,T,N,A}(data)
94101
end

0 commit comments

Comments
 (0)