-
Notifications
You must be signed in to change notification settings - Fork 70
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
Backends are adaptors #364
Conversation
# Define: | ||
# adapt_storage(::Backend, a::Array) = adapt(BackendArray, a) | ||
# adapt_storage(::Backend, a::BackendArray) = a | ||
Adapt.adapt_storage(::CPU, a::Array) = a |
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.
Why the instance and not the type?
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.
You mean the ::Type{CPU}
< I thought we defined adaptors over the instance. The user might not have the backend type around, but they should always have an instance.
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.
well, for CuArray we do adapt(CuArray, obj)
, i.e., specifying the type because that's likely the only thing you have at that point. If users don't explicitly mention the backend types I guess it would be fine to use the instance here.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #364 +/- ##
==========================================
- Coverage 88.95% 88.42% -0.53%
==========================================
Files 8 8
Lines 534 579 +45
==========================================
+ Hits 475 512 +37
- Misses 59 67 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
No description provided.