-
Notifications
You must be signed in to change notification settings - Fork 256
Add some matrix functions for symm/herm #2962
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
Open
kshyatt
wants to merge
1
commit into
master
Choose a base branch
from
ksh/matrix_fns
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+40
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/lib/cusolver/linalg.jl b/lib/cusolver/linalg.jl
index 4ed2a372d..3aad894f3 100644
--- a/lib/cusolver/linalg.jl
+++ b/lib/cusolver/linalg.jl
@@ -143,11 +143,11 @@ end
# matrix functions
for func in (:(Base.exp), :(Base.cos), :(Base.sin), :(Base.tan), :(Base.cosh), :(Base.sinh), :(Base.tanh), :(Base.atan), :(Base.asinh), :(Base.atanh), :(Base.cbrt))
@eval begin
- function ($func)(A::Symmetric{T, <:StridedCuMatrix}) where {T<:BlasReal}
+ function ($func)(A::Symmetric{T, <:StridedCuMatrix}) where {T <: BlasReal}
F = eigen(A)
return Symmetric((F.vectors * Diagonal(($func).(F.values))) * F.vectors')
end
- function ($func)(A::Hermitian{T, <:StridedCuMatrix}) where {T<:BlasReal}
+ function ($func)(A::Hermitian{T, <:StridedCuMatrix}) where {T <: BlasReal}
F = eigen(A)
return Hermitian((F.vectors * Diagonal(($func).(F.values))) * F.vectors')
end |
d7caf58 to
2e337d6
Compare
Contributor
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.
CUDA.jl Benchmarks
| Benchmark suite | Current: 2e337d6 | Previous: 1e35ff7 | Ratio |
|---|---|---|---|
latency/precompile |
56526512594 ns |
57073264350 ns |
0.99 |
latency/ttfp |
8372733969 ns |
8361242115.5 ns |
1.00 |
latency/import |
4495232086 ns |
4520871512 ns |
0.99 |
integration/volumerhs |
9623228.5 ns |
9609145.5 ns |
1.00 |
integration/byval/slices=1 |
146712 ns |
146784 ns |
1.00 |
integration/byval/slices=3 |
425560 ns |
425930 ns |
1.00 |
integration/byval/reference |
144948 ns |
144913 ns |
1.00 |
integration/byval/slices=2 |
286219 ns |
286275 ns |
1.00 |
integration/cudadevrt |
103443 ns |
103477 ns |
1.00 |
kernel/indexing |
14259 ns |
14088 ns |
1.01 |
kernel/indexing_checked |
15019 ns |
14920 ns |
1.01 |
kernel/occupancy |
670.0696202531645 ns |
670.5283018867924 ns |
1.00 |
kernel/launch |
2147.5555555555557 ns |
2192.1111111111113 ns |
0.98 |
kernel/rand |
15861 ns |
18597.5 ns |
0.85 |
array/reverse/1d |
19880 ns |
19990 ns |
0.99 |
array/reverse/2dL_inplace |
66766 ns |
66851 ns |
1.00 |
array/reverse/1dL |
69999 ns |
70214 ns |
1.00 |
array/reverse/2d |
21834 ns |
21764 ns |
1.00 |
array/reverse/1d_inplace |
9955 ns |
9644 ns |
1.03 |
array/reverse/2d_inplace |
13229 ns |
11083 ns |
1.19 |
array/reverse/2dL |
73829 ns |
73680.5 ns |
1.00 |
array/reverse/1dL_inplace |
66902 ns |
66780 ns |
1.00 |
array/copy |
20788 ns |
20656 ns |
1.01 |
array/iteration/findall/int |
157366 ns |
157234 ns |
1.00 |
array/iteration/findall/bool |
139781 ns |
139637.5 ns |
1.00 |
array/iteration/findfirst/int |
162437.5 ns |
161491 ns |
1.01 |
array/iteration/findfirst/bool |
162944.5 ns |
161981.5 ns |
1.01 |
array/iteration/scalar |
73361 ns |
72914 ns |
1.01 |
array/iteration/logical |
216385.5 ns |
215503 ns |
1.00 |
array/iteration/findmin/1d |
51485 ns |
52893.5 ns |
0.97 |
array/iteration/findmin/2d |
96578 ns |
96673.5 ns |
1.00 |
array/reductions/reduce/Int64/1d |
43801 ns |
43374 ns |
1.01 |
array/reductions/reduce/Int64/dims=1 |
48298 ns |
44924.5 ns |
1.08 |
array/reductions/reduce/Int64/dims=2 |
61637 ns |
61289 ns |
1.01 |
array/reductions/reduce/Int64/dims=1L |
88743 ns |
89013 ns |
1.00 |
array/reductions/reduce/Int64/dims=2L |
88050 ns |
88275 ns |
1.00 |
array/reductions/reduce/Float32/1d |
37741.5 ns |
37043 ns |
1.02 |
array/reductions/reduce/Float32/dims=1 |
42392.5 ns |
43018 ns |
0.99 |
array/reductions/reduce/Float32/dims=2 |
60016 ns |
59774 ns |
1.00 |
array/reductions/reduce/Float32/dims=1L |
52204 ns |
52409 ns |
1.00 |
array/reductions/reduce/Float32/dims=2L |
72239 ns |
72278 ns |
1.00 |
array/reductions/mapreduce/Int64/1d |
43587 ns |
43540 ns |
1.00 |
array/reductions/mapreduce/Int64/dims=1 |
52873.5 ns |
45057.5 ns |
1.17 |
array/reductions/mapreduce/Int64/dims=2 |
61427 ns |
61470 ns |
1.00 |
array/reductions/mapreduce/Int64/dims=1L |
88867 ns |
88923 ns |
1.00 |
array/reductions/mapreduce/Int64/dims=2L |
88334.5 ns |
88349 ns |
1.00 |
array/reductions/mapreduce/Float32/1d |
37950.5 ns |
36698 ns |
1.03 |
array/reductions/mapreduce/Float32/dims=1 |
41864.5 ns |
41442 ns |
1.01 |
array/reductions/mapreduce/Float32/dims=2 |
59855 ns |
59908 ns |
1.00 |
array/reductions/mapreduce/Float32/dims=1L |
52441 ns |
52585 ns |
1.00 |
array/reductions/mapreduce/Float32/dims=2L |
72155 ns |
72014 ns |
1.00 |
array/broadcast |
19857 ns |
20078 ns |
0.99 |
array/copyto!/gpu_to_gpu |
11329 ns |
12908 ns |
0.88 |
array/copyto!/cpu_to_gpu |
214313.5 ns |
213437 ns |
1.00 |
array/copyto!/gpu_to_cpu |
283907 ns |
283206 ns |
1.00 |
array/accumulate/Int64/1d |
124824 ns |
124198 ns |
1.01 |
array/accumulate/Int64/dims=1 |
83387 ns |
83165 ns |
1.00 |
array/accumulate/Int64/dims=2 |
157802 ns |
157631 ns |
1.00 |
array/accumulate/Int64/dims=1L |
1709895.5 ns |
1709733 ns |
1.00 |
array/accumulate/Int64/dims=2L |
966630 ns |
966057.5 ns |
1.00 |
array/accumulate/Float32/1d |
109134 ns |
108414 ns |
1.01 |
array/accumulate/Float32/dims=1 |
80525 ns |
79731.5 ns |
1.01 |
array/accumulate/Float32/dims=2 |
147654.5 ns |
146657 ns |
1.01 |
array/accumulate/Float32/dims=1L |
1618976.5 ns |
1616606.5 ns |
1.00 |
array/accumulate/Float32/dims=2L |
698299.5 ns |
697417 ns |
1.00 |
array/construct |
1267.7 ns |
1271.5 ns |
1.00 |
array/random/randn/Float32 |
48182 ns |
45612 ns |
1.06 |
array/random/randn!/Float32 |
24994 ns |
24822 ns |
1.01 |
array/random/rand!/Int64 |
27284 ns |
27264 ns |
1.00 |
array/random/rand!/Float32 |
8850 ns |
8854 ns |
1.00 |
array/random/rand/Int64 |
31309.5 ns |
29823 ns |
1.05 |
array/random/rand/Float32 |
13005 ns |
13073 ns |
0.99 |
array/permutedims/4d |
60165 ns |
59525 ns |
1.01 |
array/permutedims/2d |
53938.5 ns |
53919 ns |
1.00 |
array/permutedims/3d |
54676 ns |
54583 ns |
1.00 |
array/sorting/1d |
2757835 ns |
2757051 ns |
1.00 |
array/sorting/by |
3344388.5 ns |
3344047 ns |
1.00 |
array/sorting/2d |
1081134 ns |
1080794 ns |
1.00 |
cuda/synchronization/stream/auto |
1037.1 ns |
1034 ns |
1.00 |
cuda/synchronization/stream/nonblocking |
8373.400000000001 ns |
8105 ns |
1.03 |
cuda/synchronization/stream/blocking |
833.2760416666667 ns |
796.4842105263158 ns |
1.05 |
cuda/synchronization/context/auto |
1172.2 ns |
1198.2 ns |
0.98 |
cuda/synchronization/context/nonblocking |
7213 ns |
8018.6 ns |
0.90 |
cuda/synchronization/context/blocking |
916.9090909090909 ns |
918.6428571428571 ns |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
2f0c6df to
80d7c67
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.