[Beignet] [PATCH V3 1/3] add [opencl-1.2] API clCompileProgram.

Song, Ruiling ruiling.song at intel.com
Thu Jun 5 20:00:32 PDT 2014



+    /* Create all the kernels */
+    TRY (cl_program_load_gen_program, p);
+    p->source_type = FROM_LLVM;
+  }
+
The below part are not valid for compiled program, it does not have executable binary now.
My suggestion is you can remove this logic and use another patch to fully support different binaries.
COMPILED_BINARY is just LLVM IR, EXECUTABLE_BINARY is program that already built or fully linked into GEN ASM.
Please check OpenCL spec carefully.

I saw you remove below code in next patch, if you have already noticed this, it is better you directly remove it in this patch.
And still you need to consider differentiate between compiled binary and executable binary later.
+  for (i = 0; i < p->ker_n; i ++) {
+    const gbe_kernel opaque = gbe_program_get_kernel(p->opaque, i);
+    p->bin_sz += gbe_kernel_get_code_size(opaque);  }
+
+  TRY_ALLOC (p->bin, cl_calloc(p->bin_sz, sizeof(char)));  for (i = 0; 
+ i < p->ker_n; i ++) {
+    const gbe_kernel opaque = gbe_program_get_kernel(p->opaque, i);
+    size_t sz = gbe_kernel_get_code_size(opaque);
+
+    memcpy(p->bin + copyed, gbe_kernel_get_code(opaque), sz);
+    copyed += sz;
+  }
+
+error:
+  p->is_built = 1;
+  return err;
+}




More information about the Beignet mailing list