Andreas,
I was more wondering if there was support for translating the pyopencl
kernel call--specifically the wrapper generated by loopy that generates the
kernel, adds arguments, etc.--into the C equivalent.
In my use case, being able to execute the kernel directly from python via
pyopencl is a lifesaver (specifically, it made unit testing infinitely
easier), however ultimately the generated kernels will be run as part of a
larger C-based program and it would be nifty if there was support for this
translation.  No worries at all if not--I'm in the process of rolling my own
at the moment, which I'd be happy to share if there was interest

Best,
Nick

-----Original Message-----
From: Andreas Kloeckner [mailto:li...@informa.tiker.net] 
Sent: Thursday, February 2, 2017 7:58 PM
To: Nick Curtis <nicholas.cur...@uconn.edu>; pyopencl@tiker.net
Subject: Re: [PyOpenCL] Support for C/C++ codegen from pyopencl?

Nick,

Nick Curtis <nicholas.cur...@uconn.edu> writes:
> I was just wondering, if you build a kernel in PyOpenCL is there any 
> way to access the underlying C/C++ code that builds and calls the 
> kernel, and export it to a file for external use?  It would be 
> convenient if so, but fine if not!

I'm not sure I fully understand your question, but I'll give it a shot.
Building and running a kernel is the business of the OpenCL implementation
you're using, so whether or not you can see that code or not depends on
which implementation you're using. For closed-source ones such as Nvidia or
Intel, you won't be able to see that code. There are the clBuildProgram and
clEnqueueNDRangeKernel entrypoints that are exposed to C, but everything
beyond that is a black box.

For open-source CL implementations like POCL (or beignet, or soon AMD's),
you can in fact look at what happens inside.

Hope that helps,
Andreas


_______________________________________________
PyOpenCL mailing list
PyOpenCL@tiker.net
https://lists.tiker.net/listinfo/pyopencl

Reply via email to