diff --git a/src/lowprecarrays.jl b/src/lowprecarrays.jl index 833f4c9..f376cd5 100644 --- a/src/lowprecarrays.jl +++ b/src/lowprecarrays.jl @@ -37,6 +37,7 @@ import LinearAlgebra: generic_matmatmul! function generic_matmatmul!(C::AbstractMatrix{Float32}, ta, tb, A::Union{LowPrecArray, AbstractMatrix{BFloat16}}, B::Union{LowPrecArray, AbstractMatrix{BFloat16}}) + @info "hello" generic_matmatmul!(C, ta, tb, MatMulView(A), MatMulView(B)) end @@ -46,5 +47,6 @@ end function LinearAlgebra.BLAS.gemv!(trans::AbstractChar, alpha::Float32, A::AbstractVecOrMat{Float32}, X::AbstractVector{Float32}, beta::Float32, Y::LowPrecArray) + @info "hello" LinearAlgebra.BLAS.gemv!(trans, alpha, A, X, beta, Y.storage) end diff --git a/test/lowprecarrays.jl b/test/lowprecarrays.jl new file mode 100644 index 0000000..4faa2e8 --- /dev/null +++ b/test/lowprecarrays.jl @@ -0,0 +1,22 @@ +@testset "lowprecarrays" begin + A = rand(Float32, 10,10) + lpA = LowPrecArray(A) + + @test lpA isa LowPrecArray + @test size(A) == size(lpA) + + lpA[3] = 4 + @test lpA[3] == A[3] + + a = BFloat16s.ExpandingBFloat16(1f0) + b = BFloat16s.ExpandingBFloat16(1f0) + + @test a isa BFloat16s.ExpandingBFloat16 + @test a.a isa BFloat16 + + B = LowPrecArray(rand(Float32, 10,10)) + C = LowPrecArray(rand(Float32, 10,10)) + + lpA .= B*C + +end # @testset "lowprecarrays" \ No newline at end of file