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

remove the .gpudata field #5

Open
nouiz opened this issue Oct 13, 2011 · 2 comments
Open

remove the .gpudata field #5

nouiz opened this issue Oct 13, 2011 · 2 comments

Comments

@nouiz
Copy link
Collaborator

nouiz commented Oct 13, 2011

To don't use this field by mistake in old code that don't support strides.

We need PyCUDA/PyOpenCL to try to use the .bytes fields when we ask him to do so.

@inducer
Copy link
Owner

inducer commented Oct 13, 2011

I'm not sure I agree. How about

@property
def gpudata(self):
  assert no_strides
  return self.bytes

I'm reluctant to remove it outright, because it would effectively break every PyCUDA code under the sun.

@nouiz
Copy link
Collaborator Author

nouiz commented Oct 13, 2011

I agree that we could keep it with your proposal.

But to be able to use your proposal, we need PyCUDA/PyOpenCL check the .bytes fields of object it receive and not just .gpudata. But we don't want to always check this.

What about adding a parameter to SourceModule.get_function(, use_bytes=False). When use_bytes is True, it will check for the attributes bytes and not the attributes gpudata.

nouiz pushed a commit to nouiz/compyte that referenced this issue Nov 20, 2013
numpy.transpose(None) is supposed to be equivalent to numpy.transpose().
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

No branches or pull requests

2 participants