LGTM!

-----Original Message-----
From: Beignet [mailto:[email protected]] On Behalf Of Yang 
Rong
Sent: Friday, February 10, 2017 2:38 PM
To: [email protected]
Cc: Yang, Rong R <[email protected]>
Subject: [Beignet] [PATCH] Runtime: add a warning when load gen binary fail.

Some applications use program's binary by default, if load the former's gen 
binary, because the fields of gen binary has changed, and lack of version 
checking, will lead to clCreateProgramWithBinary fail, may cause applications 
fail silently.
Add a warning to hint user.

Signed-off-by: Yang Rong <[email protected]>
---
 src/cl_program.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cl_program.c b/src/cl_program.c index 0358705..363aed5 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -334,6 +334,7 @@ cl_program_create_from_binary(cl_context             ctx,
   else if (isGenBinary((unsigned char*)program->binary)) {
     program->opaque = 
interp_program_new_from_binary(program->ctx->devices[0]->device_id, 
program->binary, program->binary_sz);
     if (UNLIKELY(program->opaque == NULL)) {
+      DEBUGP(DL_ERROR, "Incompatible binary, please delete the binary 
+ and generate again.");
       err = CL_INVALID_PROGRAM;
       goto error;
     }
--
2.7.4

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to