Add diag argument to copytri!#679
Conversation
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/host/linalg.jl b/src/host/linalg.jl
index ea4c89c..f5ebbc4 100644
--- a/src/host/linalg.jl
+++ b/src/host/linalg.jl
@@ -114,8 +114,8 @@ function LinearAlgebra.copytri!(A::AbstractGPUMatrix, uplo::AbstractChar, conjug
I = @index(Global, Cartesian)
i, j = Tuple(I)
if j + diag > i
- @inbounds _A[j,i] = conj(_A[i,j])
- end
+ @inbounds _A[j, i] = conj(_A[i, j])
+ end
end
U_conj!(get_backend(A))(A; ndrange = size(A))
elseif uplo == 'U' && !conjugate
@@ -123,8 +123,8 @@ function LinearAlgebra.copytri!(A::AbstractGPUMatrix, uplo::AbstractChar, conjug
I = @index(Global, Cartesian)
i, j = Tuple(I)
if j + diag > i
- @inbounds _A[j,i] = _A[i,j]
- end
+ @inbounds _A[j, i] = _A[i, j]
+ end
end
U_noconj!(get_backend(A))(A; ndrange = size(A))
elseif uplo == 'L' && conjugate
@@ -132,7 +132,7 @@ function LinearAlgebra.copytri!(A::AbstractGPUMatrix, uplo::AbstractChar, conjug
I = @index(Global, Cartesian)
i, j = Tuple(I)
if j + diag > i
- @inbounds _A[i,j] = conj(_A[j,i])
+ @inbounds _A[i, j] = conj(_A[j, i])
end
end
L_conj!(get_backend(A))(A; ndrange = size(A))
@@ -141,14 +141,14 @@ function LinearAlgebra.copytri!(A::AbstractGPUMatrix, uplo::AbstractChar, conjug
I = @index(Global, Cartesian)
i, j = Tuple(I)
if j + diag > i
- @inbounds _A[i,j] = _A[j,i]
+ @inbounds _A[i, j] = _A[j, i]
end
end
L_noconj!(get_backend(A))(A; ndrange = size(A))
else
throw(ArgumentError("uplo argument must be 'U' (upper) or 'L' (lower), got $uplo"))
end
- A
+ return A
end
## copy a triangular part of a matrix to another matrix |
|
I think runic's indentation is wrong. Look at these lines: The |
|
Yeah feel free to ignore Runic... |
|
Can you add Also, this seems to break CUDA.jl etc tests on <1.13: |
|
We're going to need to ignore the Buildkite error at the moment. It fails because CUDA.jl isn't working with Julia 1.13. That's a known problem, and a prerequisite for making it work is making GPUArrays.jl work with Julia 1.13... |
|
This is running tests on the |
|
... it's using |
|
CUDA.jl on 1.12 failing here but not on master, https://buildkite.com/julialang/gpuarrays-dot-jl/builds/1565, is interesting. I thought I fixed JuliaGPU/CUDA.jl#2946 in JuliaGPU/CUDA.jl#3016, maybe we need another quirk? |
|
The Julia 1.12 error is It seems that some part of the infrastructure generates code for a newer GPU than it should. |
|
I think I see what is happening. The CI machines have different GPUs:
The first supports The problem might be in the file |
|
Ping? I think this PR is ready. The Julia 1.12 problem seems unrelated. |
|
I want to make CUDA.jl work with Julia 1.13. One prerequisite is to make GPUArrays.jl work with Julia 1.13. Can you review this PR? |
|
I'll SSH into the GPU CI machine asap (tomorrow or Thursday) to diagnose the exact failure and get this merged. |
|
Re-started CI after merging JuliaGPU/CUDA.jl#3025. |
|
Thanks! |
Julia 1.13 added a
diag::Boolargument tocopytri!. We need to mimic that so that we can match the signature when overloading for GPUArrays.