Skip to content
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

slice size should round up, not down #75

Merged
merged 1 commit into from
Jul 5, 2015

Conversation

davidweichiang
Copy link
Contributor

Previously, the following would cause an error:

a = pycuda.gpuarray.to_gpu(numpy.arange(16).reshape((4,4)))
b = a[::3]
b.shape
(2, 4)
b[1]
array([12, 13, 14, 15])

@inducer
Copy link
Owner

inducer commented Jul 5, 2015

Thanks for the fix! (I've applied the same fix in PyOpenCL, too, FYI)

inducer added a commit that referenced this pull request Jul 5, 2015
slice size should round up, not down
@inducer inducer merged commit e55c48f into inducer:master Jul 5, 2015
@davidweichiang
Copy link
Contributor Author

Great, thanks! I'd like to write some extensions to allow, e.g. slice assignment in certain cases (= where 2d or 3d memcpy can be used). Is that something you want, or do you prefer for it to be fully general or nothing?

David

On Jul 5, 2015, at 10:47, Andreas Klöckner notifications@github.com wrote:

Thanks for the fix! (I've applied the same fix in PyOpenCL, too, FYI)


Reply to this email directly or view it on GitHub.

@inducer
Copy link
Owner

inducer commented Jul 5, 2015

Yeah, I'd like that. It turns out Toby Smithe wrote something similar a while ago for PyOpenCL. We then set out to do something fully general instead, but that effort stalled:

inducer/pyopencl#54

Maybe you can scavenge something from there. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants