summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan Wang <yan.wang@linux.intel.com>2014-12-02 11:21:21 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-12-02 11:59:27 +0800
commitdd5cc66c00445b6f7b3bdc96e07896338a8ff270 (patch)
tree4d0c1949187982da9608d381bff9a26aead5e5be
parent355be0cba0d40cf00ff65d471d8771e763d06394 (diff)
Fix based on piglit OpenCL falied case (cl-api-compile-program).
1. Return the expected error code. 2. Don't destroy cl_program object after comile error because it may be used still in the future. Signed-off-by: Yan Wang <yan.wang@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--src/cl_program.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cl_program.c b/src/cl_program.c
index fa67ef20..c30f85e1 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -738,9 +738,9 @@ cl_program_compile(cl_program p,
if (UNLIKELY(p->opaque == NULL)) {
if (p->build_log_sz > 0 && strstr(p->build_log, "error: error reading 'options'"))
- err = CL_INVALID_BUILD_OPTIONS;
+ err = CL_INVALID_COMPILER_OPTIONS;
else
- err = CL_BUILD_PROGRAM_FAILURE;
+ err = CL_COMPILE_PROGRAM_FAILURE;
goto error;
}
@@ -758,8 +758,6 @@ cl_program_compile(cl_program p,
error:
p->build_status = CL_BUILD_ERROR;
- cl_program_delete(p);
- p = NULL;
return err;
}