We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d4840b commit 088212cCopy full SHA for 088212c
Project.toml
@@ -5,14 +5,12 @@ version = "0.6.5"
5
6
[deps]
7
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8
-MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
9
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
10
SIMDPirates = "21efa798-c60a-11e8-04d3-e1a92915a26a"
11
SLEEFPirates = "476501e8-09a2-5ece-8869-fb82de89a1fa"
12
VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
13
14
[compat]
15
-MacroTools = "0"
16
Parameters = "0"
17
SIMDPirates = "0.3.3, 0.4, 0.5"
18
SLEEFPirates = "0.3.2, 0.4, 0.5"
src/LoopVectorization.jl
@@ -1,6 +1,6 @@
1
module LoopVectorization
2
3
-using VectorizationBase, SIMDPirates, SLEEFPirates, MacroTools, Parameters
+using VectorizationBase, SIMDPirates, SLEEFPirates, Parameters
4
using VectorizationBase: REGISTER_SIZE, REGISTER_COUNT, extract_data, num_vector_load_expr,
mask, masktable, pick_vector_width_val, valmul, valrem, valmuladd, valadd, valsub, _MM,
maybestaticlength, maybestaticsize, staticm1, subsetview, vzero, stridedpointer_for_broadcast,
@@ -10,7 +10,6 @@ using SIMDPirates: VECTOR_SYMBOLS, evadd, evmul, vrange, reduced_add, reduced_pr
# vmullog2, vmullog10, vdivlog2, vdivlog2add, vdivlog10, vdivlog10add, vfmaddaddone
using Base.Broadcast: Broadcasted, DefaultArrayStyle
using LinearAlgebra: Adjoint, Transpose
-using MacroTools: prewalk, postwalk
export LowDimArray, stridedpointer, vectorizable,
src/constructors.jl
@@ -43,7 +43,7 @@ end
43
44
45
function LoopSet(q::Expr, mod::Symbol = :LoopVectorization)
46
- q = SIMDPirates.contract_pass(q)
+ SIMDPirates.contract_pass!(q)
47
ls = LoopSet(mod)
48
copyto!(ls, q)
49
resize!(ls.loop_order, num_loops(ls))
src/memory_ops_common.jl
@@ -1,3 +1,18 @@
+function ref_from_expr(ex, offset1::Int, offset2::Int)
+ (ex.args[1 + offset1])::Symbol, @view(ex.args[2 + offset2:end])
+end
+ref_from_ref(ex::Expr) = ref_from_expr(ex, 0, 0)
+ref_from_getindex(ex::Expr) = ref_from_expr(ex, 1, 1)
+ref_from_setindex(ex::Expr) = ref_from_expr(ex, 1, 2)
+function ref_from_expr(ex::Expr)
+ if ex.head === :ref
+ ref_from_ref(ex)
+ else#if ex.head === :call
+ f = first(ex.args)::Symbol
+ f === :getindex ? ref_from_getindex(ex) : ref_from_setindex(ex)
+ end
+
add_vptr!(ls::LoopSet, op::Operation) = add_vptr!(ls, op.ref)
add_vptr!(ls::LoopSet, mref::ArrayReferenceMeta) = add_vptr!(ls, mref.ref.array, vptr(mref))
function add_vptr!(ls::LoopSet, array::Symbol, vptrarray::Symbol = vptr(array), actualarray::Bool = true, broadcast::Bool = false)
src/operations.jl
@@ -36,21 +36,6 @@ Base.:(==)(x::ArrayReference, y::ArrayReference) = isequal(x, y)
36
Base.:(==)(x::ArrayReferenceMeta, y::ArrayReferenceMeta) = isequal(x.ref, y.ref) && x.ptr === y.ptr
37
38
39
-function ref_from_expr(ex, offset1::Int, offset2::Int)
40
- (ex.args[1 + offset1])::Symbol, @view(ex.args[2 + offset2:end])
41
-end
42
-ref_from_ref(ex::Expr) = ref_from_expr(ex, 0, 0)
-ref_from_getindex(ex::Expr) = ref_from_expr(ex, 1, 1)
-ref_from_setindex(ex::Expr) = ref_from_expr(ex, 1, 2)
-function ref_from_expr(ex::Expr)
- if ex.head === :ref
- ref_from_ref(ex)
- else#if ex.head === :call
- f = first(ex.args)::Symbol
50
- f === :getindex ? ref_from_getindex(ex) : ref_from_setindex(ex)
51
- end
52
53
-
54
Base.:(==)(x::ArrayReference, y::ArrayReferenceMeta) = x == y.ref
55
Base.:(==)(x::ArrayReferenceMeta, y::ArrayReference) = x.ref == y
56
Base.:(==)(x::ArrayReference, y) = false
test/runtests.jl
@@ -28,7 +28,7 @@ end
28
@test occursin("Operation[", s)
29
@test occursin("s = 0", s)
30
@test occursin("s = LoopVectorization.vfmadd", s)
31
+# using LoopVectorization
32
@time @testset "dot" begin
33
dotq = :(for i ∈ eachindex(a,b)
34
s += a[i]*b[i]
@@ -395,6 +395,13 @@ end
395
y[i] = yᵢ
396
end
397
398
+ q = :(for i ∈ eachindex(y)
399
+ yᵢ = zero(eltype(y))
400
+ for j ∈ eachindex(x)
401
+ yᵢ += A[i,j] * x[j]
402
403
+ y[i] = yᵢ
404
+ end)
405
function mygemv_avx!(y, A, x)
406
@_avx for i ∈ eachindex(y)
407
yᵢ = zero(eltype(y))
0 commit comments