Skip to content

Commit c69c210

Browse files
committed
Reverting removal of equality checks for ==; apparently they are unused, even though this is not caught in CodeCov.
1 parent 09cdd94 commit c69c210

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

src/constructors.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ end
103103
function check_tile(arg)
104104
a1 = (arg.args[1])::Symbol
105105
a1 === :tile || return nothing
106+
tup = arg.args[2]
107+
@assert length(tup.args) == 2
106108
U = convert(Int8, tup.args[1])
107109
T = convert(Int8, tup.args[2])
108110
U, T

src/operations.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ Base.:(==)(x::ArrayReference, y::ArrayReference) = isequal(x, y)
3636
Base.:(==)(x::ArrayReferenceMeta, y::ArrayReferenceMeta) = isequal(x.ref, y.ref) && x.ptr === y.ptr
3737

3838
# Errors preferable than silently working?
39-
# Base.:(==)(x::ArrayReference, y::ArrayReferenceMeta) = x == y.ref
40-
# Base.:(==)(x::ArrayReferenceMeta, y::ArrayReference) = x.ref == y
41-
# Base.:(==)(x::ArrayReference, y) = false
42-
# Base.:(==)(x::ArrayReferenceMeta, y) = false
39+
Base.:(==)(x::ArrayReference, y::ArrayReferenceMeta) = x == y.ref
40+
Base.:(==)(x::ArrayReferenceMeta, y::ArrayReference) = x.ref == y
41+
Base.:(==)(x::ArrayReference, y) = false
42+
Base.:(==)(x::ArrayReferenceMeta, y) = false
4343

4444
@enum OperationType begin
4545
constant

test/gemm.jl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,25 @@
174174
end
175175
end
176176

177+
function AmulB2x2avx!(C, A, B)
178+
@avx tile=(2,2) for m 1:size(A,1), n 1:size(B,2)
179+
ΔCₘₙ = zero(eltype(C))
180+
for k 1:size(A,2)
181+
ΔCₘₙ += A[m,k] * B[k,n]
182+
end
183+
C[m,n] = ΔCₘₙ
184+
end
185+
end
186+
function AmulB2x2_avx!(C, A, B)
187+
@_avx tile=(2,2) for m 1:size(A,1), n 1:size(B,2)
188+
ΔCₘₙ = zero(eltype(C))
189+
for k 1:size(A,2)
190+
ΔCₘₙ += A[m,k] * B[k,n]
191+
end
192+
C[m,n] = ΔCₘₙ
193+
end
194+
end
195+
177196
# function AtmulB!(C, A, B)
178197
# for j ∈ 1:size(C,2), i ∈ 1:size(C,1)
179198
# Cᵢⱼ = zero(eltype(C))
@@ -532,6 +551,10 @@
532551
@test C C2
533552
AmuladdBavx!(C, At', B, -2)
534553
@test C -C2
554+
fill!(C, 9999.999); AmulB2x2avx!(C, A, B);
555+
@test C C2
556+
fill!(C, 9999.999); AmulB2x2avx!(C, At', B);
557+
@test C C2
535558
fill!(C, 9999.999); AtmulBavx1!(C, At, B)
536559
@test C C2
537560
fill!(C, 9999.999); AtmulBavx1!(C, A', B)
@@ -570,6 +593,10 @@
570593
@test C C2
571594
AmuladdB_avx!(C, At', B, -2)
572595
@test C -C2
596+
fill!(C, 9999.999); AmulB2x2_avx!(C, A, B);
597+
@test C C2
598+
fill!(C, 9999.999); AmulB2x2_avx!(C, At', B);
599+
@test C C2
573600
fill!(C, 9999.999); AtmulB_avx1!(C, At, B)
574601
@test C C2
575602
fill!(C, 9999.999); AtmulB_avx1!(C, A', B)
@@ -604,6 +631,10 @@
604631
@test Cs C2
605632
AmuladdBavx!(Cs, Ats', Bs, -2)
606633
@test Cs -C2
634+
fill!(Cs, 9999.999); AmulB2x2avx!(Cs, As, Bs)
635+
@test Cs C2
636+
fill!(Cs, 9999.999); AmulB2x2avx!(Cs, Ats', Bs)
637+
@test Cs C2
607638
fill!(Cs, 9999.999); AtmulBavx1!(Cs, Ats, Bs)
608639
@test Cs C2
609640
fill!(Cs, 9999.999); AtmulBavx1!(Cs, As', Bs)
@@ -642,6 +673,10 @@
642673
@test Cs C2
643674
AmuladdB_avx!(Cs, Ats', Bs, -2)
644675
@test Cs -C2
676+
fill!(Cs, 9999.999); AmulB2x2_avx!(Cs, As, Bs)
677+
@test Cs C2
678+
fill!(Cs, 9999.999); AmulB2x2_avx!(Cs, Ats', Bs)
679+
@test Cs C2
645680
fill!(Cs, 9999.999); AtmulB_avx1!(Cs, Ats, Bs)
646681
@test Cs C2
647682
fill!(Cs, 9999.999); AtmulB_avx1!(Cs, As', Bs)

0 commit comments

Comments
 (0)