aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGil Pitney <gil.pitney@linaro.org>2015-07-28 23:14:25 +0000
committerGil Pitney <gil.pitney@linaro.org>2015-07-28 23:14:25 +0000
commitf3f4005c33973e3b396c35b72684051da96beb43 (patch)
treeee7d427b9551998dc28fbc0e501d9cba4281de14
parentd2cc396ab3bdf074a785cc556971170599a8a726 (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.cpp3
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;
}