Aean
Aean

Reputation: 779

clBuildProgram returns CL_BUILD_PROGRAM_FAILURE, but no error occured

My program runs well on my machine. A user is getting strange error and currently I have no idea how to debug.

clBuildProgram returns -11 which indicates CL_BUILD_PROGRAM_FAILURE.

Call clGetProgramBuildInfo with CL_PROGRAM_BUILD_STATUS, it returns CL_SUCCESS and the build status is CL_BUILD_SUCCESS.

Call clGetProgramBuildInfo with CL_PROGRAM_BUILD_LOG, it returns CL_SUCCESS and the log is pasted below:

Compilation started
1:817:22: warning: array index -1 is before the beginning of the array
1:315:5: note: array 'event' declared here
1:884:20: warning: array index -1 is before the beginning of the array
1:315:5: note: array 'event' declared here
1:1095:40: warning: use of logical '||' with constant operand
1:1095:40: note: use '|' for a bitwise operation
1:1095:69: warning: use of logical '||' with constant operand
1:1095:69: note: use '|' for a bitwise operation
1:1109:42: warning: use of logical '||' with constant operand
1:1109:42: note: use '|' for a bitwise operation
1:1109:69: warning: use of logical '||' with constant operand
1:1109:69: note: use '|' for a bitwise operation
1:1372:71: warning: use of logical '||' with constant operand
1:1372:71: note: use '|' for a bitwise operation
Compilation done
Linking started
Linking done
Device build started
Device build done
Kernel <sim_iterate> was not vectorized
Done.

As the build log says, compilation & linking are done without any error. So what could be the problem?

The device is Intel(R) Core(TM) i3-3240 CPU @ 3.40GHz.

Upvotes: 0

Views: 2662

Answers (1)

Aean
Aean

Reputation: 779

I fixed the issue. The parameters of clBuildProgram is not correct.

// Before:
clBuildProgram(program, 0, 0, "-cl-single-precision-constant -cl-denorms-are-zero -cl-fast-relaxed-math", 0, 0)
// After:
clBuildProgram(program, 1, &device, "-cl-single-precision-constant -cl-denorms-are-zero -cl-fast-relaxed-math", 0, 0)

Upvotes: 1

Related Questions