pycuda
pycuda copied to clipboard
ElementwiseKernel: add get_global and fix bug in get_texref
This adds get_global to ElementwiseKernel so you can use constant memory in one.
get_texref was also broken: the use_range parameter was a kwarg instead of normal arg, causing the memoizer to see it as a different call. So you'd get a texref to a different module.
Could you add/update the docs?
Hmm. What's a good place to document this? ElementwiseKernel is only mentioned briefly in doc/source/array.rst. I suppose I could add a sentence there that .get_global() works on ElementwiseKernel.
There's also the detail that to use an old style texref, you have to bind it to the module, and we don't provide an easy interface to do that yet. If we want to document and make get_texref() easy to actually use, maybe we should have get_texref() automatically add the texref to module.texrefs so that they get bound whenever you call the module. Or we could encourage people to use texture objects instead ;)