If the binary is a executable type, the first byte is zero and
we need to set the binary type correctly to CL_PROGRAM_BINARY_TYPE_EXECUTABLE.

Signed-off-by: Zhigang Gong <[email protected]>
---
 src/cl_program.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/cl_program.c b/src/cl_program.c
index 3ecc49f..022e893 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -247,6 +247,9 @@ cl_program_create_from_binary(cl_context             ctx,
     }
     program->source_type = FROM_LLVM;
   }
+  else if (*program->binary == 0) {
+    program->binary_type = CL_PROGRAM_BINARY_TYPE_EXECUTABLE;
+  }
 
   if (binary_status)
     binary_status[0] = CL_SUCCESS;
-- 
1.8.3.2

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

Reply via email to