path: root/Software/Beignet/Backend.mdwn
diff options
authorZhigang <Zhigang@web>2013-06-21 02:41:32 -0700
committerwww <>2013-06-21 02:41:32 -0700
commitf46b452b55e4463b19d01a9e7a720aaf29873970 (patch)
treef3ee10c20927771046125479ba5b66d8b343caaf /Software/Beignet/Backend.mdwn
parent6cbeb75a51486151829669f7cf7ee6d03c036e88 (diff)
Diffstat (limited to 'Software/Beignet/Backend.mdwn')
1 files changed, 58 insertions, 0 deletions
diff --git a/Software/Beignet/Backend.mdwn b/Software/Beignet/Backend.mdwn
new file mode 100644
index 00000000..01556940
--- /dev/null
+++ b/Software/Beignet/Backend.mdwn
@@ -0,0 +1,58 @@
+Beignet Compiler
+This code base contains the compiler part of the Beignet OpenCL stack. The
+compiler is responsible to take a OpenCL language string and to compile it into
+a binary that can be executed on Intel integrated GPUs.
+Today, the compiler is far from complete. See [here](doc/TODO.html) for a
+(incomplete) lists of things to do.
+Interface with the run-time
+Even if the compiler makes a very liberal use of C++ (templates, variadic
+templates, macros), we really tried hard to make a very simple interface with
+the run-time. The interface is therefore a pure C99 interface and it is defined
+in `src/backend/program.h`.
+The goal is to hide the complexity of the inner data structures and to enable
+simple run-time implementation using straightforward C99.
+Note that the data structures are fully opaque: this allows us to use both the
+C++ simulator or the real Gen program in a relatively non-intrusive way.
+Various environment variables
+Environment variables are used all over the code. Most important ones are:
+- `OCL_SIMD_WIDTH` `(8 or 16)`. Change the number of lanes per hardware thread
+- `OCL_OUTPUT_GEN_IR` `(0 or 1)`. Output Gen IR (scalar intermediate
+ representation) code
+- `OCL_OUTPUT_LLVM` `(0 or 1)`. Output LLVM code after the lowering passes
+- `OCL_OUTPUT_LLVM_BEFORE_EXTRA_PASS` `(0 or 1)`. Output LLVM code before the
+ lowering passes
+- `OCL_OUTPUT_ASM` `(0 or 1)`. Output Gen ISA
+- `OCL_OUTPUT_REG_ALLOC` `(0 or 1)`. Output Gen register allocations
+Implementation details
+Several key decisions may use the hardware in an usual way. See the following
+documents for the technical details about the compiler implementation:
+- [Flat address space](doc/flat\_address\_space.html)
+- [Unstructured branches](doc/unstructured\_branches.html)
+- [Scalar intermediate representation](doc/gen\_ir.html)
+- [Clean backend implementation](doc/compiler_backend.html)
+Ben Segovia.