Hello everyone,

I am modifying the pocl code to add support for FPGA device. So i make
changes in pocl source code as per my requirement.
Basically, I want to create OpenCL kernel using program binary (obtained
from FPGA device) as shown below:

The content of my kernel source code (dummy.cl) is ::

__kernel void dummyKernel(__global uchar *a,
                                         __global uchar *b,
                                          __global uchar *c)
{
    /*
    Dummy Kernel for MSO_2003 bitfiles
    */
    size_t id = get_global_id(0);
}

Note: I assume that I have binary data to be run on FPGA.
1. //creating binary using clGetProgramInfo() as :

    //first call to get size of binary ...
    assume num_devices = 1;
    ret = clGetProgramInfo(program, CL_PROGRAM_BINARY_SIZES, num_devices *
sizeof(size_t), &binary_sizes, NULL);
    //second call to read the binary info....
    ret = clGetProgramInfo(program, CL_PROGRAM_BINARIES, num_devices *
sizeof(size_t), binaries, NULL);

2. //use this binary to create OpenCL Program object using
clCreateProgramWithBinary()

    program = clCreateProgramWithBinary(context, num_devices, devices,
(const size_t *)binary_sizes, (const unsigned char **)binaries,
&binary_status, &ret);
    if(ret)
    {
          printf("failed While creating program using Binaries with ret =
%d\n", ret);
          return ret;
    }

3. //use this Program object to create OpenCL Kernel using clCreateKernel()

   kernel[icount] = clCreateKernel(program, "dummyKernel", &ret);

4.  other stuff

I compiled the above code using pocl library.
While running I got segmentation fault at line "clCreateKernel". Using gdb,
it shows that the problem is in line no. 166 as shown below:

*Program received signal SIGSEGV, Segmentation fault.*
*0x00007ffff71e4a42 in POclCreateKernel (program=0x613c70,
kernel_name=<optimized out>, errcode_ret=<optimized out>) at
clCreateKernel.c:166*
*166  kernel->num_args = *(cl_uint *) lt_dlsym(dlhandle, "_num_args"); *

Can anyone tell me what is going on there?

Note: The same is working fine if device_type is CL_DEVICE_TYPE_CPU, but
when I changed it with CL_DEVICE_TYPE_ACCELERATOR, it shows the above error.
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to