Skip to content

Commit e9e9eea

Browse files
authored
Remove usage of buffers (#81) (#85)
* Remove usage of buffers * v0.7.8
1 parent 9bf880c commit e9e9eea

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ArrayLayouts"
22
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
33
authors = ["Sheehan Olver <solver@mac.com>"]
4-
version = "0.7.7"
4+
version = "0.7.8"
55

66
[deps]
77
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"

src/ArrayLayouts.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import Base.Broadcast: BroadcastStyle, AbstractArrayStyle, Broadcasted, broadcas
3434
combine_eltypes, DefaultArrayStyle, instantiate, materialize,
3535
materialize!, eltypes
3636

37-
import LinearAlgebra: AbstractTriangular, AbstractQ, checksquare, pinv, fill!, tilebufsize, Abuf, Bbuf, Cbuf, factorize, qr, lu, cholesky,
37+
import LinearAlgebra: AbstractTriangular, AbstractQ, checksquare, pinv, fill!, tilebufsize, factorize, qr, lu, cholesky,
3838
norm2, norm1, normInf, normMinusInf, qr, lu, qr!, lu!, AdjOrTrans, HermOrSym, copy_oftype,
3939
AdjointAbsVec, TransposeAbsVec, cholcopy, checknonsingular, _apply_ipiv_rows!, ipiv2perm, RealHermSymComplexHerm, chkfullrank
4040

src/muladd.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ function tiled_blasmul!(tile_size, α, A::AbstractMatrix{T}, B::AbstractMatrix{S
9898
@inbounds begin
9999
sz = (tile_size, tile_size)
100100
# FIXME: This code is completely invalid!!!
101-
Atile = unsafe_wrap(Array, convert(Ptr{T}, pointer(Abuf[Threads.threadid()])), sz)
102-
Btile = unsafe_wrap(Array, convert(Ptr{S}, pointer(Bbuf[Threads.threadid()])), sz)
101+
Atile = Array{T}(undef, sz)
102+
Btile = Array{S}(undef, sz)
103103

104104
z1 = zero(A[1, 1]*B[1, 1] + A[1, 1]*B[1, 1])
105105
z = convert(promote_type(typeof(z1), R), z1)
@@ -119,8 +119,7 @@ function tiled_blasmul!(tile_size, α, A::AbstractMatrix{T}, B::AbstractMatrix{S
119119
end
120120
end
121121
else
122-
# FIXME: This code is completely invalid!!!
123-
Ctile = unsafe_wrap(Array, convert(Ptr{R}, pointer(Cbuf[Threads.threadid()])), sz)
122+
Ctile = Array{R}(undef, sz)
124123
for jb = 1:tile_size:nB
125124
jlim = min(jb+tile_size-1,nB)
126125
jlen = jlim-jb+1

test/test_muladd.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,4 +686,10 @@ Random.seed!(0)
686686
@test typeof(mul(Diag,Tridiag)) <: Tridiagonal
687687
@test typeof(mul(Diag,SymTri)) <: Tridiagonal
688688
end
689+
690+
@testset "tiled_blasmul!" begin
691+
X = randn(ComplexF64, 8, 4)
692+
Y = randn(8, 2)
693+
@test all(mul(Y',X) .=== Y'X)
694+
end
689695
end

0 commit comments

Comments
 (0)