pycuda icon indicating copy to clipboard operation
pycuda copied to clipboard

ElementwiseKernel: add get_global and fix bug in get_texref

Open bailsman opened this issue 6 years ago • 2 comments

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.

bailsman avatar Mar 16 '18 00:03 bailsman

Could you add/update the docs?

inducer avatar Mar 16 '18 14:03 inducer

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 ;)

bailsman avatar Mar 16 '18 17:03 bailsman