From d22a56c8d3d1f76393720c2f309c47d7d37bea7d Mon Sep 17 00:00:00 2001 From: Vedant Puri Date: Wed, 25 Oct 2023 12:07:53 -0400 Subject: [PATCH] add missing `LinearAlgebra` methods on GPU (#226) --- ext/ComponentArraysGPUArraysExt.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/ComponentArraysGPUArraysExt.jl b/ext/ComponentArraysGPUArraysExt.jl index a0799afd..3b9a56e5 100644 --- a/ext/ComponentArraysGPUArraysExt.jl +++ b/ext/ComponentArraysGPUArraysExt.jl @@ -21,6 +21,9 @@ function Base.fill!(A::GPUComponentArray{T}, x) where {T} end LinearAlgebra.dot(x::GPUComponentArray, y::GPUComponentArray) = dot(getdata(x), getdata(y)) +LinearAlgebra.dot(x::GPUComponentArray, y::AbstractGPUArray) = dot(getdata(x), y) +LinearAlgebra.dot(x::AbstractGPUArray, y::GPUComponentArray) = dot(x, getdata(y)) + LinearAlgebra.norm(ca::GPUComponentArray, p::Real) = norm(getdata(ca), p) LinearAlgebra.rmul!(ca::GPUComponentArray, b::Number) = GPUArrays.generic_rmul!(ca, b)