No. If you modify the mentioned line, POCL will just pretend it is a GPU
device. That is not what you want.

Try installing POCL on your system (/etc/OpenCL) and using your system's
ICD.


2013/6/4 Yue Hu <[email protected]>

> Hi Clay,
>
> Thank you. If I modify "pocl-pthread.h" as you said, will it really work?
> I means does "pocl" include functions that support "opencl implemention for
> GPU".
>
> The reason I work with pocl is I would like to have my OpenCL program run
> on a machine that doesn't have OpenCL library. In addition, I also expect
> my program can make use of both CPU and GPU. Can pocl support this? Or it
> only support CPU case.
>
> Thanks.
>
>
>
> On Tue, Jun 4, 2013 at 10:10 AM, Clay Chang <[email protected]> wrote:
>
>> 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
>>
>
>
> ------------------------------------------------------------------------------
> 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