OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.

clGetProgramBuildInfo returns CL_BUILD_NONE

Markus_Dreseler
Beginner
467 Views

We have an OpenCL program that works fine on my OS X machine. We just set up a machine with a Xeon Phi and Intel MPSS. However, even when not using the Phi but the Xeon CPU, the CL_PROGRAM_BUILD_STATUS we get is CL_BUILD_NONE.

Unfortunately, we cannot find any documentation on what might cause CL_BUILD_NONE. Do you have any suggestion on how to debug this?

Thank you in advance!

Versions:

[bash]
[@memphis:~] $ cat /etc/SuSE-release 
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 2

[@memphis:~] $ uname -a
Linux memphis 3.0.13-0.27-default #1 SMP Wed Feb 15 13:33:49 UTC 2012 (d73692b) x86_64 x86_64 x86_64 GNU/Linux

[@memphis:~] 1 $ rpm -qa |grep intel
intel-mic-2.1.6720-15.suse
intel-mic-mpm-2.1.6720-15.suse
opencl-1.2-intel-mic-3.0.67279-1
intel-mic-sysmgmt-2.1.6720-15.suse
intel-mic-kmod-2.1.6720-15.3.0.13.0.suse
intel-mic-gdb-2.1.6720-15.suse
intel-mic-flash-2.1.386-3.suse
intel-mic-cdt-2.1.6720-15.suse
opencl-1.2-intel-devel-3.0.67279-1
intel-mic-micmgmt-2.1.6720-15.3.0.13.0.suse
opencl-1.2-intel-cpu-3.0.67279-1
intel-mic-gpl-2.1.6720-15.suse
intel-mic-crashmgr-2.1.6720-15.suse
[/bash]

0 Kudos
6 Replies
Yuri_K_Intel
Employee
467 Views
Hi Markus, What happens if you perform the following command: ioc64 -cmd=build -input=any_opencl_kernel.cl Thanks, Yuri
0 Kudos
Markus_Dreseler
Beginner
467 Views

Hi Yuri,

thanks for the tip - I wasn't aware of that. However, ioc64 seems to build the kernel fine:

[bash]
[@memphis:~/logreg] 1 $ ioc64 -cmd=build -input=reduce.cl

Setting target instruction set architecture to: Default
Intel OpenCL CPU device was found!
Device name:        Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz
Device version: OpenCL 1.2 (Build 67279)
Device vendor: Intel(R) Corporation
Device profile: FULL_PROFILE
Compilation started
Compilation done
Linking started
Linking done
Kernel <reduce> was successfully vectorized
Done.
Build succeeded!
[/bash]

I build the kernel using the following commands:

[cpp]
*program = clCreateProgramWithSource(context, 1, (const char **) &cSourceCL, &program_length, &ret);
clBuildProgram(*program, 0, NULL, opts.str().c_str(), NULL, &ret);
[/cpp]

Leaving out the opts doesn't change anything. I also added a syntax error to the CL code - it doesn't get parsed. If there is any more information I can give you to help, let me know. I didn't want to paste my whole source code here. ;)

Also, adding a device list to the clBuildProgram doesn't help.

Thank you for your help!

0 Kudos
Markus_Dreseler
Beginner
467 Views

Found it. I am not sure why I had &ret (cl_int return value) as the last parameter instead of having it as the return value of clBuildProgram. Moving it and setting the last parameter to NULL fixes the problem.

I do understand why this problem occured - apparently the compiler / the OpenCL libraries understood that I wanted to use pfn_notify and asynchronously build my kernel. I am, however, not sure if this behavior is fully conformant to the OpenCL documentation:

If pfn_notify is NULL, clBuildProgram does not return until the build has completed.

In my code, the pfn_notify argument was actually NULL, however user_data was (erroneously) not. While my code didn't make any sense, I believe that user_data should be ignored when pfn_notify is NULL.

0 Kudos
Yuri_K_Intel
Employee
467 Views
Glad the issue is solved. Your assumptions regarding pfn_notify == NULL, user_data != NULL case look reasonable. I will submit a ticket after reproducing. Thanks, Yuri
0 Kudos
JLuna5
New Contributor I
467 Views

Hi, do you test your kernel now?

0 Kudos
Markus_Dreseler
Beginner
467 Views

Could you rephrase your question, please? The kernel works now, if that is what you mean.

0 Kudos
Reply