-
Notifications
You must be signed in to change notification settings - Fork 376
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
The iter_reverse function for range seems to only work for step = 1.
Lines 96 to 107 in 3b00f16
| CUDA_CALLABLE inline range_t iter_reverse(const range_t& r) | |
| { | |
| // generates a reverse range, equivalent to reversed(range()) | |
| range_t rev; | |
| rev.start = r.end-1; | |
| rev.end = r.start-1; | |
| rev.step = -r.step; | |
| rev.i = rev.start; | |
| return rev; | |
| } |
I think it needs to be something like the following? (Not thoroughly tested)
rev.start = r.start + (r.end - r.start - sign(r.step)) / r.step * r.step;
rev.end = rev.start - r.end + r.start;System Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working