Dustin Kleckner <[email protected]> writes:

> Thanks for the quick reply — that fixed it.
>
> Just out of curiosity, is there a compelling reason not to cache the
> kernel code in the program objects, and then quickly returning
> repeated calls?  I generally wouldn’t expect calling a method
> repeatedly to be significant slower than getting a copy and then
> calling it.  I guess what you’re saying is that I shouldn’t think of
> “pgm.sum” as a method, but rather as an argument-less function that
> returns a method?  In this case shouldn’t I expect the syntax to be
> “sum_knl = prg.sum()”?

I'll think about it. It won't work in the case where the kernel came out
of a GetInfo query and we don't know the associated (Python-side)
Program object. But in the most common cases it should be doable. Could
you put up a bug on Github so I remember to look into this?

Andreas

_______________________________________________
PyOpenCL mailing list
[email protected]
https://lists.tiker.net/listinfo/pyopencl

Reply via email to