-
Notifications
You must be signed in to change notification settings - Fork 37
Move AbsractDevice
related methods to ArrayInterfaceCore
#338
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
Conversation
These don't need `StaticInt` and are semantically related to `AbstractDevice` types in ArrayInterfaceCore: * `defines_strides` * `device` * `stride_preserving_index`
How do we decide if something belongs in ArrayInterface or ArrayInterfaceCore? |
I think we were originally just putting whatever didn't require |
But, functions in ArrayInterfaceCore shouldn't need ArrayInterface to actually work. That would make them unreliable. So yes, it's things don't require Static and don't have dispatches on Base types that require Static |
Codecov Report
@@ Coverage Diff @@
## master #338 +/- ##
==========================================
- Coverage 90.11% 90.06% -0.05%
==========================================
Files 9 9
Lines 1345 1319 -26
==========================================
- Hits 1212 1188 -24
+ Misses 133 131 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. |
Sometimes the line is bit blurry. #335 is an effort to disentangle the bulk of methods that don't actually require Static.jl but use it under the hood. A lot of methods aren't included in ArrayInterfaceCore because they accept a So I've been trying to just chip away at this bit by bit, starting with cases like this where |
Was the consensus that this doesn't belong in ArrayInterfaceCore? |
That kind of piracy would change the semantics of the default method depending on whether you have only core or not. That leads to spooky action at a distance and shouldn't be done (because then the default behavior can change if someone else brings in ArrayInterface, which is likely). So we should stick to where there's a true full separation. Also note that there was a bit of a practical definition there. Almost all of the uses of ArrayInterface used 0 of the Static methods, but >99% of the load time comes from the Static methods. So it just made sense to fix load times in SciML, Flux, etc. by just making the Static stuff a separate package. In some sense, it's still a bit odd that the two are together, or that it's not ArrayInterfaceStatic built on ArrayInterface, but I don't have to care about that because if it doesn't effect most packages using ArrayInterface then it's not my problem. Most of the proposed static uses can probably work just fine using effects in the right way. |
Perhaps it would make sense to instead define This PR doesn't have that issue though. There's no need for |
These don't need
StaticInt
and are semantically related toAbstractDevice
types in ArrayInterfaceCore:defines_strides
device
stride_preserving_index