[Beignet] [PATCH 00/18] Using bit code ocl lib to replace the huge header file.

junyan.he at inbox.com junyan.he at inbox.com
Tue Aug 12 00:31:02 PDT 2014


From: Junyan He <junyan.he at linux.intel.com>

The PCH file is growing too big. It contains too many defines and macros, which
need a lot of time to parse and may cause some conflicts with the user defined
macros. This patch set will extract the function protocols from its definition
into the header files and compile all the functions' definition into a llvm bitcode
file as a cl library. This manner is also compatible with libclc and we can switch
to libclc if libclc is stable and extensive enough.
This patch set may cause the compiling time slower than the PCH version, because
the header file's parsing and bitcode's linking are not optimized yet, and we will
continue to improve it.

TODO:
Math functions' fast and standard switch in the lib.
Header file parsing optimization, may use PCH or PTH.
Linking optimization.

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 backend/CMakeLists.txt                        |     3 +
 backend/src/CMakeLists.txt                    |   141 +-
 backend/src/GBEConfig.h.in                    |     2 +
 backend/src/backend/program.cpp               |   239 +-
 backend/src/builtin_vector_proto.def          |   295 -
 backend/src/gen_as.sh                         |   101 -
 backend/src/gen_builtin_vector.py             |   414 -
 backend/src/gen_convert.sh                    |   553 -
 backend/src/libocl/Makefile.in                |    81 +
 backend/src/libocl/include/ocl.h              |    23 +
 backend/src/libocl/include/ocl_async.h        |    49 +
 backend/src/libocl/include/ocl_atom.h         |    84 +
 backend/src/libocl/include/ocl_common.inh     |    21 +
 backend/src/libocl/include/ocl_defines.inh    |    23 +
 backend/src/libocl/include/ocl_float.h        |    79 +
 backend/src/libocl/include/ocl_geometric.h    |    39 +
 backend/src/libocl/include/ocl_image.h        |   161 +
 backend/src/libocl/include/ocl_integer.inh    |   160 +
 backend/src/libocl/include/ocl_math.inh       |   103 +
 backend/src/libocl/include/ocl_misc.h         |   122 +
 backend/src/libocl/include/ocl_printf.h       |    15 +
 backend/src/libocl/include/ocl_relational.inh |    78 +
 backend/src/libocl/include/ocl_sync.h         |    18 +
 backend/src/libocl/include/ocl_types.h        |   104 +
 backend/src/libocl/include/ocl_vload.h        |   143 +
 backend/src/libocl/include/ocl_workitem.h     |    15 +
 backend/src/libocl/lib/ocl_async.cl           |    69 +
 backend/src/libocl/lib/ocl_atom.cl            |   122 +
 backend/src/libocl/lib/ocl_barrier.ll         |    39 +
 backend/src/libocl/lib/ocl_common.inc         |    49 +
 backend/src/libocl/lib/ocl_geometric.cl       |    96 +
 backend/src/libocl/lib/ocl_image.cl           |   412 +
 backend/src/libocl/lib/ocl_integer.inc        |   352 +
 backend/src/libocl/lib/ocl_math.inc           |  3316 +++++
 backend/src/libocl/lib/ocl_memcpy.ll          |   336 +
 backend/src/libocl/lib/ocl_memset.ll          |   127 +
 backend/src/libocl/lib/ocl_misc.cl            |   201 +
 backend/src/libocl/lib/ocl_relational.inc     |   151 +
 backend/src/libocl/lib/ocl_sync.cl            |    14 +
 backend/src/libocl/lib/ocl_vload.cl           |   257 +
 backend/src/libocl/lib/ocl_workitem.cl        |    40 +
 backend/src/libocl/script/gen_as.sh           |   124 +
 backend/src/libocl/script/gen_common.inc      |    11 +
 backend/src/libocl/script/gen_convert.sh      |   653 +
 backend/src/libocl/script/gen_vector.py       |   382 +
 backend/src/libocl/script/ocl_common.def      |    22 +
 backend/src/libocl/script/ocl_integer.def     |    31 +
 backend/src/libocl/script/ocl_math.def        |   166 +
 backend/src/libocl/script/ocl_relational.def  |    34 +
 backend/src/llvm/llvm_bitcode_link.cpp        |   138 +
 backend/src/llvm/llvm_gen_backend.hpp         |     3 +
 backend/src/llvm/llvm_to_gen.cpp              |    71 +-
 backend/src/ocl_as.h                          |  3086 -----
 backend/src/ocl_barrier.ll                    |    39 -
 backend/src/ocl_convert.h                     | 17415 ------------------------
 backend/src/ocl_memcpy.ll                     |   336 -
 backend/src/ocl_memset.ll                     |   127 -
 backend/src/ocl_stdlib.tmpl.h                 |  5149 -------
 backend/src/update.sh                         |     3 -
 backend/src/update_as.sh                      |    11 -
 backend/src/update_blob_ocl_header.py         |    65 -
 backend/src/update_convert.sh                 |    12 -
 utests/CMakeLists.txt                         |   154 -
 utests/setenv.sh.in                           |     4 +-
 65 files changed, 8581 insertions(+), 28104 deletions(-)


More information about the Beignet mailing list