[Beignet] [PATCH] Fix based on piglit OpenCL falied case (cl-api-compile-program).

Yan Wang yan.wang at linux.intel.com
Mon Dec 1 19:21:21 PST 2014


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 at linux.intel.com>
---
 src/cl_program.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/cl_program.c b/src/cl_program.c
index fa67ef2..c30f85e 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;
 }
 
-- 
1.9.3



More information about the Beignet mailing list