-
Notifications
You must be signed in to change notification settings - Fork 29
Support Julia 1.12 #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Support Julia 1.12 #529
Conversation
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/lib/mkl/interfaces.jl b/lib/mkl/interfaces.jl
index 1ef1829..0558d8c 100644
--- a/lib/mkl/interfaces.jl
+++ b/lib/mkl/interfaces.jl
@@ -12,26 +12,26 @@ LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSR{
LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSC{T}, B::oneMatrix{T}, _add::MulAddMul) where {T <: Union{Float16, ComplexF16, BlasFloat}} =
LinearAlgebra.generic_matmatmul!(C, tA, tB, A, B, _add.alpha, _add.beta)
-function LinearAlgebra.generic_matvecmul!(C::oneVector{T}, tA::AbstractChar, A::oneSparseMatrixCSR{T}, B::oneVector{T}, alpha::Number, beta::Number) where T <: BlasFloat
+function LinearAlgebra.generic_matvecmul!(C::oneVector{T}, tA::AbstractChar, A::oneSparseMatrixCSR{T}, B::oneVector{T}, alpha::Number, beta::Number) where {T <: BlasFloat}
tA = tA in ('S', 's', 'H', 'h') ? 'N' : tA
- sparse_gemv!(tA, alpha, A, B, beta, C)
+ return sparse_gemv!(tA, alpha, A, B, beta, C)
end
-function LinearAlgebra.generic_matvecmul!(C::oneVector{T}, tA::AbstractChar, A::oneSparseMatrixCSC{T}, B::oneVector{T}, alpha::Number, beta::Number) where T <: BlasReal
+function LinearAlgebra.generic_matvecmul!(C::oneVector{T}, tA::AbstractChar, A::oneSparseMatrixCSC{T}, B::oneVector{T}, alpha::Number, beta::Number) where {T <: BlasReal}
tA = tA in ('S', 's', 'H', 'h') ? 'T' : flip_trans(tA)
- sparse_gemv!(tA, alpha, A, B, beta, C)
+ return sparse_gemv!(tA, alpha, A, B, beta, C)
end
-function LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSR{T}, B::oneMatrix{T}, alpha::Number, beta::Number) where T <: BlasFloat
+function LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSR{T}, B::oneMatrix{T}, alpha::Number, beta::Number) where {T <: BlasFloat}
tA = tA in ('S', 's', 'H', 'h') ? 'N' : tA
tB = tB in ('S', 's', 'H', 'h') ? 'N' : tB
- sparse_gemm!(tA, tB, alpha, A, B, beta, C)
+ return sparse_gemm!(tA, tB, alpha, A, B, beta, C)
end
-function LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSC{T}, B::oneMatrix{T}, alpha::Number, beta::Number) where T <: BlasReal
+function LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSC{T}, B::oneMatrix{T}, alpha::Number, beta::Number) where {T <: BlasReal}
tA = tA in ('S', 's', 'H', 'h') ? 'T' : flip_trans(tA)
tB = tB in ('S', 's', 'H', 'h') ? 'N' : tB
- sparse_gemm!(tA, tB, alpha, A, B, beta, C)
+ return sparse_gemm!(tA, tB, alpha, A, B, beta, C)
end
function LinearAlgebra.generic_trimatdiv!(C::oneVector{T}, uploc, isunitc, tfun::Function, A::oneSparseMatrixCSR{T}, B::oneVector{T}) where T <: BlasFloat
diff --git a/lib/mkl/linalg.jl b/lib/mkl/linalg.jl
index 6aca07b..72c32a5 100644
--- a/lib/mkl/linalg.jl
+++ b/lib/mkl/linalg.jl
@@ -104,7 +104,7 @@ function LinearAlgebra.generic_matvecmul!(Y::oneVector, tA::AbstractChar, A::one
end
end
end
- LinearAlgebra.generic_matmatmul!(Y, tA, 'N', A, B, alpha, beta)
+ return LinearAlgebra.generic_matmatmul!(Y, tA, 'N', A, B, alpha, beta)
end
# triangular
@@ -126,7 +126,8 @@ if VERSION >= v"1.12-"
for blas_flag in (LinearAlgebra.BlasFlag.SyrkHerkGemm, LinearAlgebra.BlasFlag.SymmHemmGeneric)
@eval LinearAlgebra.generic_matmatmul_wrapper!(
C::oneStridedMatrix, tA::AbstractChar, tB::AbstractChar, A::oneStridedVecOrMat, B::oneStridedVecOrMat,
- alpha::Number, beta::Number, ::$blas_flag) =
+ alpha::Number, beta::Number, ::$blas_flag
+ ) =
LinearAlgebra.generic_matmatmul!(C, tA, tB, A, B, alpha, beta)
end
end
diff --git a/src/compiler/reflection.jl b/src/compiler/reflection.jl
index 8539eef..ddc9eed 100644
--- a/src/compiler/reflection.jl
+++ b/src/compiler/reflection.jl
@@ -75,5 +75,5 @@ function return_type(@nospecialize(func), @nospecialize(tt))
job = CompilerJob(source, config)
interp = GPUCompiler.get_interpreter(job)
sig = Base.signature_type(func, tt)
- Core.Compiler._return_type(interp, sig)
+ return Core.Compiler._return_type(interp, sig)
end
diff --git a/test/execution.jl b/test/execution.jl
index 596d0d8..1a7b654 100644
--- a/test/execution.jl
+++ b/test/execution.jl
@@ -307,12 +307,12 @@ end
@oneapi kernel(arr)
@test Array(arr)[] == 1
- function kernel2(ptr)
+ function kernel2(ptr)
ptr[] = 2
return
end
- @oneapi kernel2(arr)
+ @oneapi kernel2(arr)
@test Array(arr)[] == 2
end
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #529 +/- ##
=======================================
Coverage 79.70% 79.70%
=======================================
Files 45 45
Lines 2818 2818
=======================================
Hits 2246 2246
Misses 572 572 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the one indent issue, this looks good to me.
I tested the change and it fixes the problem for me.
Thanks for creating and submitting the PR!
src/broadcast.jl
Outdated
Broadcast.BroadcastStyle( | ||
::oneArrayStyle{N, B1}, | ||
::oneArrayStyle{N, B2}) where {N,B1,B2} = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both arguments should be indented identically or there should be no line break at all. I think 91 characters is still reasonable.
Broadcast.BroadcastStyle( | |
::oneArrayStyle{N, B1}, | |
::oneArrayStyle{N, B2}) where {N,B1,B2} = | |
Broadcast.BroadcastStyle(::oneArrayStyle{N, B1}, ::oneArrayStyle{N, B2}) where {N,B1,B2} = |
@maleadt Anything I can do here about? JuliaGPU/GPUCompiler.jl#101
|
Normally we add a quirk to avoid widening to 128-bits integers. |
Fixed by avoiding |
8ec8249
to
c2ad19b
Compare
@michel2323 JuliaGPU/OpenCL.jl#380 (and JuliaGPU/Metal.jl#576 and JuliaGPU/CUDA.jl#2917) has the fix for the current 1.12 error. |
Oh thanks so much! |
With Julia 1.12 officially released, is there a reason not to merge this PR in its current state? It might not be perfect, but it probably is still better than "even the most simple case is not working at all". Follow-up PRs should still be possible. |
No description provided.