summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Xionghu <xionghu.luo@intel.com>2014-11-10 14:58:40 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-11-10 14:14:08 +0800
commitf5e98fd5792bb59b5bf9cb90d39644c3ebbe78ef (patch)
tree3160fde9cad8309a09b45cefc5b8f7872a6a3f6e
parent9353c602318bb4718fc9380c8ae6edc37e614b38 (diff)
fix a bug in clCompileProgram().
passing a binary program to clCompileProgram() should return CL_INVALID_OPERATION. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--src/cl_program.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cl_program.c b/src/cl_program.c
index a21a4f1f..43ab5677 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -747,7 +747,11 @@ cl_program_compile(cl_program p,
/* Create all the kernels */
p->source_type = FROM_LLVM;
p->binary_type = CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT;
+ }else if(p->source_type == FROM_BINARY){
+ err = CL_INVALID_OPERATION;
+ return err;
}
+
p->is_built = 1;
p->build_status = CL_BUILD_SUCCESS;
return CL_SUCCESS;