-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fix and test for issue 100 #103
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #103 +/- ##
==========================================
+ Coverage 85.37% 85.49% +0.11%
==========================================
Files 30 30
Lines 3268 3274 +6
==========================================
+ Hits 2790 2799 +9
+ Misses 478 475 -3 ☔ View full report in Codecov by Sentry. |
src/orthonormal.jl
Outdated
@@ -62,6 +62,19 @@ LinearAlgebra.mul!(y, b::OrthonormalBasis, x::AbstractVector) = unproject!!(y, b | |||
|
|||
const BLOCKSIZE = 4096 | |||
|
|||
# helper function to determine if a multithreaded approach should be used | |||
# this uses functionality beyond VectorInterface, but can be faster | |||
_use_multithreaded_array_kernel(y) = false |
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.
Maybe, in order to avoid duplication of cases:
_use_multithreaded_array_kernel(y) = _use_multithreaded_array_kernel(typeof(y))
_use_multithreaded_array_kernel(::Type) = false
function _use_multithreaded_array_kernel(::Type{<:Array{T}}) where {T<:Number}
return isbitstype(T) && get_num_threads() > 1
end
function _use_multithreaded_array_kernel(::Type{<:OrthonormalBasis{T}}) where {T}
return _use_multithreaded_array_kernel(T)
end
Looks good. Could you also check if this is the only reason why GPUArraysCore.jl was introduced as dependency, and if so, remove it from Project.toml? |
@@ -1,10 +1,9 @@ | |||
name = "KrylovKit" | |||
uuid = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" | |||
authors = ["Jutho Haegeman"] | |||
version = "0.8.2" | |||
version = "0.8.3" |
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.
With the new functionality of the other PR, I would probably go to 0.9. Unless you need this as quickly as possible (I guess the other one would take a few more changes and one more CI run) and want to already tag this right now. I can then also change to 0.9 after merging #105 .
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.
I think it would be convenient for me if it was 0.8.3, since the RecursiveVec thing broke things... In the end, it does not matter too much, I changed this here to test it out with MPSKit
Feel free to merge when you see fit. |
This is a more conservative approach to using the multithreaded kernels, which could even be reenabled by users by overloading the
_use_multithreaded_array_kernel
.Fixes #100