diff options
author | Gil Pitney <gil.pitney@linaro.org> | 2015-07-28 23:14:25 +0000 |
---|---|---|
committer | Gil Pitney <gil.pitney@linaro.org> | 2015-07-28 23:14:25 +0000 |
commit | f3f4005c33973e3b396c35b72684051da96beb43 (patch) | |
tree | ee7d427b9551998dc28fbc0e501d9cba4281de14 | |
parent | d2cc396ab3bdf074a785cc556971170599a8a726 (diff) |
Update clBuildProgram() to return correct error code if compile fails.
Previously, clBuildProgram() was returning CL_COMPILE_PROGRAM_FAILURE
instead of CL_BUILD_PROGRAM_FAILURE when the compile method, called from
the build method, failed.
This was caught by a piglit v1.2 test:
"Failed (error code: CL_COMPILE_PROGRAM_FAILURE): Trigger CL_BUILD_PROGRAM_FAILURE if there is a failure to build the program executable."
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
-rw-r--r-- | src/core/program.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/program.cpp b/src/core/program.cpp index b44d948..60d7a26 100644 --- a/src/core/program.cpp +++ b/src/core/program.cpp @@ -904,6 +904,9 @@ cl_int Program::build(const char *options, result = link(options, pfn_notify, user_data, num_devices, device_list, num_input_programs, input_programs); } + else if (result == CL_COMPILE_PROGRAM_FAILURE) { + result = CL_BUILD_PROGRAM_FAILURE; // clBuildProgram expects this error code. + } return result; } |