From 02d84c7df96551351c1db8a8cb714d66c26e5af2 Mon Sep 17 00:00:00 2001 From: kmp5VT Date: Sun, 8 Oct 2023 12:38:39 -0400 Subject: [PATCH] Throw an error if trying to compute qr or ql positive --- NDTensors/src/linearalgebra/linearalgebra.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NDTensors/src/linearalgebra/linearalgebra.jl b/NDTensors/src/linearalgebra/linearalgebra.jl index bd90e9a24f..c5ecab4baf 100644 --- a/NDTensors/src/linearalgebra/linearalgebra.jl +++ b/NDTensors/src/linearalgebra/linearalgebra.jl @@ -422,6 +422,9 @@ non-negative. Such a QR decomposition of a matrix is unique. Returns a tuple (Q,R). """ function qr_positive(M::AbstractMatrix) + if iscu(M) + throw("Currently qr positive methods do not work for CuArrays because they require scalar operations. Please convert to CPU Array or use generic qr") + end sparseQ, R = qr(M) Q = convert(typeof(R), sparseQ) nc = size(Q, 2) @@ -447,6 +450,9 @@ non-negative. Such a QL decomposition of a matrix is unique. Returns a tuple (Q,L). """ function ql_positive(M::AbstractMatrix) + if iscu(M) + throw("Currently ql positive methods do not work for CuArrays because they require scalar operations. Please convert to CPU Array or use generic ql") + end sparseQ, L = ql(M) Q = convert(typeof(L), sparseQ) nr, nc = size(L)