Compiler error about argument descriptors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pocl |
New
|
Undecided
|
Unassigned |
Bug Description
Python 2.7.3rc2 (default, Apr 22 2012, 22:30:17)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyopencl as cl
>>> import pyopencl.array
>>> import numpy as np
>>> ctx = cl.create_
>>> q = cl.CommandQueue
>>> cl.array.arange(q, 27, dtype=np.complex64)
/home/andreas/
size = int(ceil(
<stdin>:3:22: error: use of undeclared identifier '_arange_NUM_ARGS'
unsigned _num_args = _arange_NUM_ARGS;
<stdin>:4:25: error: use of undeclared identifier '_arange_
int _arg_is_pointer[] = _arange_
<stdin>:5:23: error: use of undeclared identifier '_arange_
int _arg_is_local[] = _arange_
<stdin>:6:23: error: use of undeclared identifier '_arange_
int _arg_is_image[] = _arange_
<stdin>:7:25: error: use of undeclared identifier '_arange_
int _arg_is_sampler[] = _arange_
<stdin>:8:24: error: use of undeclared identifier '_arange_
unsigned _num_locals = _arange_NUM_LOCALS;
6 errors generated.
ld: cannot find /tmp/poclvnENH1
The kernel descriptor.so is not found.
(abort)
Looking at the program.cl under pocl temp (/tmp/poclvnENH1 in your case) it reveals a suspicious line #include <pyopencl- complex. h>. Includes are not supported in pocl (clBuildProgram options are not passed to the compiler). Should be an easy add.
Another problem is the use of a non-pointer struct arguments which do not work and are harder to fix (requires Clang patches or parsing the kernels at pocl): https:/ /bugs.launchpad .net/pocl/ +bug/987905
The program.cl:
//CL// complex. h>
#include <pyopencl-
__kernel void arange(__global cfloat_t *z, cfloat_t start, cfloat_t step, long n) size(0) *get_group_ id(0);
{
int lid = get_local_id(0);
int gsize = get_global_size(0);
int work_item_start = get_local_
long i;
;
//CL//
for (i = work_item_start + lid; i < n; i += gsize)
{
z[i] = start + i*step;
}
;
}
__constant int pyopencl_ defeat_ cache_571a99d55 1bd4f38a1c2c236 ceb163e9 = 0;