srossross / Clyther

Python GPU integration
Other
55 stars 6 forks source link

compile-to-opencl-source fails #2

Open mdipierro opened 12 years ago

mdipierro commented 12 years ago

Hello Sean,

I installed python2.7 and did a pip install clyther I am trying this code: http://srossross.github.com/Clyther/examples.html#compile-to-opencl-source and I get

Traceback (most recent call last): File "test1.py", line 32, in print generate_sin.compile(ctx, a=cl.global_memory(cl.cl_float2), source_only=True) File "/Library/Python/2.7/site-packages/clyther/cly_kernel.py", line 157, in compile cl_kernel = self.compile_or_cly(ctx, source_only=source_only, cly_meta=cly_meta, **kwargs) File "/Library/Python/2.7/site-packages/clyther/cly_kernel.py", line 207, in compile_or_cly program = self._compile(ctx, args, defaults, kernel_name, source) File "/Library/Python/2.7/site-packages/clyther/cly_kernel.py", line 261, in _compile raise CLComileError('\n'.join(log_lines), program) clyther.cly_kernel.CLComileError: No kernels or only kernel prototypes found

Any idea what I may be doing wrong?

srossross commented 12 years ago

Hi, Sorry This does not give me enough information. Have you tried to run similar code using pure openCL or PyOpenCL?

justarandomuser commented 11 years ago

I'm having a similar but different issue. I haven't yet tried your suggestion yet though.

Does this help? python clytherWithKernel.py Traceback (most recent call last): File "clytherWithKernel.py", line 32, in print generate_sin.compile(ctx, a=cl.global_memory(cl.cl_float2), source_only=True) File "/usr/local/lib/python2.7/dist-packages/Clyther-0.4_beta-py2.7.egg/clyther/cly_kernel.py", line 157, in compile cl_kernel = self.compile_or_cly(ctx, source_only=source_only, cly_meta=cly_meta, *kwargs) File "/usr/local/lib/python2.7/dist-packages/Clyther-0.4_beta-py2.7.egg/clyther/cly_kernel.py", line 207, in compile_or_cly program = self._compile(ctx, args, defaults, kernel_name, source) File "/usr/local/lib/python2.7/dist-packages/Clyther-0.4_beta-py2.7.egg/clyther/cly_kernel.py", line 261, in _compile raise CLComileError('\n'.join(log_lines), program) clyther.cly_kernel.CLComileError: /tmp/clyther_EtYG4z.cl:15:8: error: use of undeclared identifier 'cly_a_info' a[(cly_a_info.s7 + (gid * cly_a_info.s4))].x = ((r * 2.0) - 1.0); ^ /tmp/clyther_EtYG4z.cl:16:8: error: use of undeclared identifier 'cly_a_info' a[(cly_a_info.s7 + (gid \ cly_a_info.s4))].y = native_sin(y); ^

woncount commented 11 years ago

I also noticed that most of the clyther examples on the website are not yet self-contained, you often need to add required imports from other places to make them work, but otherwise it's been working well - assuming that you have an OpenCL runtime installed (AMD, INTEL or NVIDIA) and that you are able to run other CL code.

mabtjie commented 10 years ago

I'm having the same issue, using Clyther-0.4-beta (on Windows). When I try to run "examples/conv.py", I get clyther.cly.kernel.CLComileError with "use of undeclared identifier 'cly_a_info'. Looking at the generated .cl file, it simply defines kernel setslice(). At no point is cly_a_info declared.