path: root/Software/Beignet/howto/cross-compiler-howto.mdwn
diff options
authorZhigang Gong <>2014-06-25 22:31:37 -0700
committerZhigang Gong <>2014-06-25 22:31:37 -0700
commit111f8fb9ebe192707e4fa3217cada124f87a0051 (patch)
tree39c776af4413f07a3c5bfd3940fb116b0a84c958 /Software/Beignet/howto/cross-compiler-howto.mdwn
parentfb3f08003a203cf77064e62e63f406aebbbc372c (diff)
move beignet's document to correct directory.
Signed-off-by: Zhigang Gong <>
Diffstat (limited to 'Software/Beignet/howto/cross-compiler-howto.mdwn')
1 files changed, 60 insertions, 0 deletions
diff --git a/Software/Beignet/howto/cross-compiler-howto.mdwn b/Software/Beignet/howto/cross-compiler-howto.mdwn
new file mode 100644
index 00000000..535cd9aa
--- /dev/null
+++ b/Software/Beignet/howto/cross-compiler-howto.mdwn
@@ -0,0 +1,60 @@
+Cross Compiler HowTo
+Beignet supports both PC devices with full profile and embedded/handheld
+devices with embeded profile. This document describes how to build Beignet
+and OpenCL kernels for a target machine (embedded/handheld devices) in a
+host machine with the help of cross compiler, and also the large-size-reduced
+Beignet driver package for the target machine.
+Build Beignet with a cross compiler
+Besides the general cross compile methods, reference the following options when
+configure Beignet with cmake.
+ Beignet depends on llvm+clang, this option refers to the path of llvm-config,
+ llvm-as, llvm-link and clang in the cross compiler environment.
+ Some cross compiler systems forbid the usage of rpath in binaries/libraries,
+ set this option to be TRUE.
+ It is the GPU pci_id of the target machine, for example, 0x0162 is the pciid
+ of Intel Ivybridge GPU, and 0x0f31 is Intel Baytrail GPU. The information can
+ be queried with command 'lspci -n'.
+ This option controls the prefix of installation path.
+Distribution of large-size-reduced Beignet driver package
+On embedded/handheld devices, storage and memory are scarce, it is necessary to
+provide only the OpenCL runtime library without OpenCL compiler, and only the
+executable binary kernel is supported on such devices.
+It means that just distribute and (~320k in total after strip)
+are enough for OpenCL embeded profile in the target machine.
+Build OpenCL kernels with OpenCL offline compiler
+Since the target machine does not contain the OpenCL compiler, the OpenCL source
+kernel need to be compiled with an OpenCL offline compiler (gbe_bin_generater)
+into binary kernel in the host machine, and the OpenCL application can load the
+binary kernel with function clCreateProgramWithBinary.
+The OpenCL offline compiler gbe_bin_generater is the result of Beignet build and
+locates at .../your_path_to_build/backend/src/gbe_bin_generater, see below for the
+command options.
+gbe_bin_generater INFILE [-pbuild_parameter] -oOUTFILE -tGEN_PCI_ID
+For example, the following command builds OpenCL source kernel from file ''
+for Ivybridge with pci_id 0x0162, and write the result (executable binary kernel)
+into file 'mykernel.bin'.
+gbe_bin_generater -omykernel.bin -t0x0162