diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2014-09-12 13:47:25 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-09-12 16:36:03 +0800 |
commit | 342fdc782373744457e81c6e82eb5a3b295e9b5f (patch) | |
tree | 54f1e1308e710d16556a54df38007bb879a8024e | |
parent | 64d095e6d8a05991b749c266812980ee2997efe5 (diff) |
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 <zhigang.gong@intel.com>
Reviewed-by: He Junyan <junyan.he@inbox.com>
Tested-by: "Meng, Mengmeng" <mengmeng.meng@intel.com>
Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
-rw-r--r-- | kernels/include/runtime_compile_link_inc.h | 2 | ||||
-rw-r--r-- | src/cl_program.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/kernels/include/runtime_compile_link_inc.h b/kernels/include/runtime_compile_link_inc.h index 4011278..9b66850 100644 --- a/kernels/include/runtime_compile_link_inc.h +++ b/kernels/include/runtime_compile_link_inc.h @@ -1,4 +1,4 @@ -inline int greater(long x, long y) +int greater(long x, long y) { return x > y ; } 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; |