0
votes

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.

1
My program runs well on my machine. How does it with errors (kindly reported to you as warnings) like this: array index -1 is before the beginning of the array ? - doqtor
@doqtor There is a heap pointer _event_t* p = &event[-1]; so I can replace event[i-1] with p[i]. Compilers are complaining about this but I don't think this is an error. The definition of the subscript operator [] is that E1[E2] is identical to (*((E1)+(E2))) (C99 6.5.2.1) - Aean

1 Answers

1
votes

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)