-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add test for reverse slicing #162
Conversation
Those are some weird semantics. I'd call that a bug. I'd prefer this to be true:
|
Sorry, I was a little bit too fast in writing the test. The error was not on the assert, but on the slicing I have just fixed the test |
That looks OK. I'd be happy to take a patch that makes this pass. |
I suppose that we need to trick cuda in order avoid the negative value in an unsigned int. |
I'd be OK with that, as long as it gives rise to correct behavior in all cases. |
Hi, I have been able to implement it. |
I actually don't see why a call to |
I am not sure if it is possible. When I tried to use a negative step, the CUDA api was raising an error due to the use of unsigned int. Anyway, I think that my work on the reverse function will be useful as now it is able to deal with discontinuous data |
I think it should be possible. Any data "footprint" that can be reached with negative strides can also be reached with "positive" strides. So, suppose we call that operation an "axis flip". Then you would pick out all the axes with negative strides, flip them, do the copy, and then flip them again. No additional code execution/second-stage data copying needed. |
Hi,
I am currently trying to use reverse slicing with a gpuarray (e.g.
[end:start:-step]
), but I am getting an error. I have written quickly a new test in order to reproduce the bug (feel free to discard my merge request if you are able to work on it).I have been through the code looking for the definition of src_pitch and I suppose that it comes from cudaMemcpy defined by Nvidia, right? Therefore, it would not be possible to change the unsigned int to a signed one.