-
Notifications
You must be signed in to change notification settings - Fork 31
Add missing BroadcastStyle and MemoryLayouts for cache styles #387
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: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,8 @@ cache_layout(::AbstractStridedLayout, O::AbstractArray) = copy(O) | |||||
|
|
||||||
| const _cache = cache_layout # TODO: deprecate | ||||||
| cacheddata(A::AbstractCachedArray) = view(A.data,OneTo.(A.datasize)...) | ||||||
| cacheddata(A::Adjoint{<:Any, <:AbstractCachedArray}) = adjoint(cacheddata(parent(A))) | ||||||
| cacheddata(A::Transpose{<:Any, <:AbstractCachedArray}) = transpose(cacheddata(parent(A))) | ||||||
|
|
||||||
| maybe_cacheddata(A::AbstractCachedArray) = cacheddata(A) | ||||||
| maybe_cacheddata(A::SubArray{<:Any,N,<:AbstractCachedArray}) where N = cacheddata(A) | ||||||
|
|
@@ -333,6 +335,9 @@ MemoryLayout(C::Type{CachedArray{T,N,DAT,ARR}}) where {T,N,DAT,ARR} = cachedlayo | |||||
|
|
||||||
| MemoryLayout(::Type{<:AbstractCachedArray}) = GenericCachedLayout() | ||||||
|
|
||||||
| transposelayout(::GenericCachedLayout) = GenericCachedLayout() | ||||||
|
||||||
| transposelayout(::GenericCachedLayout) = GenericCachedLayout() | |
| transposelayout(::AbstractCachedLayout) = GenericCachedLayout() |
(also next line)
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.
Do we also need to support adjoints of views of cached arrays?
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 don't think that comes up but I can add support for it anyway
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.
There's no reason to assume the parent is an
AbstractCachedArray(it could just conform to the cached array interface):