Hi Yue,

POCL is an OpenCL implementation for CPU. It cannot detect GPU for sure.
The question is why you expect CL_DEVICE_TYPE_GPU to work with POCL?

But if you really want POCL to work with CL_DEVICE_TYPE_GPU, try modifying
line 44 in lib/CL/devices/pthread/pocl-pthread.h:

change

CL_DEVICE_TYPE_CPU | CL_DEVICE_TYPE_DEFAULT,

to

CL_DEVICE_TYPE_CPU | CL_DEVICE_TYPE_DEFAULT | CL_DEVICE_TYPE_GPU,

This should work for your purpose.

Regards,
Clay


On Tue, Jun 4, 2013 at 10:20 PM, Yue Hu <[email protected]> wrote:

> Hi all,
>
> I am new to pocl. When using pocl as an opencl implementation, I find that
> my program cannot detect GPU device.
>
> The test program I use is "hotspot" from "rodinia_2.0.1". I am using pocl
> 0.7.
>
> 1. When using default opencl implementation, the program can correctly run
> and output.
> Platform: NVIDIA Corporation
> Device: GeForce GTX 580
>
> 2. To use pocl (Linking your program with pocl through an icd loader), in
> its makefile file I replace
> "$(CC) $(CC_FLAGS) -o $(EXE) -I$(OPENCL_INC) OpenCL_helper_library.c
> hotspot.c -L$(OPENCL_LIB) -lOpenCL" with
> "$(CC) $(CC_FLAGS) -o $(EXE) -I$(OPENCL_INC) OpenCL_helper_library.c
> hotspot.c `pkg-config --libs --cflags pocl`"
>
> 3. Then I compile and run the program, it outputs
> Platform: The POCL project
> Error at line 179: CL_DEVICE_NOT_FOUND
> The error happens in the line listed below:
> context = clCreateContextFromType(context_properties, CL_DEVICE_TYPE_GPU,
> NULL, NULL, &error);
>
> 4. I guess it is because pocl cannot detect GPU device, then I replace
> "CL_DEVICE_TYPE_GPU" with "CL_DEVICE_TYPE_CPU" or "CL_DEVICE_TYPE_ALL". The
> program can correctly run and outputs:
> Platform0: The POCL project
> Device: pthread
>
> Can anyone please comment on this?
>
> Thanks.
>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
> _______________________________________________
> pocl-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pocl-devel
>
>
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to