Hello,

shouldn't you place kernel declaration completely on a separate line?
As far as I know C, you can't place regular commands on the same line
with preprocessor ones. So it should be written like this:

kernel1 = """#pragma OPENCL EXTENSION cl_khr_fp64: enable
__kernel void part1(__global double* a......"""

Regards,
Alex

On Fri, Dec 14, 2012 at 2:45 AM, Ajay Shah <[email protected]> wrote:
> Hello,
> I have a pyopencl question
>
> let #pragma = #pragma OPENCL EXTENSION cl_khr_fp64: enable
>
> I am trying to put #pragma into my kernel but am having trouble.
>
> It I create a separate kernel.cl document and place #pragma at the top of
> the line, then my program runs, but if I try to use a string with #pragma
> inside of it, the program crashes. When I say putting  pragma inside of a
> string I mean:
>
> kernel1 = """#pragma OPENCL EXTENSION cl_khr_fp64: enable __kernel
> void part1(__global double* a......"""
>
> The end result is.....
>
> Traceback (most recent call last):
>   File "E:\Downloads\testpyopencl01.py", line 64, in <module>
>     example.execute()
>   File "E:\Downloads\testpyopencl01.py", line 47, in execute
>     self.program.part1(self.queue, self.a.shape, None, self.a_buf,
> self.b_buf, self.dest_buf1,self.dest_buf2)
>   File "C:\Python27\lib\site-packages\pyopencl\__init__.py", line 107, in
> __getattr__
>     "info attribute or as a kernel name" % attr)
> AttributeError: 'part1' was not found as a program info attribute or as a
> kernel name
>
>
> thank you for all your help,
>
> Ajay
>
> _______________________________________________
> PyOpenCL mailing list
> [email protected]
> http://lists.tiker.net/listinfo/pyopencl
>

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

Reply via email to