Compiler error about argument descriptors

Bug #1040798 reported by Andreas Klöckner
6
This bug affects 1 person
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_some_context(answers=["portable"])
>>> q = cl.CommandQueue(ctx)
>>> cl.array.arange(q, 27, dtype=np.complex64)
/home/andreas/research/software/pyopencl/pyopencl/array.py:964: ComplexWarning: Casting complex values to real discards the imaginary part
  size = int(ceil((stop-start)/step))
<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_ARG_IS_POINTER'
int _arg_is_pointer[] = _arange_ARG_IS_POINTER;
                        ^
<stdin>:5:23: error: use of undeclared identifier '_arange_ARG_IS_LOCAL'
int _arg_is_local[] = _arange_ARG_IS_LOCAL;
                      ^
<stdin>:6:23: error: use of undeclared identifier '_arange_ARG_IS_IMAGE'
int _arg_is_image[] = _arange_ARG_IS_IMAGE;
                      ^
<stdin>:7:25: error: use of undeclared identifier '_arange_ARG_IS_SAMPLER'
int _arg_is_sampler[] = _arange_ARG_IS_SAMPLER;
                        ^
<stdin>:8:24: error: use of undeclared identifier '_arange_NUM_LOCALS'
unsigned _num_locals = _arange_NUM_LOCALS;
                       ^
6 errors generated.
ld: cannot find /tmp/poclvnENH1/pthread/arange/descriptor.so.o: No such file or directory
The kernel descriptor.so is not found.
(abort)

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

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//
        #include <pyopencl-complex.h>

        __kernel void arange(__global cfloat_t *z, cfloat_t start, cfloat_t step, long n)
        {
          int lid = get_local_id(0);
          int gsize = get_global_size(0);
          int work_item_start = get_local_size(0)*get_group_id(0);
          long i;

          ;
          //CL//
          for (i = work_item_start + lid; i < n; i += gsize)
          {
            z[i] = start + i*step;
          }

          ;
        }

__constant int pyopencl_defeat_cache_571a99d551bd4f38a1c2c236ceb163e9 = 0;

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

Options are not passed to the compiler so the include part should be fixed. Structs as value args are not fixed.

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

Closing this as there's a separate bug about the by-value struct kernel args: https://bugs.launchpad.net/pocl/+bug/987905

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.