[PyOpenCL] [Poll] Templating engine
Bogdan Opanchuk
mantihor at gmail.com
Thu Dec 30 03:47:04 PST 2010
Hi Andreas,
I personally do not see anything wrong with 'hard' dependency, as
PyCuda/PyOpenCL have some dependencies already. So, an additional
dependency won't change things qualitatively.
By the way, are you planning to merge reduction/elementwise code of
PyCuda and PyOpenCL? This will reduce the amount of repeated code (the
kernels for cuda/cl must be practically identical), but will probably
add some overhead and make the code more sophisticated.
Best regards,
Bogdan
On Thu, Dec 30, 2010 at 12:02 PM, Andreas Kloeckner
<lists at informa.tiker.net> wrote:
> Hi all,
>
> I've just finished coding up support for reductions on CL arrays in
> pyopencl. The code is in git, under pyopencl.reduction. (Yay!
> Pretty much feature parity with PyCUDA!)
>
> I wrote this code using the Mako [1] templating engine. Writing the same
> code without a templating engine would have been significantly clumsier.
>
> Now of course, this makes the reduction code depend on Mako. The
> question now is how to handle this dependency. Several options exist:
>
> -----------------------------------------------------------------------
>
> 1. Make it a 'hard' dependency, installed by setup.py.
>
> 2. Make it a 'soft' dependency--the reduction code will fail on import
> with a usable error message alerting the user that he needs to install
> Mako.
>
> 3. Try to eliminate the dependency on any particular templating engine
> by rewriting the code.
>
> -----------------------------------------------------------------------
>
> I'd be grateful for your feedback.
>
> Thanks,
> Andreas
>
> [1] http://www.makotemplates.org/
>
>
> _______________________________________________
> PyOpenCL mailing list
> PyOpenCL at tiker.net
> http://lists.tiker.net/listinfo/pyopencl
>
>
More information about the PyOpenCL
mailing list