-
Notifications
You must be signed in to change notification settings - Fork 41
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
Turn off struct broadcast by default. #260
Conversation
src/StructArrays.jl
Outdated
@@ -38,5 +38,6 @@ function GPUArraysCore.backend(::Type{T}) where {T<:StructArray} | |||
isconsistent || throw(ArgumentError("all component arrays must have the same GPU backend")) | |||
return backend | |||
end | |||
_use_default_bc(::GPUArraysCore.AbstractGPUArrayStyle) = true |
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 think this could have a full, explicit name and a docstring, as packages that create custom arrays might wish to overload it. Should this be called use_structarray_broadcast
instead? If I understand correctly, we are asking whether to use the StructArrays broadcast machinery or not.
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.
It actually asked if the BroadcastStyle
fallbacks to the copy
method defined in Base.Broadcast
.
Perhaps renamed as has_copy_overloaded
?
Edit: My fault, the broadcast overloading is tricky thus perhaps always_structarray_broadcast
is better.
I'll add what kind of style could should return true
in doc string.
Sorry for the very late review, I've been swamped lately! It mostly looks good, I've left a couple of small comments. |
This makes sure `Tuple`'s axes static during struct static broadcast.
LGTM! I've made some small wording changes, if you are happy with those I can just accept them and merge. |
LGTM! |
This PR limits the struct broadcast to supported array types. (
Array
,GPUArray
...)Unsupported array types (
SparseArray
) now do broadcast by ignoring theStructArray
wrapper.close #259