From 30e684ed12ac82c900cf985d7e5d0a4355035282 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Fri, 12 Sep 2014 13:47:25 +0800 Subject: [PATCH] runtime: fix program binary type bug. 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 Reviewed-by: He Junyan Tested-by: "Meng, Mengmeng" Reviewed-by: "Song, Ruiling" --- 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; -- 2.7.4