[Beignet] [PATCH] Runtime: add a warning when load gen binary fail.

Pan, Xiuli xiuli.pan at intel.com
Tue Feb 14 06:43:39 UTC 2017


LGTM!

-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Yang Rong
Sent: Friday, February 10, 2017 2:38 PM
To: beignet at lists.freedesktop.org
Cc: Yang, Rong R <rong.r.yang at intel.com>
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 <rong.r.yang at intel.com>
---
 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
Beignet at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list