-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Allow non-Int64 indices in scatter #543
Conversation
3d36089
to
c19277b
Compare
c19277b
to
3571306
Compare
src/scatter.jl
Outdated
@inline _atomix_convert_i64(x::Int64) = x | ||
@inline _atomix_convert_i64(x::Integer) = Int(x) | ||
@inline _atomix_convert_i64(x) = x |
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.
What does the _atomix_
here mean?
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 guess I just wanted to "signal" that it is related to Atomix.IndexableRef
initially. Renamed to _convert_i64
.
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.
Also, I forgot to mention that casting to Int
is only needed for atomics, where we take Atomix.pointer(::Atomix.IndexableRef)
which works only with Int
type.
4d18497
to
103ed32
Compare
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.
LGTM, merge when ready
Int64
indices in scatter by promoting them toInt64
inside the kernel.This is especially useful when performing reduction over big arrays into a few bins.
Indices can be of
Int8
type, saving a lot of space.Test_Enzyme
. I guess the intention was to disallow any Julia 1.10 version.PR Checklist