-
Notifications
You must be signed in to change notification settings - Fork 69
Support real and complex inputs for sparse matmul #2353
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: main
Are you sure you want to change the base?
Conversation
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/internal_rules.jl b/src/internal_rules.jl
index c425978..5bf347a 100644
--- a/src/internal_rules.jl
+++ b/src/internal_rules.jl
@@ -912,7 +912,7 @@ function EnzymeRules.reverse(
nothing
end
end
-
+
return (nothing, nothing, nothing, dα, dβ)
end
diff --git a/test/internal_rules.jl b/test/internal_rules.jl
index 5aa25c9..5135cc2 100644
--- a/test/internal_rules.jl
+++ b/test/internal_rules.jl
@@ -727,15 +727,15 @@ end
tout = promote_type(eltype(M), eltype(v), typeof(α), typeof(β))
C = zeros(tout, 5)
- for Tret in (Duplicated, BatchDuplicated), TM in (Const, Duplicated, BatchDuplicated), Tv in (Const, Duplicated, BatchDuplicated),
- Tα in (Const, Active), Tβ in (Const, Active)
+ for Tret in (Duplicated, BatchDuplicated), TM in (Const, Duplicated, BatchDuplicated), Tv in (Const, Duplicated, BatchDuplicated),
+ Tα in (Const, Active), Tβ in (Const, Active)
are_activities_compatible(Tret, Tret, TM, Tv, Tα, Tβ) || continue
test_reverse(LinearAlgebra.mul!, Tret, (C, Tret), (M, TM), (v, Tv), (α, Tα), (β, Tβ))
end
- for Tret in (Duplicated, BatchDuplicated), TM in (Const, Duplicated, BatchDuplicated),
- Tv in (Const, Duplicated, BatchDuplicated), bα in (true, false), bβ in (true, false)
+ for Tret in (Duplicated, BatchDuplicated), TM in (Const, Duplicated, BatchDuplicated),
+ Tv in (Const, Duplicated, BatchDuplicated), bα in (true, false), bβ in (true, false)
are_activities_compatible(Tret, Tret, TM, Tv) || continue
test_reverse(LinearAlgebra.mul!, Tret, (C, Tret), (M, Const), (v, Tv), (bα, Const), (bβ, Const))
end
@@ -756,16 +756,16 @@ end
v = randn(tv, 3, 3)
α = rand(tα)
β = rand(tβ)
-
- for Tret in (Duplicated, BatchDuplicated), TM in (Const, Duplicated, BatchDuplicated), Tv in (Const, Duplicated, BatchDuplicated),
- Tα in (Const, Active), Tβ in (Const, Active)
+
+ for Tret in (Duplicated, BatchDuplicated), TM in (Const, Duplicated, BatchDuplicated), Tv in (Const, Duplicated, BatchDuplicated),
+ Tα in (Const, Active), Tβ in (Const, Active)
are_activities_compatible(Tret, Tret, TM, Tv, Tα, Tβ) || continue
test_reverse(LinearAlgebra.mul!, Tret, (C, Tret), (M, TM), (v, Tv), (α, Tα), (β, Tβ))
end
- for Tret in (Duplicated, BatchDuplicated), TM in (Const, Duplicated, BatchDuplicated),
- Tv in (Const, Duplicated, BatchDuplicated), bα in (true, false), bβ in (true, false)
+ for Tret in (Duplicated, BatchDuplicated), TM in (Const, Duplicated, BatchDuplicated),
+ Tv in (Const, Duplicated, BatchDuplicated), bα in (true, false), bβ in (true, false)
are_activities_compatible(Tret, Tret, TM, Tv) || continue
test_reverse(LinearAlgebra.mul!, Tret, (C, Tret), (M, Const), (v, Tv), (bα, Const), (bβ, Const))
end |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2353 +/- ##
==========================================
+ Coverage 67.50% 70.31% +2.81%
==========================================
Files 31 56 +25
Lines 12668 16694 +4026
==========================================
+ Hits 8552 11739 +3187
- Misses 4116 4955 +839 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Oh shoot when I formatted something got copied incorrectly fixing now |
This fixes #2321 and explicitly supports arguments that mix complex and real arrays.
The logic is annoying, so it would be good to review this since I made several choices.