summaryrefslogtreecommitdiff
path: root/src/cl_gbe_loader.cpp
diff options
context:
space:
mode:
authorLuo <xionghu.luo@intel.com>2014-06-18 08:17:34 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-06-18 20:00:42 +0800
commit9ee75c0aa5906a9d727ad56a60eb73a87c1c021f (patch)
tree09ea3634d8dbe0e68b56f6cc8389b76ad6f0d807 /src/cl_gbe_loader.cpp
parent853ac4d94de25cf2c29fb8225e2a7162f40bdc7d (diff)
downloadbeignet-9ee75c0aa5906a9d727ad56a60eb73a87c1c021f.tar.gz
add binary type support for compiled object and library.
save the llvm bitcode to program->binary: insert a byte in front of the bitcode stands for binary type(0 means GEN binary, 1 means COMPILED_OBJECT, 2 means LIBRARY); load the binary to module by ParseIR. create random directory to save compile header files. use strncpy and strncat to replace strcpy and strcat. v6: fix enqueue_copy_fill bug, use '\0' instead of 0 in the header. v7 binary header format issue: fix test_load_program_from_bin bug of standalone kernel generated by gbe_bin_generater. Signed-off-by: Luo <xionghu.luo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
Diffstat (limited to 'src/cl_gbe_loader.cpp')
-rw-r--r--src/cl_gbe_loader.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cl_gbe_loader.cpp b/src/cl_gbe_loader.cpp
index 470299b4..2fda50c5 100644
--- a/src/cl_gbe_loader.cpp
+++ b/src/cl_gbe_loader.cpp
@@ -24,13 +24,14 @@
//function pointer from libgbe.so
gbe_program_new_from_source_cb *compiler_program_new_from_source = NULL;
-gbe_program_serialize_to_binary_cb *compiler_program_serialize_to_binary = NULL;
-gbe_program_new_from_llvm_cb *compiler_program_new_from_llvm = NULL;
-gbe_set_image_base_index_cb *compiler_set_image_base_index = NULL;
gbe_program_compile_from_source_cb *compiler_program_compile_from_source = NULL;
gbe_program_new_gen_program_cb *compiler_program_new_gen_program = NULL;
gbe_program_link_program_cb *compiler_program_link_program = NULL;
gbe_program_build_from_llvm_cb *compiler_program_build_from_llvm = NULL;
+gbe_program_new_from_llvm_binary_cb *compiler_program_new_from_llvm_binary = NULL;
+gbe_program_serialize_to_binary_cb *compiler_program_serialize_to_binary = NULL;
+gbe_program_new_from_llvm_cb *compiler_program_new_from_llvm = NULL;
+gbe_set_image_base_index_cb *compiler_set_image_base_index = NULL;
//function pointer from libgbeinterp.so
gbe_program_new_from_binary_cb *interp_program_new_from_binary = NULL;
@@ -272,6 +273,10 @@ struct GbeLoaderInitializer
if (compiler_program_build_from_llvm == NULL)
return;
+ compiler_program_new_from_llvm_binary = *(gbe_program_new_from_llvm_binary_cb **)dlsym(dlhCompiler, "gbe_program_new_from_llvm_binary");
+ if (compiler_program_new_from_llvm_binary == NULL)
+ return;
+
compiler_program_serialize_to_binary = *(gbe_program_serialize_to_binary_cb **)dlsym(dlhCompiler, "gbe_program_serialize_to_binary");
if (compiler_program_serialize_to_binary == NULL)
return;