-
Notifications
You must be signed in to change notification settings - Fork 220
WIP: Implement __setitem__
for DeviceBuffer
#351
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
Please update the changelog in order to start CI tests. View the gpuCI docs here. |
What is this doing? |
Initially PR ( dask/distributed#3732 ) was using Numba to view and write into |
Can you explain what |
|
rng = range(self.size)[key] | ||
if not isinstance(rng, range): | ||
rng = range(rng, rng + 1) |
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.
We should probably handle negative slices / scalars here
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.
Negative indices are normalized by slicing the range
object.
In [1]: range(5)[-1]
Out[1]: 4
Currently we are raising an error for negative indices or any other step size that is not 1
since this could be a bit tricky to do in practice and it's unclear if we have use cases for those yet.
@jakirkham @kkraus14 what are the plans for this? Moving to 0.16. |
I think we still want this. Has slipped lately though due to other priorities. Will take a look after the release. |
This PR has been marked rotten due to no recent activity in the past 90d. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. |
This PR has been marked stale due to no recent activity in the past 30d. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be marked rotten if there is no activity in the next 60d. |
@jakirkham @kkraus14 can we close this? |
Yes, closing this for now. Feel free to reopen if desired. |
Yeah sounds good. I think people can probably just use CuPy or Numba for this today |
This is a rough first pass at implementing
__setitem__
forDeviceBuffer
. It works based on a quick check, but the error handling could be improved.