[Pkg-opencl-devel] [beignet] 06/66: Imported Debian patch 0.0.0+git2013.04.11+e6b503e-1

Andreas Beckmann anbe at moszumanska.debian.org
Fri Oct 31 07:27:01 UTC 2014


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch master
in repository beignet.

commit f3017abe82094849371f39cd6125cab486fe27ba
Merge: 0c47623 90e5cde
Author: Simon Richter <sjr at debian.org>
Date:   Mon Apr 15 18:22:45 2013 +0200

    Imported Debian patch 0.0.0+git2013.04.11+e6b503e-1

 CMake/FindCPP.cmake                                |    25 -
 CMake/FindDRMIntel.cmake                           |     8 +
 CMake/FindEGL.cmake                                |    35 +
 CMake/FindFlex.cmake                               |    27 -
 CMake/FindGBM.cmake                                |    35 +
 CMake/FindLLVM.cmake                               |    68 +
 CMake/FindXLib.cmake                               |    34 -
 CMake/FindXext.cmake                               |     7 +
 CMake/FindXfixes.cmake                             |     7 +
 CMakeLists.txt                                     |    57 +-
 Makefile                                           |    13 -
 Makefile.defs                                      |    45 -
 Makefile.lib                                       |    24 -
 Makefile.shared                                    |    15 -
 README.html                                        |   141 +
 README.md                                          |    52 +-
 backend/.gitignore                                 |     3 -
 backend/CMakeLists.txt                             |    12 +-
 backend/Makefile                                   |     4 -
 backend/Makefile.defs                              |    25 -
 backend/Makefile.lib                               |    23 -
 backend/Makefile.shared                            |    15 -
 backend/README.html                                |    52 +
 backend/README.md                                  |     4 +-
 backend/doc/TODO.html                              |    93 +
 backend/doc/TODO.md                                |    16 +-
 backend/doc/compiler_backend.html                  |   107 +
 backend/doc/flat_address_space.html                |    93 +
 backend/doc/gen_ir.html                            |   248 +
 backend/doc/unstructured_branches.html             |   280 +
 backend/kernels/compile.sh                         |     6 +
 backend/src/.gitignore                             |     1 +
 backend/src/CMakeLists.txt                         |    34 +-
 backend/src/GBEConfig.h.in                         |     3 +
 backend/src/Makefile                               |     4 -
 backend/src/all-in-one/blob.cpp                    |    59 -
 backend/src/backend/Makefile                       |     4 -
 backend/src/backend/context.cpp                    |    18 +-
 backend/src/backend/gen/Makefile                   |     4 -
 backend/src/backend/gen/gen_mesa_disasm.c          |    41 +-
 backend/src/backend/gen_context.cpp                |    87 +
 backend/src/backend/gen_context.hpp                |     2 +
 backend/src/backend/gen_defs.hpp                   |    59 +-
 backend/src/backend/gen_encoder.cpp                |    70 +-
 backend/src/backend/gen_encoder.hpp                |    13 +-
 .../src/backend/gen_insn_gen7_schedule_info.hxx    |     2 +
 backend/src/backend/gen_insn_selection.cpp         |   143 +-
 backend/src/backend/gen_insn_selection.hpp         |     4 +-
 backend/src/backend/gen_insn_selection.hxx         |     3 +-
 backend/src/backend/gen_reg_allocation.cpp         |    22 +-
 backend/src/backend/gen_reg_allocation.hpp         |     2 +
 backend/src/backend/gen_register.hpp               |     8 +-
 backend/src/backend/program.cpp                    |    13 +-
 backend/src/backend/program.h                      |     4 +-
 backend/src/backend/program.hpp                    |     1 +
 backend/src/ir/Makefile                            |     4 -
 backend/src/ir/context.cpp                         |     4 +-
 backend/src/ir/context.hpp                         |     2 +-
 backend/src/ir/function.cpp                        |     3 +-
 backend/src/ir/function.hpp                        |     8 +-
 backend/src/ir/instruction.cpp                     |   104 +-
 backend/src/ir/instruction.hpp                     |    23 +-
 backend/src/ir/instruction.hxx                     |     2 +
 backend/src/ir/profile.cpp                         |    11 +
 backend/src/ir/profile.hpp                         |     7 +-
 backend/src/ir/register.cpp                        |     6 +-
 backend/src/llvm/CMakeLists.txt                    |    19 -
 backend/src/llvm/Makefile                          |     3 -
 backend/src/llvm/llvm_gen_backend.cpp              |   256 +-
 backend/src/llvm/llvm_gen_ocl_function.hxx         |    34 +
 backend/src/llvm/llvm_passes.cpp                   |    11 +
 backend/src/ocl_common_defines.h                   |   121 +
 backend/src/ocl_stdlib.h                           |   391 +-
 backend/src/ocl_stdlib_str.cpp                     |   475 -
 backend/src/sys/Makefile                           |     3 -
 backend/src/sys/alloc.hpp                          |    10 +-
 backend/src/sys/platform.hpp                       |     7 +
 debian/beignet-dev.install                         |     6 +-
 debian/beignet0.0.1.install                        |     4 +-
 debian/changelog                                   |     6 +
 debian/control                                     |     7 +-
 debian/patches/asd                                 |    47 +
 debian/patches/autogen                             |   974 ++
 debian/patches/clang-from-path                     |    14 +-
 debian/patches/device-info-query                   |    16 +-
 debian/patches/glibc-memalign                      |     6 +-
 debian/patches/ignore-missing-egl                  |    50 +
 debian/patches/implement-gefa                      |    10 +-
 debian/patches/khronos                             |   947 +-
 debian/patches/llvm-3.2                            |    19 +
 debian/patches/missing-header                      |     6 +-
 debian/patches/respect-flags                       |   101 +-
 debian/patches/series                              |    10 +-
 debian/patches/soname                              |    53 +-
 debian/patches/verbose                             |     6 +-
 debian/rules                                       |     2 +-
 debian/source/options                              |     7 +
 include/CL/cl.h                                    |   408 +-
 include/CL/cl.hpp                                  | 12215 +++++++++++++++++++
 include/CL/cl_d3d10.h                              |    43 +-
 include/CL/cl_d3d11.h                              |   126 +
 include/CL/cl_dx9_media_sharing.h                  |   127 +
 include/CL/cl_ext.h                                |    80 +-
 include/CL/cl_gl.h                                 |   122 +-
 include/CL/cl_gl_ext.h                             |    69 +
 include/CL/cl_platform.h                           |   114 +-
 include/CL/glext.h                                 |  8662 -------------
 include/CL/opencl.h                                |    34 +-
 include/CMakeLists.txt                             |     3 +
 kernels/compiler_address_space.cl                  |     9 +
 kernels/compiler_arith_shift_right.cl              |     4 +
 kernels/compiler_async_copy_and_prefetch.cl        |     9 +
 kernels/compiler_atomic_functions.cl               |    14 +
 kernels/compiler_convert_uchar_sat.cl              |     4 +
 kernels/compiler_data_types.cl                     |    80 +
 kernels/compiler_fabs.cl                           |     5 +
 kernels/compiler_function_qualifiers.cl            |     9 +
 kernels/compiler_geometric_builtin.cl              |    11 +
 kernels/compiler_integer_builtin.cl                |    23 +
 kernels/compiler_integer_division.cl               |     6 +
 kernels/compiler_integer_remainder.cl              |     6 +
 kernels/compiler_math_builtin.cl                   |    82 +
 kernels/compiler_math_constants.cl                 |    23 +
 kernels/compiler_mem_fence.cl                      |    10 +
 kernels/compiler_multiple_kernels.cl               |     7 +
 kernels/compiler_preprocessor_macros.cl            |    13 +
 kernels/compiler_relational_builtin.cl             |    24 +
 kernels/compiler_sampler.cl                        |    25 +
 kernels/compiler_saturate.cl                       |    16 +
 kernels/compiler_saturate_sub.cl                   |    16 +
 kernels/compiler_shift_right.cl                    |     4 +
 kernels/compiler_structure_attributes.cl           |    17 +
 kernels/compiler_type_casting.cl                   |    19 +
 kernels/compiler_vector_load_store.cl              |    18 +
 kernels/compiler_volatile.cl                       |     4 +
 kernels/compiler_workitem_builtin.cl               |    12 +
 kernels/empty.cl                                   |     1 +
 kernels/my_test.cl                                 |    26 +
 kernels/test_copy_image.cl                         |    10 +
 kernels/test_fill_gl_image.cl                      |    11 +
 kernels/test_fill_image.cl                         |    13 +
 kernels/test_fill_image0.cl                        |     9 +
 kernels/test_movforphi_undef.cl                    |    18 +
 src/CMakeLists.txt                                 |    18 +-
 src/Makefile                                       |     4 -
 src/OCLConfig.h.in                                 |     3 +
 src/cl_api.c                                       |   114 +-
 src/cl_command_queue.c                             |    20 +-
 src/cl_context.c                                   |    69 +-
 src/cl_context.h                                   |    23 +-
 src/cl_device_id.c                                 |    24 +-
 src/cl_driver.h                                    |    33 +-
 src/cl_driver_defs.c                               |     7 +-
 src/cl_extensions.c                                |   113 +
 src/cl_extensions.h                                |   120 +
 src/cl_gl_api.c                                    |   153 +
 src/cl_gt_device.h                                 |     4 +-
 src/cl_image.c                                     |     2 +-
 src/cl_image.h                                     |     2 +-
 src/cl_kernel.c                                    |    21 +-
 src/cl_kernel.h                                    |     1 +
 src/cl_mem.c                                       |    83 +-
 src/cl_mem.h                                       |    16 +-
 src/cl_mem_gl.c                                    |   232 +
 src/cl_mem_gl.h                                    |    17 +
 src/cl_platform_id.c                               |    37 +-
 src/cl_platform_id.h                               |    23 +
 src/cl_program.c                                   |     8 +-
 src/cl_program.h                                   |     2 +-
 src/cl_utils.h                                     |     4 +-
 src/intel/Makefile                                 |     4 -
 src/intel/intel_defines.h                          |    22 +
 src/intel/intel_driver.c                           |   107 +-
 src/intel/intel_driver.h                           |     6 +
 src/intel/intel_gpgpu.c                            |   182 +-
 src/x11/Makefile                                   |     4 -
 src/x11/dricommon.c                                |     3 +-
 src/x11/dricommon.h                                |     5 +
 src/x11/gbm_deps/backend.h                         |    36 +
 src/x11/gbm_deps/common.h                          |    42 +
 src/x11/gbm_deps/common_drm.h                      |    48 +
 src/x11/gbm_deps/gbm.h                             |   292 +
 src/x11/gbm_deps/gbm_driint.h                      |   108 +
 src/x11/gbm_deps/gbmint.h                          |   116 +
 src/x11/gbm_dri2_x11_platform.c                    |    31 +
 utests/CMakeLists.txt                              |    32 +-
 utests/Makefile                                    |    78 -
 utests/cl_create_kernel.cpp                        |    16 +
 utests/compiler_address_space.cpp                  |    10 +
 utests/compiler_arith_shift_right.cpp              |    43 +
 utests/compiler_async_copy_and_prefetch.cpp        |    10 +
 utests/compiler_atomic_functions.cpp               |    10 +
 utests/compiler_convert_uchar_sat.cpp              |    44 +
 utests/compiler_copy_image.cpp                     |    51 +
 utests/compiler_data_types.cpp                     |     9 +
 utests/compiler_fabs.cpp                           |    44 +
 utests/compiler_fill_gl_image.cpp                  |    72 +
 utests/compiler_fill_image.cpp                     |    40 +
 utests/compiler_fill_image0.cpp                    |    39 +
 utests/compiler_function_qualifiers.cpp            |    10 +
 utests/compiler_geometric_builtin.cpp              |     9 +
 utests/compiler_integer_builtin.cpp                |     9 +
 utests/compiler_integer_division.cpp               |    44 +
 utests/compiler_integer_remainder.cpp              |    44 +
 utests/compiler_math_builtin.cpp                   |     9 +
 utests/compiler_math_constants.cpp                 |     9 +
 utests/compiler_mem_fence.cpp                      |     9 +
 utests/compiler_movforphi_undef.cpp                |    56 +
 utests/compiler_multiple_kernels.cpp               |     8 +
 utests/compiler_preprocessor_macros.cpp            |     9 +
 utests/compiler_program_objects.cpp                |    64 +
 utests/compiler_relational_builtin.cpp             |     9 +
 utests/compiler_sampler.cpp                        |    41 +
 utests/compiler_saturate.cpp                       |   114 +
 utests/compiler_saturate_sub.cpp                   |   114 +
 utests/compiler_shift_right.cpp                    |    45 +
 utests/compiler_structure_attributes.cpp           |     9 +
 utests/compiler_type_casting.cpp                   |    10 +
 utests/compiler_vector_load_store.cpp              |    10 +
 utests/compiler_volatile.cpp                       |     9 +
 utests/compiler_workitem_builtin.cpp               |     9 +
 utests/my_test.cpp                                 |    99 +
 utests/new_data.txt                                |   256 +
 utests/runtime_createcontext.cpp                   |    11 +
 utests/utest_assert.cpp                            |     1 -
 utests/utest_error.c                               |     4 +-
 utests/utest_helper.cpp                            |   192 +-
 utests/utest_helper.hpp                            |    57 +-
 228 files changed, 21774 insertions(+), 10684 deletions(-)

diff --cc debian/beignet-dev.install
index 3a15101,0000000..7009503
mode 100644,000000..100644
--- a/debian/beignet-dev.install
+++ b/debian/beignet-dev.install
@@@ -1,3 -1,0 +1,3 @@@
- libcl.so		/usr/lib
- backend/libgbe.so	/usr/lib
- include/CL/cl_intel.h	/usr/include/CL
++usr/lib/libcl.so		/usr/lib
++usr/lib/libgbe.so		/usr/lib
++usr/include/CL/cl_intel.h	/usr/include/CL
diff --cc debian/beignet0.0.1.install
index 167fb0b,0000000..24c7e1b
mode 100644,000000..100644
--- a/debian/beignet0.0.1.install
+++ b/debian/beignet0.0.1.install
@@@ -1,2 -1,0 +1,2 @@@
- libcl.so.*		/usr/lib
- backend/libgbe.so.*	/usr/lib
++usr/lib/libcl.so.*	/usr/lib
++usr/lib/libgbe.so.*	/usr/lib
diff --cc debian/changelog
index 669a002,0000000..f691dfe
mode 100644,000000..100644
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,23 -1,0 +1,29 @@@
++beignet (0.0.0+git2013.04.11+e6b503e-1) unstable; urgency=low
++
++  * New upstream release
++
++ -- Simon Richter <sjr at debian.org>  Mon, 15 Apr 2013 18:22:45 +0200
++
 +beignet (0.0.0+git2013.04.01+d1b234c-4) unstable; urgency=low
 +
 +  * Build fix for kfreebsd-*
 +
 + -- Simon Richter <sjr at debian.org>  Fri, 12 Apr 2013 11:22:36 +0200
 +
 +beignet (0.0.0+git2013.04.01+d1b234c-3) unstable; urgency=low
 +
 +  * Adjust Build-Depends, Architecture list
 +
 + -- Simon Richter <sjr at debian.org>  Fri, 12 Apr 2013 10:32:36 +0200
 +
 +beignet (0.0.0+git2013.04.01+d1b234c-2) unstable; urgency=low
 +
 +  * Add patch to support size queries in device info
 +
 + -- Simon Richter <sjr at debian.org>  Thu, 11 Apr 2013 14:00:59 +0200
 +
 +beignet (0.0.0+git2013.04.01+d1b234c-1) unstable; urgency=low
 +
 +  * Initial release.
 +
 + -- Simon Richter <sjr at debian.org>  Tue, 09 Apr 2013 17:14:00 +0200
diff --cc debian/control
index 87cf040,0000000..9b6d64b
mode 100644,000000..100644
--- a/debian/control
+++ b/debian/control
@@@ -1,30 -1,0 +1,31 @@@
 +Source: beignet
 +Priority: extra
 +Maintainer: Simon Richter <sjr at debian.org>
- Build-Depends: debhelper (>= 9.0.0), pkg-config, ocl-icd-opencl-dev, libdrm-dev, libxfixes-dev, libxext-dev, llvm-dev (>= 1:3.0)
- Standards-Version: 3.9.3
++Build-Depends: debhelper (>= 9), cmake, pkg-config, ocl-icd-opencl-dev, libdrm-dev, libgbm-dev, libxfixes-dev, libxext-dev, llvm-3.2-dev | llvm-dev (>= 1:3.2)
++Build-Conflicts: libegl1-mesa-dev (<< 9)
++Standards-Version: 3.9.4
 +Section: libs
 +Homepage: http://cgit.freedesktop.org/beignet/
 +
 +Package: beignet-dev
 +Section: libdevel
 +Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64
 +Depends: beignet0.0.1 (= ${binary:Version}), ${misc:Depends}
 +Description: Intel OpenCL library
 + OpenCL (Open Computing Language) is a multivendor open standard for
 + general-purpose parallel programming of heterogeneous systems that include
 + CPUs, GPUs and other processors.
 + .
 + This package contains the development files for directly linking against
 + the Intel implementation.
 +
 +Package: beignet0.0.1
 +Section: libs
 +Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64
- Depends: ${shlibs:Depends}, ${misc:Depends}, clang
++Depends: ${shlibs:Depends}, ${misc:Depends}, clang (<< 1:3.1)
 +Description: Intel OpenCL library
 + OpenCL (Open Computing Language) is a multivendor open standard for
 + general-purpose parallel programming of heterogeneous systems that include
 + CPUs, GPUs and other processors.
 + .
 + This package contains the shared library for the Intel implementation.
diff --cc debian/patches/asd
index 0000000,0000000..6720adf
new file mode 100644
--- /dev/null
+++ b/debian/patches/asd
@@@ -1,0 -1,0 +1,47 @@@
++Description: <short summary of the patch>
++ TODO: Put a short summary on the line above and replace this paragraph
++ with a longer explanation of this change. Complete the meta-information
++ with other relevant fields (see below for details). To make it easier, the
++ information below has been extracted from the changelog. Adjust it or drop
++ it.
++ .
++ beignet (0.0.0+git2013.04.11+e6b503e-1) UNRELEASED; urgency=low
++ .
++   * New upstream release
++Author: Simon Richter <sjr at debian.org>
++
++---
++The information above should follow the Patch Tagging Guidelines, please
++checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
++are templates for supplementary fields that you might want to add:
++
++Origin: <vendor|upstream|other>, <url of original patch>
++Bug: <url in upstream bugtracker>
++Bug-Debian: http://bugs.debian.org/<bugnumber>
++Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
++Forwarded: <no|not-needed|url proving that it has been forwarded>
++Reviewed-By: <name and email of someone who approved the patch>
++Last-Update: <YYYY-MM-DD>
++
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/backend/CMakeLists.txt
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/CMakeLists.txt
++@@ -45,16 +45,16 @@ set (CMAKE_C_CXX_FLAGS "-fvisibility=hid
++ if (COMPILER STREQUAL "GCC")
++   set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -funroll-loops -Wstrict-aliasing=2 -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -ffast-math -fPIC -Wall")
++   set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS}  ${LLVM_CFLAGS}")
++-  set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS}  -Wno-invalid-offsetof -fno-rtti -std=c++0x")
+++  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS}  -Wno-invalid-offsetof -fno-rtti -std=c++0x")
++   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}")
++   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}")
++   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-E")
++-  set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${LLVM_LFLAGS}")
+++  set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined ${LLVM_LFLAGS}")
++   set (CMAKE_CXX_FLAGS_DEBUG          "-g -DGBE_DEBUG=1")
++   set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
++   set (CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG -DGBE_DEBUG=0")
++   set (CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG -DGBE_DEBUG=0")
++-  set (CMAKE_C_FLAGS "${CMAKE_C_CXX_FLAGS}")
+++  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_CXX_FLAGS}")
++   set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}")
++   set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}")
++   set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-E")
diff --cc debian/patches/autogen
index 0000000,0000000..6698ee5
new file mode 100644
--- /dev/null
+++ b/debian/patches/autogen
@@@ -1,0 -1,0 +1,974 @@@
++Description: <short summary of the patch>
++ TODO: Put a short summary on the line above and replace this paragraph
++ with a longer explanation of this change. Complete the meta-information
++ with other relevant fields (see below for details). To make it easier, the
++ information below has been extracted from the changelog. Adjust it or drop
++ it.
++ .
++ beignet (0.0.0+git2013.04.11+e6b503e-1) UNRELEASED; urgency=low
++ .
++   * New upstream release
++Author: Simon Richter <sjr at debian.org>
++
++---
++The information above should follow the Patch Tagging Guidelines, please
++checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
++are templates for supplementary fields that you might want to add:
++
++Origin: <vendor|upstream|other>, <url of original patch>
++Bug: <url in upstream bugtracker>
++Bug-Debian: http://bugs.debian.org/<bugnumber>
++Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
++Forwarded: <no|not-needed|url proving that it has been forwarded>
++Reviewed-By: <name and email of someone who approved the patch>
++Last-Update: <YYYY-MM-DD>
++
++--- /dev/null
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/src/ocl_stdlib_str.cpp
++@@ -0,0 +1,816 @@
+++#include "string"
+++namespace gbe {
+++std::string ocl_stdlib_str = 
+++"/* \n"
+++"uint* Copyright © 2012 Intel Corporation\n"
+++" *\n"
+++" * This library is free software; you can redistribute it and/or\n"
+++" * modify it under the terms of the GNU Lesser General Public\n"
+++" * License as published by the Free Software Foundation; either\n"
+++" * version 2 of the License, or (at your option) any later version.\n"
+++" *\n"
+++" * This library is distributed in the hope that it will be useful,\n"
+++" * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+++" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
+++" * Lesser General Public License for more details.\n"
+++" *\n"
+++" * You should have received a copy of the GNU Lesser General Public\n"
+++" * License along with this library. If not, see <http://www.gnu.org/licenses/>.\n"
+++" *\n"
+++" * Author: Benjamin Segovia <benjamin.segovia at intel.com>\n"
+++" */\n"
+++"\n"
+++"#ifndef __GEN_OCL_STDLIB_H__\n"
+++"#define __GEN_OCL_STDLIB_H__\n"
+++"\n"
+++"#define INLINE __attribute__((always_inline)) inline\n"
+++"#define OVERLOADABLE __attribute__((overloadable))\n"
+++"#define PURE __attribute__((pure))\n"
+++"#define CONST __attribute__((const))\n"
+++"#define INLINE_OVERLOADABLE __attribute__((overloadable,always_inline))\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL built-in scalar data types\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"typedef unsigned char uchar;\n"
+++"typedef unsigned short ushort;\n"
+++"typedef unsigned int uint;\n"
+++"typedef unsigned long ulong;\n"
+++"typedef __typeof__(sizeof(int)) size_t;\n"
+++"typedef __typeof__((int *)0-(int *)0) ptrdiff_t;\n"
+++"typedef signed int intptr_t;\n"
+++"typedef unsigned int uintptr_t;\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL address space\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define __private __attribute__((address_space(0)))\n"
+++"#define __global __attribute__((address_space(1)))\n"
+++"#define __constant __attribute__((address_space(2)))\n"
+++"#define __local __attribute__((address_space(3)))\n"
+++"#define __texture __attribute__((address_space(4)))\n"
+++"#define __sampler __attribute__((address_space(5)))\n"
+++"#define global __global\n"
+++"//#define local __local\n"
+++"#define constant __constant\n"
+++"#define private __private\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL built-in vector data types\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define DEF(type) typedef type type##2 __attribute__((ext_vector_type(2)));\\\n"
+++"                  typedef type type##3 __attribute__((ext_vector_type(3)));\\\n"
+++"                  typedef type type##4 __attribute__((ext_vector_type(4)));\\\n"
+++"                  typedef type type##8 __attribute__((ext_vector_type(8)));\\\n"
+++"                  typedef type type##16 __attribute__((ext_vector_type(16)));\n"
+++"DEF(char);\n"
+++"DEF(uchar);\n"
+++"DEF(short);\n"
+++"DEF(ushort);\n"
+++"DEF(int);\n"
+++"DEF(uint);\n"
+++"DEF(long);\n"
+++"DEF(ulong);\n"
+++"DEF(float);\n"
+++"#undef DEF\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL other built-in data types\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"struct _image2d_t;\n"
+++"typedef __texture struct _image2d_t* image2d_t;\n"
+++"struct _image3d_t;\n"
+++"typedef __texture struct _image3d_t* image3d_t;\n"
+++"typedef __sampler uint* sampler_t;\n"
+++"typedef size_t event_t;\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL conversions & type casting\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"union type_cast_4_b {\n"
+++"  float f;\n"
+++"  uchar4 u4;\n"
+++"};\n"
+++"uchar4 INLINE_OVERLOADABLE as_uchar4(float f) {\n"
+++"    union type_cast_4_b u;\n"
+++"    u.f = f;\n"
+++"    return u.u4;\n"
+++"}\n"
+++"#define DEF(type, n, type2) type##n INLINE_OVERLOADABLE convert_##type##n(type2##n d) { \\\n"
+++"    return (type##n)((type)(d.s0), (type)(d.s1), (type)(d.s2), (type)(d.s3)); \\\n"
+++" }\n"
+++"#define DEF2(type) DEF(type, 4, char); \\\n"
+++"                   DEF(type, 4, uchar); \\\n"
+++"                   DEF(type, 4, short); \\\n"
+++"                   DEF(type, 4, ushort); \\\n"
+++"                   DEF(type, 4, int); \\\n"
+++"                   DEF(type, 4, uint); \\\n"
+++"                   DEF(type, 4, long); \\\n"
+++"                   DEF(type, 4, ulong); \\\n"
+++"                   DEF(type, 4, float);\n"
+++"DEF2(char);\n"
+++"DEF2(uchar);\n"
+++"DEF2(short);\n"
+++"DEF2(ushort);\n"
+++"DEF2(int);\n"
+++"DEF2(uint);\n"
+++"DEF2(long);\n"
+++"DEF2(ulong);\n"
+++"DEF2(float);\n"
+++"#undef DEF2\n"
+++"#undef DEF\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL preprocessor directives & macros\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define __OPENCL_VERSION__ 110\n"
+++"#define __CL_VERSION_1_0__ 100\n"
+++"#define __CL_VERSION_1_1__ 110\n"
+++"#define __ENDIAN_LITTLE__ 1\n"
+++"#define __kernel_exec(X, TYPE) __kernel __attribute__((work_group_size_hint(X,1,1))) \\\n"
+++"                                        __attribute__((vec_type_hint(TYPE)))\n"
+++"#define kernel_exec(X, TYPE) __kernel_exec(X, TYPE)\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL floating-point macros and pragmas\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define FLT_DIG 6\n"
+++"#define FLT_MANT_DIG 24\n"
+++"#define FLT_MAX_10_EXP +38\n"
+++"#define FLT_MAX_EXP +128\n"
+++"#define FLT_MIN_10_EXP -37\n"
+++"#define FLT_MIN_EXP -125\n"
+++"#define FLT_RADIX 2\n"
+++"#define FLT_MAX 0x1.fffffep127f\n"
+++"#define FLT_MIN 0x1.0p-126f\n"
+++"#define FLT_EPSILON 0x1.0p-23f\n"
+++"\n"
+++"#define MAXFLOAT     3.40282347e38F\n"
+++"#define HUGE_VALF    (__builtin_huge_valf())\n"
+++"#define INFINITY     (__builtin_inff())\n"
+++"#define NAN          (__builtin_nanf(\"\"))\n"
+++"#define M_E_F        2.718281828459045F\n"
+++"#define M_LOG2E_F    1.4426950408889634F\n"
+++"#define M_LOG10E_F   0.43429448190325176F\n"
+++"#define M_LN2_F      0.6931471805599453F\n"
+++"#define M_LN10_F     2.302585092994046F\n"
+++"#define M_PI_F       3.141592653589793F\n"
+++"#define M_PI_2_F     1.5707963267948966F\n"
+++"#define M_PI_4_F     0.7853981633974483F\n"
+++"#define M_1_PI_F     0.3183098861837907F\n"
+++"#define M_2_PI_F     0.6366197723675814F\n"
+++"#define M_2_SQRTPI_F 1.1283791670955126F\n"
+++"#define M_SQRT2_F    1.4142135623730951F\n"
+++"#define M_SQRT1_2_F  0.7071067811865476F\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL integer built-in macros\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define CHAR_BIT    8\n"
+++"#define CHAR_MAX    SCHAR_MAX\n"
+++"#define CHAR_MIN    SCHAR_MIN\n"
+++"#define INT_MAX     2147483647\n"
+++"#define INT_MIN     (-2147483647 - 1)\n"
+++"#define LONG_MAX    0x7fffffffffffffffL\n"
+++"#define LONG_MIN    (-0x7fffffffffffffffL - 1)\n"
+++"#define SCHAR_MAX   127\n"
+++"#define SCHAR_MIN   (-127 - 1)\n"
+++"#define SHRT_MAX    32767\n"
+++"#define SHRT_MIN    (-32767 - 1)\n"
+++"#define UCHAR_MAX   255\n"
+++"#define USHRT_MAX   65535\n"
+++"#define UINT_MAX    0xffffffff\n"
+++"#define ULONG_MAX   0xffffffffffffffffUL\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// OpenCL relational built-in functions\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define DEF DECL(int, float); \\\n"
+++"            DECL(int2, float2); \\\n"
+++"            DECL(int3, float3); \\\n"
+++"            DECL(int4, float4); \\\n"
+++"            DECL(int8, float8); \\\n"
+++"            DECL(int16, float16);\n"
+++"#define DECL(ret, type) ret INLINE_OVERLOADABLE isequal(type x, type y) { return x == y; }\n"
+++"DEF;\n"
+++"#undef DECL\n"
+++"#define DECL(ret, type) ret INLINE_OVERLOADABLE isnotequal(type x, type y) { return x != y; }\n"
+++"DEF;\n"
+++"#undef DECL\n"
+++"#define DECL(ret, type) ret INLINE_OVERLOADABLE isgreater(type x, type y) { return x > y; }\n"
+++"DEF;\n"
+++"#undef DECL\n"
+++"#define DECL(ret, type) ret INLINE_OVERLOADABLE isgreaterequal(type x, type y) { return x >= y; }\n"
+++"DEF;\n"
+++"#undef DECL\n"
+++"#define DECL(ret, type) ret INLINE_OVERLOADABLE isless(type x, type y) { return x < y; }\n"
+++"DEF;\n"
+++"#undef DECL\n"
+++"#define DECL(ret, type) ret INLINE_OVERLOADABLE islessequal(type x, type y) { return x <= y; }\n"
+++"DEF;\n"
+++"#undef DECL\n"
+++"#undef DEF\n"
+++"\n"
+++"#define SDEF(TYPE)                                                              \\\n"
+++"INLINE_OVERLOADABLE TYPE ocl_sadd_sat(TYPE x, TYPE y);                          \\\n"
+++"INLINE_OVERLOADABLE TYPE ocl_ssub_sat(TYPE x, TYPE y);                          \\\n"
+++"INLINE_OVERLOADABLE TYPE add_sat(TYPE x, TYPE y) { return ocl_sadd_sat(x, y); } \\\n"
+++"INLINE_OVERLOADABLE TYPE sub_sat(TYPE x, TYPE y) { return ocl_ssub_sat(x, y); }\n"
+++"SDEF(char);\n"
+++"SDEF(short);\n"
+++"SDEF(int);\n"
+++"SDEF(long);\n"
+++"#undef SDEF\n"
+++"#define UDEF(TYPE)                                                              \\\n"
+++"INLINE_OVERLOADABLE TYPE ocl_uadd_sat(TYPE x, TYPE y);                          \\\n"
+++"INLINE_OVERLOADABLE TYPE ocl_usub_sat(TYPE x, TYPE y);                          \\\n"
+++"INLINE_OVERLOADABLE TYPE add_sat(TYPE x, TYPE y) { return ocl_uadd_sat(x, y); } \\\n"
+++"INLINE_OVERLOADABLE TYPE sub_sat(TYPE x, TYPE y) { return ocl_usub_sat(x, y); }\n"
+++"UDEF(uchar);\n"
+++"UDEF(ushort);\n"
+++"UDEF(uint);\n"
+++"UDEF(ulong);\n"
+++"#undef UDEF\n"
+++"\n"
+++"\n"
+++"uchar INLINE_OVERLOADABLE convert_uchar_sat(float x) {\n"
+++"    return add_sat((uchar)x, (uchar)0);\n"
+++"}\n"
+++"\n"
+++"#define DEC2(name) INLINE_OVERLOADABLE int2 name(float2 x) { return (name(x.s0), name(x.s1)); }\n"
+++"#define DEC3(name) INLINE_OVERLOADABLE int3 name(float3 x) { return (name(x.s0), name(x.s1), name(x.s2)); }\n"
+++"#define DEC4(name) INLINE_OVERLOADABLE int4 name(float4 x) { return (name(x.s0), name(x.s1), name(x.s2), name(x.s3)); }\n"
+++"#define DEC8(name) INLINE_OVERLOADABLE int8 name(float8 x) { return (name(x.s0), name(x.s1), name(x.s2), name(x.s3), name(x.s4), name(x.s5), name(x.s6), name(x.s7)); }\n"
+++"#define DEC16(name) INLINE_OVERLOADABLE int16 name(float16 x) { return (name(x.s0), name(x.s1), name(x.s2), name(x.s3), name(x.s4), name(x.s5), name(x.s6), name(x.s7), name(x.s8), name(x.s9), name(x.sA), name(x.sB), name(x.sC), name(x.sD), name(x.sE), name(x.sF)); }\n"
+++"INLINE_OVERLOADABLE int isfinite(float x) { return __builtin_isfinite(x); }\n"
+++"DEC2(isfinite);\n"
+++"DEC3(isfinite);\n"
+++"DEC4(isfinite);\n"
+++"DEC8(isfinite);\n"
+++"DEC16(isfinite);\n"
+++"INLINE_OVERLOADABLE int isinf(float x) { return __builtin_isinf(x); }\n"
+++"DEC2(isinf);\n"
+++"DEC3(isinf);\n"
+++"DEC4(isinf);\n"
+++"DEC8(isinf);\n"
+++"DEC16(isinf);\n"
+++"INLINE_OVERLOADABLE int isnan(float x) { return __builtin_isnan(x); }\n"
+++"DEC2(isnan);\n"
+++"DEC3(isnan);\n"
+++"DEC4(isnan);\n"
+++"DEC8(isnan);\n"
+++"DEC16(isnan);\n"
+++"INLINE_OVERLOADABLE int isnormal(float x) { return __builtin_isnormal(x); }\n"
+++"DEC2(isnormal);\n"
+++"DEC3(isnormal);\n"
+++"DEC4(isnormal);\n"
+++"DEC8(isnormal);\n"
+++"DEC16(isnormal);\n"
+++"INLINE_OVERLOADABLE int signbit(float x) { return __builtin_signbit(x); }\n"
+++"DEC2(signbit);\n"
+++"DEC3(signbit);\n"
+++"DEC4(signbit);\n"
+++"DEC8(signbit);\n"
+++"DEC16(signbit);\n"
+++"#undef DEC2\n"
+++"#undef DEC3\n"
+++"#undef DEC4\n"
+++"#undef DEC8\n"
+++"#undef DEC16\n"
+++"\n"
+++"#define DEC2(name) INLINE_OVERLOADABLE int2 name(float2 x, float2 y) { return (name(x.s0, y.s0), name(x.s1, y.s1)); }\n"
+++"#define DEC3(name) INLINE_OVERLOADABLE int3 name(float3 x, float3 y) { return (name(x.s0, y.s0), name(x.s1, y.s1), name(x.s2, y.s2)); }\n"
+++"#define DEC4(name) INLINE_OVERLOADABLE int4 name(float4 x, float4 y) { return (name(x.s0, y.s0), name(x.s1, y.s1), name(x.s2, y.s2), name(x.s3, y.s3)); }\n"
+++"#define DEC8(name) INLINE_OVERLOADABLE int8 name(float8 x, float8 y) { return (name(x.s0, y.s0), name(x.s1, y.s1), name(x.s2, y.s2), name(x.s3, y.s3), name(x.s4, y.s4), name(x.s5, y.s5), name(x.s6, y.s6), name(x.s7, y.s7)); }\n"
+++"#define DEC16(name) INLINE_OVERLOADABLE int16 name(float16 x, float16 y) { return (name(x.s0, y.s0), name(x.s1, y.s1), name(x.s2, y.s2), name(x.s3, y.s3), name(x.s4, y.s4), name(x.s5, y.s5), name(x.s6, y.s6), name(x.s7, y.s7), name(x.s8, y.s8), name(x.s9, y.s9), name(x.sA, y.sA), name(x.sB, y.sB), name(x.sC, y.sC), name(x.sD, y.sD), name(x.sE, y.sE), name(x.sF, y.sF)); }\n"
+++"INLINE_OVERLOADABLE int islessgreater(float x, float y) { return (x<y)||(x>y); }\n"
+++"DEC2(islessgreater);\n"
+++"DEC3(islessgreater);\n"
+++"DEC4(islessgreater);\n"
+++"DEC8(islessgreater);\n"
+++"DEC16(islessgreater);\n"
+++"INLINE_OVERLOADABLE int isordered(float x, float y) { return isequal(x,x) && isequal(y,y); }\n"
+++"DEC2(isordered);\n"
+++"DEC3(isordered);\n"
+++"DEC4(isordered);\n"
+++"DEC8(isordered);\n"
+++"DEC16(isordered);\n"
+++"INLINE_OVERLOADABLE int isunordered(float x, float y) { return isnan(x) || isnan(y); }\n"
+++"DEC2(isunordered);\n"
+++"DEC3(isunordered);\n"
+++"DEC4(isunordered);\n"
+++"DEC8(isunordered);\n"
+++"DEC16(isunordered);\n"
+++"#undef DEC2\n"
+++"#undef DEC3\n"
+++"#undef DEC4\n"
+++"#undef DEC8\n"
+++"#undef DEC16\n"
+++"#define DEC1(type) INLINE_OVERLOADABLE int any(type a) { return a<0; }\n"
+++"#define DEC2(type) INLINE_OVERLOADABLE int any(type a) { return a.s0<0 || a.s1<0; }\n"
+++"#define DEC3(type) INLINE_OVERLOADABLE int any(type a) { return a.s0<0 || a.s1<0 || a.s2<0; }\n"
+++"#define DEC4(type) INLINE_OVERLOADABLE int any(type a) { return a.s0<0 || a.s1<0 || a.s2<0 || a.s3<0; }\n"
+++"#define DEC8(type) INLINE_OVERLOADABLE int any(type a) { return a.s0<0 || a.s1<0 || a.s2<0 || a.s3<0 || a.s4<0 || a.s5<0 || a.s6<0 || a.s7<0; }\n"
+++"#define DEC16(type) INLINE_OVERLOADABLE int any(type a) { return a.s0<0 || a.s1<0 || a.s2<0 || a.s3<0 || a.s4<0 || a.s5<0 || a.s6<0 || a.s7<0 || a.s8<0 || a.s9<0 || a.sA<0 || a.sB<0 || a.sC<0 || a.sD<0 || a.sE<0 || a.sF<0; }\n"
+++"DEC1(char);\n"
+++"DEC1(short);\n"
+++"DEC1(int);\n"
+++"DEC1(long);\n"
+++"#define DEC(n) DEC##n(char##n); DEC##n(short##n); DEC##n(int##n); DEC##n(long##n);\n"
+++"DEC(2);\n"
+++"DEC(3);\n"
+++"DEC(4);\n"
+++"DEC(8);\n"
+++"DEC(16);\n"
+++"#undef DEC\n"
+++"#undef DEC1\n"
+++"#undef DEC2\n"
+++"#undef DEC3\n"
+++"#undef DEC4\n"
+++"#undef DEC8\n"
+++"#undef DEC16\n"
+++"#define DEC1(type) INLINE_OVERLOADABLE int all(type a) { return a<0; }\n"
+++"#define DEC2(type) INLINE_OVERLOADABLE int all(type a) { return a.s0<0 && a.s1<0; }\n"
+++"#define DEC3(type) INLINE_OVERLOADABLE int all(type a) { return a.s0<0 && a.s1<0 && a.s2<0; }\n"
+++"#define DEC4(type) INLINE_OVERLOADABLE int all(type a) { return a.s0<0 && a.s1<0 && a.s2<0 && a.s3<0; }\n"
+++"#define DEC8(type) INLINE_OVERLOADABLE int all(type a) { return a.s0<0 && a.s1<0 && a.s2<0 && a.s3<0 && a.s4<0 && a.s5<0 && a.s6<0 && a.s7<0; }\n"
+++"#define DEC16(type) INLINE_OVERLOADABLE int all(type a) { return a.s0<0 && a.s1<0 && a.s2<0 && a.s3<0 && a.s4<0 && a.s5<0 && a.s6<0 && a.s7<0 && a.s8<0 && a.s9<0 && a.sA<0 && a.sB<0 && a.sC<0 && a.sD<0 && a.sE<0 && a.sF<0; }\n"
+++"DEC1(char);\n"
+++"DEC1(short);\n"
+++"DEC1(int);\n"
+++"DEC1(long);\n"
+++"#define DEC(n) DEC##n(char##n); DEC##n(short##n); DEC##n(int##n); DEC##n(long##n);\n"
+++"DEC(2);\n"
+++"DEC(3);\n"
+++"DEC(4);\n"
+++"DEC(8);\n"
+++"DEC(16);\n"
+++"#undef DEC\n"
+++"#undef DEC1\n"
+++"#undef DEC2\n"
+++"#undef DEC3\n"
+++"#undef DEC4\n"
+++"#undef DEC8\n"
+++"#undef DEC16\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Work Items functions (see 6.11.1 of OCL 1.1 spec)\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// TODO get_global_offset\n"
+++"// TODO get_work_dim\n"
+++"\n"
+++"#define DECL_INTERNAL_WORK_ITEM_FN(NAME) \\\n"
+++"PURE CONST unsigned int __gen_ocl_##NAME##0(void); \\\n"
+++"PURE CONST unsigned int __gen_ocl_##NAME##1(void); \\\n"
+++"PURE CONST unsigned int __gen_ocl_##NAME##2(void);\n"
+++"DECL_INTERNAL_WORK_ITEM_FN(get_group_id)\n"
+++"DECL_INTERNAL_WORK_ITEM_FN(get_local_id)\n"
+++"DECL_INTERNAL_WORK_ITEM_FN(get_local_size)\n"
+++"DECL_INTERNAL_WORK_ITEM_FN(get_global_size)\n"
+++"DECL_INTERNAL_WORK_ITEM_FN(get_num_groups)\n"
+++"#undef DECL_INTERNAL_WORK_ITEM_FN\n"
+++"\n"
+++"#define DECL_PUBLIC_WORK_ITEM_FN(NAME) \\\n"
+++"inline unsigned NAME(unsigned int dim) { \\\n"
+++"  if (dim == 0) return __gen_ocl_##NAME##0(); \\\n"
+++"  else if (dim == 1) return __gen_ocl_##NAME##1(); \\\n"
+++"  else if (dim == 2) return __gen_ocl_##NAME##2(); \\\n"
+++"  else return 0; \\\n"
+++"}\n"
+++"DECL_PUBLIC_WORK_ITEM_FN(get_group_id)\n"
+++"DECL_PUBLIC_WORK_ITEM_FN(get_local_id)\n"
+++"DECL_PUBLIC_WORK_ITEM_FN(get_local_size)\n"
+++"DECL_PUBLIC_WORK_ITEM_FN(get_global_size)\n"
+++"DECL_PUBLIC_WORK_ITEM_FN(get_num_groups)\n"
+++"#undef DECL_PUBLIC_WORK_ITEM_FN\n"
+++"\n"
+++"INLINE uint get_global_id(uint dim) {\n"
+++"  return get_local_id(dim) + get_local_size(dim) * get_group_id(dim);\n"
+++"}\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Math Functions (see 6.11.2 of OCL 1.1 spec)\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"PURE CONST float __gen_ocl_fabs(float x);\n"
+++"PURE CONST float __gen_ocl_sin(float x);\n"
+++"PURE CONST float __gen_ocl_cos(float x);\n"
+++"PURE CONST float __gen_ocl_sqrt(float x);\n"
+++"PURE CONST float __gen_ocl_rsqrt(float x);\n"
+++"PURE CONST float __gen_ocl_log(float x);\n"
+++"PURE CONST float __gen_ocl_pow(float x, float y);\n"
+++"PURE CONST float __gen_ocl_rcp(float x);\n"
+++"PURE CONST float __gen_ocl_rndz(float x);\n"
+++"PURE CONST float __gen_ocl_rnde(float x);\n"
+++"PURE CONST float __gen_ocl_rndu(float x);\n"
+++"PURE CONST float __gen_ocl_rndd(float x);\n"
+++"INLINE OVERLOADABLE float native_cos(float x) { return __gen_ocl_cos(x); }\n"
+++"INLINE OVERLOADABLE float native_sin(float x) { return __gen_ocl_sin(x); }\n"
+++"INLINE OVERLOADABLE float native_sqrt(float x) { return __gen_ocl_sqrt(x); }\n"
+++"INLINE OVERLOADABLE float native_rsqrt(float x) { return __gen_ocl_rsqrt(x); }\n"
+++"INLINE OVERLOADABLE float native_log2(float x) { return __gen_ocl_log(x); }\n"
+++"INLINE OVERLOADABLE float native_log(float x) {\n"
+++"  return native_log2(x) * 0.6931472002f;\n"
+++"}\n"
+++"INLINE OVERLOADABLE float native_log10(float x) {\n"
+++"  return native_log2(x) * 0.3010299956f;\n"
+++"}\n"
+++"INLINE OVERLOADABLE float native_powr(float x, float y) { return __gen_ocl_pow(x,y); }\n"
+++"INLINE OVERLOADABLE float native_recip(float x) { return __gen_ocl_rcp(x); }\n"
+++"INLINE OVERLOADABLE float native_tan(float x) {\n"
+++"  return native_sin(x) / native_cos(x);\n"
+++"}\n"
+++"#define E 2.71828182845904523536f\n"
+++"INLINE OVERLOADABLE float native_exp(float x) { return native_powr(E, x); }\n"
+++"#undef E\n"
+++"\n"
+++"// XXX work-around PTX profile\n"
+++"#define sqrt native_sqrt\n"
+++"INLINE OVERLOADABLE float rsqrt(float x) { return native_rsqrt(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_fabs(float x)  { return __gen_ocl_fabs(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_trunc(float x) { return __gen_ocl_rndz(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_round(float x) { return __gen_ocl_rnde(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_floor(float x) { return __gen_ocl_rndd(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_ceil(float x)  { return __gen_ocl_rndu(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_log(float x)   { return native_log(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_log2(float x)  { return native_log2(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_log10(float x) { return native_log10(x); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_exp(float x)   { return native_exp(x); }\n"
+++"INLINE OVERLOADABLE float powr(float x, float y) { return __gen_ocl_pow(x,y); }\n"
+++"INLINE OVERLOADABLE float fmod(float x, float y) { return x-y*__gen_ocl_rndz(x/y); }\n"
+++"\n"
+++"// TODO use llvm intrinsics definitions\n"
+++"#define cos native_cos\n"
+++"#define sin native_sin\n"
+++"#define pow powr\n"
+++"\n"
+++"INLINE OVERLOADABLE float mad(float a, float b, float c) {\n"
+++"  return a*b+c;\n"
+++"}\n"
+++"\n"
+++"INLINE OVERLOADABLE uint select(uint src0, uint src1, uint cond) {\n"
+++"  return cond ? src1 : src0;\n"
+++"}\n"
+++"INLINE OVERLOADABLE int select(int src0, int src1, int cond) {\n"
+++"  return cond ? src1 : src0;\n"
+++"}\n"
+++"INLINE OVERLOADABLE float select(float src0, float src1, int cond) {\n"
+++"  return cond ? src1 : src0;\n"
+++"}\n"
+++"\n"
+++"// This will be optimized out by LLVM and will output LLVM select instructions\n"
+++"#define DECL_SELECT4(TYPE4, TYPE, COND_TYPE4, MASK) \\\n"
+++"INLINE OVERLOADABLE TYPE4 select(TYPE4 src0, TYPE4 src1, COND_TYPE4 cond) { \\\n"
+++"  TYPE4 dst; \\\n"
+++"  const TYPE x0 = src0.x; /* Fix performance issue with CLANG */ \\\n"
+++"  const TYPE x1 = src1.x; \\\n"
+++"  const TYPE y0 = src0.y; \\\n"
+++"  const TYPE y1 = src1.y; \\\n"
+++"  const TYPE z0 = src0.z; \\\n"
+++"  const TYPE z1 = src1.z; \\\n"
+++"  const TYPE w0 = src0.w; \\\n"
+++"  const TYPE w1 = src1.w; \\\n"
+++"  dst.x = (cond.x & MASK) ? x1 : x0; \\\n"
+++"  dst.y = (cond.y & MASK) ? y1 : y0; \\\n"
+++"  dst.z = (cond.z & MASK) ? z1 : z0; \\\n"
+++"  dst.w = (cond.w & MASK) ? w1 : w0; \\\n"
+++"  return dst; \\\n"
+++"}\n"
+++"DECL_SELECT4(int4, int, int4, 0x80000000)\n"
+++"DECL_SELECT4(float4, float, int4, 0x80000000)\n"
+++"#undef DECL_SELECT4\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Common Functions (see 6.11.4 of OCL 1.1 spec)\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define DECL_MIN_MAX(TYPE) \\\n"
+++"INLINE OVERLOADABLE TYPE max(TYPE a, TYPE b) { \\\n"
+++"  return a > b ? a : b; \\\n"
+++"} \\\n"
+++"INLINE OVERLOADABLE TYPE min(TYPE a, TYPE b) { \\\n"
+++"  return a < b ? a : b; \\\n"
+++"}\n"
+++"DECL_MIN_MAX(float)\n"
+++"DECL_MIN_MAX(int)\n"
+++"DECL_MIN_MAX(short)\n"
+++"DECL_MIN_MAX(char)\n"
+++"DECL_MIN_MAX(uint)\n"
+++"DECL_MIN_MAX(unsigned short)\n"
+++"DECL_MIN_MAX(unsigned char)\n"
+++"#undef DECL_MIN_MAX\n"
+++"\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_fmax(float a, float b) { return max(a,b); }\n"
+++"INLINE OVERLOADABLE float __gen_ocl_internal_fmin(float a, float b) { return min(a,b); }\n"
+++"INLINE OVERLOADABLE float mix(float x, float y, float a) { return x + (y-x)*a;}\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Geometric functions (see 6.11.5 of OCL 1.1 spec)\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"INLINE OVERLOADABLE float dot(float2 p0, float2 p1) {\n"
+++"  return mad(p0.x,p1.x,p0.y*p1.y);\n"
+++"}\n"
+++"INLINE OVERLOADABLE float dot(float3 p0, float3 p1) {\n"
+++"  return mad(p0.x,p1.x,mad(p0.z,p1.z,p0.y*p1.y));\n"
+++"}\n"
+++"INLINE OVERLOADABLE float dot(float4 p0, float4 p1) {\n"
+++"  return mad(p0.x,p1.x,mad(p0.w,p1.w,mad(p0.z,p1.z,p0.y*p1.y)));\n"
+++"}\n"
+++"\n"
+++"INLINE OVERLOADABLE float dot(float8 p0, float8 p1) {\n"
+++"  return mad(p0.x,p1.x,mad(p0.s7,p1.s7, mad(p0.s6,p1.s6,mad(p0.s5,p1.s5,\n"
+++"         mad(p0.s4,p1.s4,mad(p0.w,p1.w, mad(p0.z,p1.z,p0.y*p1.y)))))));\n"
+++"}\n"
+++"INLINE OVERLOADABLE float dot(float16 p0, float16 p1) {\n"
+++"  return mad(p0.sc,p1.sc,mad(p0.sd,p1.sd,mad(p0.se,p1.se,mad(p0.sf,p1.sf,\n"
+++"         mad(p0.s8,p1.s8,mad(p0.s9,p1.s9,mad(p0.sa,p1.sa,mad(p0.sb,p1.sb,\n"
+++"         mad(p0.x,p1.x,mad(p0.s7,p1.s7, mad(p0.s6,p1.s6,mad(p0.s5,p1.s5,\n"
+++"         mad(p0.s4,p1.s4,mad(p0.w,p1.w, mad(p0.z,p1.z,p0.y*p1.y)))))))))))))));\n"
+++"}\n"
+++"\n"
+++"INLINE OVERLOADABLE float length(float x) { return __gen_ocl_fabs(x); }\n"
+++"INLINE OVERLOADABLE float length(float2 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float length(float3 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float length(float4 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float length(float8 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float length(float16 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float distance(float x, float y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float distance(float2 x, float2 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float distance(float3 x, float3 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float distance(float4 x, float4 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float distance(float8 x, float8 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float distance(float16 x, float16 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float normalize(float x) { return 1.f; }\n"
+++"INLINE OVERLOADABLE float2 normalize(float2 x) { return x * rsqrt(dot(x, x)); }\n"
+++"INLINE OVERLOADABLE float3 normalize(float3 x) { return x * rsqrt(dot(x, x)); }\n"
+++"INLINE OVERLOADABLE float4 normalize(float4 x) { return x * rsqrt(dot(x, x)); }\n"
+++"INLINE OVERLOADABLE float8 normalize(float8 x) { return x * rsqrt(dot(x, x)); }\n"
+++"INLINE OVERLOADABLE float16 normalize(float16 x) { return x * rsqrt(dot(x, x)); }\n"
+++"\n"
+++"INLINE OVERLOADABLE float fast_length(float x) { return __gen_ocl_fabs(x); }\n"
+++"INLINE OVERLOADABLE float fast_length(float2 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float fast_length(float3 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float fast_length(float4 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float fast_length(float8 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float fast_length(float16 x) { return sqrt(dot(x,x)); }\n"
+++"INLINE OVERLOADABLE float fast_distance(float x, float y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float fast_distance(float2 x, float2 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float fast_distance(float3 x, float3 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float fast_distance(float4 x, float4 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float fast_distance(float8 x, float8 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float fast_distance(float16 x, float16 y) { return length(x-y); }\n"
+++"INLINE OVERLOADABLE float fast_normalize(float x) { return 1.f; }\n"
+++"INLINE OVERLOADABLE float2 fast_normalize(float2 x) { return x * rsqrt(dot(x, x)); }\n"
+++"INLINE OVERLOADABLE float3 fast_normalize(float3 x) { return x * rsqrt(dot(x, x)); }\n"
+++"INLINE OVERLOADABLE float4 fast_normalize(float4 x) { return x * rsqrt(dot(x, x)); }\n"
+++"INLINE OVERLOADABLE float8 fast_normalize(float8 x) { return x * rsqrt(dot(x, x)); }\n"
+++"INLINE OVERLOADABLE float16 fast_normalize(float16 x) { return x * rsqrt(dot(x, x)); }\n"
+++"\n"
+++"INLINE OVERLOADABLE float3 cross(float3 v0, float3 v1) {\n"
+++"   return v0.yzx*v1.zxy-v0.zxy*v1.yzx;\n"
+++"}\n"
+++"INLINE OVERLOADABLE float4 cross(float4 v0, float4 v1) {\n"
+++"   return (float4)(v0.yzx*v1.zxy-v0.zxy*v1.yzx, 0.f);\n"
+++"}\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Vector loads and stores\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"\n"
+++"// These loads and stores will use untyped reads and writes, so we can just\n"
+++"// cast to vector loads / stores. Not C99 compliant BTW due to aliasing issue.\n"
+++"// Well we do not care, we do not activate TBAA in the compiler\n"
+++"#define DECL_UNTYPED_RW_SPACE_N(TYPE, DIM, SPACE) \\\n"
+++"INLINE OVERLOADABLE TYPE##DIM vload##DIM(size_t offset, const SPACE TYPE *p) { \\\n"
+++"  return *(SPACE TYPE##DIM *) (p + DIM * offset); \\\n"
+++"} \\\n"
+++"INLINE OVERLOADABLE void vstore##DIM(TYPE##DIM v, size_t offset, SPACE TYPE *p) { \\\n"
+++"  *(SPACE TYPE##DIM *) (p + DIM * offset) = v; \\\n"
+++"}\n"
+++"\n"
+++"#define DECL_UNTYPED_RW_ALL_SPACE(TYPE, SPACE) \\\n"
+++"  DECL_UNTYPED_RW_SPACE_N(TYPE, 2, SPACE) \\\n"
+++"  DECL_UNTYPED_RW_SPACE_N(TYPE, 3, SPACE) \\\n"
+++"  DECL_UNTYPED_RW_SPACE_N(TYPE, 4, SPACE) \\\n"
+++"  DECL_UNTYPED_RW_SPACE_N(TYPE, 8, SPACE) \\\n"
+++"  DECL_UNTYPED_RW_SPACE_N(TYPE, 16, SPACE)\n"
+++"\n"
+++"#define DECL_UNTYPED_RW_ALL(TYPE) \\\n"
+++"  DECL_UNTYPED_RW_ALL_SPACE(TYPE, __global) \\\n"
+++"  DECL_UNTYPED_RW_ALL_SPACE(TYPE, __local) \\\n"
+++"  DECL_UNTYPED_RW_ALL_SPACE(TYPE, __constant) \\\n"
+++"  DECL_UNTYPED_RW_ALL_SPACE(TYPE, __private)\n"
+++"\n"
+++"DECL_UNTYPED_RW_ALL(char)\n"
+++"DECL_UNTYPED_RW_ALL(uchar)\n"
+++"DECL_UNTYPED_RW_ALL(short)\n"
+++"DECL_UNTYPED_RW_ALL(ushort)\n"
+++"DECL_UNTYPED_RW_ALL(int)\n"
+++"DECL_UNTYPED_RW_ALL(uint)\n"
+++"DECL_UNTYPED_RW_ALL(long)\n"
+++"DECL_UNTYPED_RW_ALL(ulong)\n"
+++"DECL_UNTYPED_RW_ALL(float)\n"
+++"\n"
+++"#undef DECL_UNTYPED_RW_ALL\n"
+++"#undef DECL_UNTYPED_RW_ALL_SPACE\n"
+++"#undef DECL_UNTYPED_RW_SPACE_N\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Declare functions for vector types which are derived from scalar ones\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define DECL_VECTOR_1OP(NAME, TYPE) \\\n"
+++"  INLINE OVERLOADABLE TYPE##2 NAME(TYPE##2 v) { \\\n"
+++"    return (TYPE##2)(NAME(v.x), NAME(v.y)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##3 NAME(TYPE##3 v) { \\\n"
+++"    return (TYPE##3)(NAME(v.x), NAME(v.y), NAME(v.z)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##4 NAME(TYPE##4 v) { \\\n"
+++"    return (TYPE##4)(NAME(v.x), NAME(v.y), NAME(v.z), NAME(v.w)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##8 NAME(TYPE##8 v) { \\\n"
+++"    TYPE##8 dst;\\\n"
+++"    dst.s0123 = NAME(v.s0123);\\\n"
+++"    dst.s4567 = NAME(v.s4567);\\\n"
+++"    return dst;\\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##16 NAME(TYPE##16 v) { \\\n"
+++"    TYPE##16 dst;\\\n"
+++"    dst.s01234567 = NAME(v.s01234567);\\\n"
+++"    dst.s89abcdef = NAME(v.s89abcdef);\\\n"
+++"    return dst;\\\n"
+++"  }\n"
+++"DECL_VECTOR_1OP(native_cos, float);\n"
+++"DECL_VECTOR_1OP(native_sin, float);\n"
+++"DECL_VECTOR_1OP(native_tan, float);\n"
+++"DECL_VECTOR_1OP(native_sqrt, float);\n"
+++"DECL_VECTOR_1OP(native_rsqrt, float);\n"
+++"DECL_VECTOR_1OP(native_log2, float);\n"
+++"DECL_VECTOR_1OP(native_recip, float);\n"
+++"DECL_VECTOR_1OP(__gen_ocl_internal_fabs, float);\n"
+++"DECL_VECTOR_1OP(__gen_ocl_internal_trunc, float);\n"
+++"DECL_VECTOR_1OP(__gen_ocl_internal_round, float);\n"
+++"DECL_VECTOR_1OP(__gen_ocl_internal_floor, float);\n"
+++"DECL_VECTOR_1OP(__gen_ocl_internal_ceil, float);\n"
+++"DECL_VECTOR_1OP(__gen_ocl_internal_log, float);\n"
+++"DECL_VECTOR_1OP(__gen_ocl_internal_log2, float);\n"
+++"DECL_VECTOR_1OP(__gen_ocl_internal_log10, float);\n"
+++"#undef DECL_VECTOR_1OP\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Arithmetic functions\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"\n"
+++"#define DECL_VECTOR_2OP(NAME, TYPE) \\\n"
+++"  INLINE OVERLOADABLE TYPE##2 NAME(TYPE##2 v0, TYPE##2 v1) { \\\n"
+++"    return (TYPE##2)(NAME(v0.x, v1.x), NAME(v1.y, v1.y)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##3 NAME(TYPE##3 v0, TYPE##3 v1) { \\\n"
+++"    return (TYPE##3)(NAME(v0.x, v1.x), NAME(v0.y, v1.y), NAME(v0.z, v1.z)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##4 NAME(TYPE##4 v0, TYPE##4 v1) { \\\n"
+++"    return (TYPE##4)(NAME(v0.x, v1.x), NAME(v0.y, v1.y), NAME(v0.z, v1.z), NAME(v0.w, v1.w)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##8 NAME(TYPE##8 v0, TYPE##8 v1) { \\\n"
+++"    TYPE##8 dst;\\\n"
+++"    dst.s0123 = NAME(v0.s0123, v1.s0123);\\\n"
+++"    dst.s4567 = NAME(v0.s4567, v1.s4567);\\\n"
+++"    return dst;\\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##16 NAME(TYPE##16 v0, TYPE##16 v1) { \\\n"
+++"    TYPE##16 dst;\\\n"
+++"    dst.s01234567 = NAME(v0.s01234567, v1.s01234567);\\\n"
+++"    dst.s89abcdef = NAME(v0.s89abcdef, v1.s89abcdef);\\\n"
+++"    return dst;\\\n"
+++"  }\n"
+++"DECL_VECTOR_2OP(min, float);\n"
+++"DECL_VECTOR_2OP(max, float);\n"
+++"DECL_VECTOR_2OP(fmod, float);\n"
+++"DECL_VECTOR_2OP(powr, float);\n"
+++"#undef DECL_VECTOR_2OP\n"
+++"\n"
+++"#define DECL_VECTOR_3OP(NAME, TYPE) \\\n"
+++"  INLINE OVERLOADABLE TYPE##2 NAME(TYPE##2 v0, TYPE##2 v1, TYPE##2 v2) { \\\n"
+++"    return (TYPE##2)(NAME(v0.x, v1.x, v2.x), NAME(v1.y, v1.y, v2.y)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##3 NAME(TYPE##3 v0, TYPE##3 v1, TYPE##3 v2) { \\\n"
+++"    return (TYPE##3)(NAME(v0.x, v1.x, v2.x), NAME(v0.y, v1.y, v2.y), NAME(v0.z, v1.z, v2.z)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##4 NAME(TYPE##4 v0, TYPE##4 v1, TYPE##4 v2) { \\\n"
+++"    return (TYPE##4)(NAME(v0.x, v1.x, v2.x), NAME(v0.y, v1.y, v2.y), NAME(v0.z, v1.z, v2.z), NAME(v0.w, v1.w, v2.w)); \\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##8 NAME(TYPE##8 v0, TYPE##8 v1, TYPE##8 v2) { \\\n"
+++"    TYPE##8 dst;\\\n"
+++"    dst.s0123 = NAME(v0.s0123, v1.s0123, v2.s0123);\\\n"
+++"    dst.s4567 = NAME(v0.s4567, v1.s4567, v2.s4567);\\\n"
+++"    return dst;\\\n"
+++"  }\\\n"
+++"  INLINE OVERLOADABLE TYPE##16 NAME(TYPE##16 v0, TYPE##16 v1, TYPE##16 v2) { \\\n"
+++"    TYPE##16 dst;\\\n"
+++"    dst.s01234567 = NAME(v0.s01234567, v1.s01234567, v2.s01234567);\\\n"
+++"    dst.s89abcdef = NAME(v0.s89abcdef, v1.s89abcdef, v2.s89abcdef);\\\n"
+++"    return dst;\\\n"
+++"  }\n"
+++"DECL_VECTOR_3OP(mad, float);\n"
+++"DECL_VECTOR_3OP(mix, float);\n"
+++"#undef DECL_VECTOR_3OP\n"
+++"\n"
+++"// mix requires more variants\n"
+++"INLINE OVERLOADABLE float2 mix(float2 x, float2 y, float a) { return mix(x,y,(float2)(a));}\n"
+++"INLINE OVERLOADABLE float3 mix(float3 x, float3 y, float a) { return mix(x,y,(float3)(a));}\n"
+++"INLINE OVERLOADABLE float4 mix(float4 x, float4 y, float a) { return mix(x,y,(float4)(a));}\n"
+++"INLINE OVERLOADABLE float8 mix(float8 x, float8 y, float a) { return mix(x,y,(float8)(a));}\n"
+++"INLINE OVERLOADABLE float16 mix(float16 x, float16 y, float a) { return mix(x,y,(float16)(a));}\n"
+++"\n"
+++"// XXX workaround ptx profile\n"
+++"#define fabs __gen_ocl_internal_fabs\n"
+++"#define trunc __gen_ocl_internal_trunc\n"
+++"#define round __gen_ocl_internal_round\n"
+++"#define floor __gen_ocl_internal_floor\n"
+++"#define ceil __gen_ocl_internal_ceil,\n"
+++"#define log __gen_ocl_internal_log\n"
+++"#define log2 __gen_ocl_internal_log2\n"
+++"#define log10 __gen_ocl_internal_log10\n"
+++"#define exp __gen_ocl_internal_exp\n"
+++"#define fmin __gen_ocl_internal_fmin\n"
+++"#define fmax __gen_ocl_internal_fmax\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Synchronization functions\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"#define CLK_LOCAL_MEM_FENCE  (1 << 0)\n"
+++"#define CLK_GLOBAL_MEM_FENCE (1 << 1)\n"
+++"\n"
+++"void __gen_ocl_barrier_local(void);\n"
+++"void __gen_ocl_barrier_global(void);\n"
+++"void __gen_ocl_barrier_local_and_global(void);\n"
+++"\n"
+++"typedef uint cl_mem_fence_flags;\n"
+++"INLINE void barrier(cl_mem_fence_flags flags) {\n"
+++"  if (flags == (CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE))\n"
+++"    __gen_ocl_barrier_local_and_global();\n"
+++"  else if (flags == CLK_LOCAL_MEM_FENCE)\n"
+++"    __gen_ocl_barrier_local();\n"
+++"  else if (flags == CLK_GLOBAL_MEM_FENCE)\n"
+++"    __gen_ocl_barrier_global();\n"
+++"}\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Force the compilation to SIMD8 or SIMD16\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"\n"
+++"int __gen_ocl_force_simd8(void);\n"
+++"int __gen_ocl_force_simd16(void);\n"
+++"\n"
+++"#define NULL ((void*)0)\n"
+++"\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"// Image access functions\n"
+++"/////////////////////////////////////////////////////////////////////////////\n"
+++"\n"
+++"OVERLOADABLE int4 __gen_ocl_read_imagei(uint surface_id, uint sampler, int u, int v);\n"
+++"OVERLOADABLE int4 __gen_ocl_read_imagei(uint surface_id, uint sampler, float u, float v);\n"
+++"OVERLOADABLE uint4 __gen_ocl_read_imageui(uint surface_id, uint sampler, int u, int v);\n"
+++"OVERLOADABLE uint4 __gen_ocl_read_imageui(uint surface_id, uint sampler, float u, float v);\n"
+++"OVERLOADABLE float4 __gen_ocl_read_imagef(uint surface_id, uint sampler, int u, int v);\n"
+++"OVERLOADABLE float4 __gen_ocl_read_imagef(uint surface_id, uint sampler, float u, float v);\n"
+++"OVERLOADABLE void __gen_ocl_write_imagei(uint surface_id, int u, int v, int4 color);\n"
+++"OVERLOADABLE void __gen_ocl_write_imagei(uint surface_id, float u, float v, int4 color);\n"
+++"OVERLOADABLE void __gen_ocl_write_imageui(uint surface_id, int u, int v, uint4 color);\n"
+++"OVERLOADABLE void __gen_ocl_write_imageui(uint surface_id, float u, float v, uint4 color);\n"
+++"OVERLOADABLE void __gen_ocl_write_imagef(uint surface_id, int u, int v, float4 color);\n"
+++"OVERLOADABLE void __gen_ocl_write_imagef(uint surface_id, float u, float v, float4 color);\n"
+++"\n"
+++"#define GET_IMAGE(cl_image, surface_id) \\\n"
+++"    uint surface_id = (uint)cl_image\n"
+++"\n"
+++"#define DECL_READ_IMAGE(type, suffix, coord_type) \\\n"
+++"  INLINE_OVERLOADABLE type read_image ##suffix(image2d_t cl_image, sampler_t sampler, coord_type coord) \\\n"
+++"  {\\\n"
+++"    GET_IMAGE(cl_image, surface_id);\\\n"
+++"    return __gen_ocl_read_image ##suffix(surface_id, (uint)sampler, coord.s0, coord.s1);\\\n"
+++"  }\n"
+++"\n"
+++"#define DECL_WRITE_IMAGE(type, suffix, coord_type) \\\n"
+++"  INLINE_OVERLOADABLE void write_image ##suffix(image2d_t cl_image, coord_type coord, type color)\\\n"
+++"  {\\\n"
+++"    GET_IMAGE(cl_image, surface_id);\\\n"
+++"    __gen_ocl_write_image ##suffix(surface_id, coord.s0, coord.s1, color);\\\n"
+++"  }\n"
+++"\n"
+++"#define DECL_IMAGE(type, suffix)        \\\n"
+++"  DECL_READ_IMAGE(type, suffix, int2)   \\\n"
+++"  DECL_READ_IMAGE(type, suffix, float2) \\\n"
+++"  DECL_WRITE_IMAGE(type, suffix, int2)   \\\n"
+++"  DECL_WRITE_IMAGE(type, suffix, float2)\n"
+++"\n"
+++"DECL_IMAGE(int4, i)\n"
+++"DECL_IMAGE(uint4, ui)\n"
+++"DECL_IMAGE(float4, f)\n"
+++"\n"
+++"#undef GET_IMAGE\n"
+++"#undef DECL_IMAGE\n"
+++"#undef DECL_READ_IMAGE\n"
+++"#undef DECL_WRITE_IMAGE\n"
+++"#undef INLINE_OVERLOADABLE\n"
+++"\n"
+++"#undef PURE\n"
+++"#undef CONST\n"
+++"#undef OVERLOADABLE\n"
+++"#undef INLINE\n"
+++"#endif /* __GEN_OCL_STDLIB_H__ */\n"
+++"\n"
+++;
+++}
+++
++--- /dev/null
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/src/ocl_common_defines_str.cpp
++@@ -0,0 +1,127 @@
+++#include "string"
+++namespace gbe {
+++std::string ocl_common_defines_str = 
+++"// This file includes defines that are common to both kernel code and\n"
+++"// the NVPTX back-end.\n"
+++"\n"
+++"//\n"
+++"// Common defines for Image intrinsics\n"
+++"// Channel order\n"
+++"enum {\n"
+++"  CLK_R = 0x10B0,\n"
+++"  CLK_A = 0x10B1,\n"
+++"  CLK_RG = 0x10B2,\n"
+++"  CLK_RA = 0x10B3,\n"
+++"  CLK_RGB = 0x10B4,\n"
+++"  CLK_RGBA = 0x10B5,\n"
+++"  CLK_BGRA = 0x10B6,\n"
+++"  CLK_ARGB = 0x10B7,\n"
+++"\n"
+++"#if (__NV_CL_C_VERSION == __NV_CL_C_VERSION_1_0)\n"
+++"  CLK_xRGB = 0x10B7,\n"
+++"#endif\n"
+++"\n"
+++"  CLK_INTENSITY = 0x10B8,\n"
+++"  CLK_LUMINANCE = 0x10B9\n"
+++"\n"
+++"#if (__NV_CL_C_VERSION >= __NV_CL_C_VERSION_1_1)\n"
+++"  ,\n"
+++"  CLK_Rx = 0x10BA,\n"
+++"  CLK_RGx = 0x10BB,\n"
+++"  CLK_RGBx = 0x10BC\n"
+++"#endif\n"
+++"};\n"
+++"\n"
+++"\n"
+++"typedef enum clk_channel_type {\n"
+++"  // valid formats for float return types\n"
+++"  CLK_SNORM_INT8 = 0x10D0,            // four channel RGBA unorm8\n"
+++"  CLK_SNORM_INT16 = 0x10D1,           // four channel RGBA unorm16\n"
+++"  CLK_UNORM_INT8 = 0x10D2,            // four channel RGBA unorm8\n"
+++"  CLK_UNORM_INT16 = 0x10D3,           // four channel RGBA unorm16\n"
+++"  CLK_HALF_FLOAT = 0x10DD,            // four channel RGBA half\n"
+++"  CLK_FLOAT = 0x10DE,                 // four channel RGBA float\n"
+++"\n"
+++"#if (__NV_CL_C_VERSION >= __NV_CL_C_VERSION_1_1)\n"
+++"  CLK_UNORM_SHORT_565 = 0x10D4,\n"
+++"  CLK_UNORM_SHORT_555 = 0x10D5,\n"
+++"  CLK_UNORM_INT_101010 = 0x10D6,\n"
+++"#endif\n"
+++"\n"
+++"  // valid only for integer return types\n"
+++"  CLK_SIGNED_INT8 =  0x10D7,\n"
+++"  CLK_SIGNED_INT16 = 0x10D8,\n"
+++"  CLK_SIGNED_INT32 = 0x10D9,\n"
+++"  CLK_UNSIGNED_INT8 = 0x10DA,\n"
+++"  CLK_UNSIGNED_INT16 = 0x10DB,\n"
+++"  CLK_UNSIGNED_INT32 = 0x10DC,\n"
+++"\n"
+++"  // CI SPI for CPU\n"
+++"  __CLK_UNORM_INT8888 ,         // four channel ARGB unorm8\n"
+++"  __CLK_UNORM_INT8888R,        // four channel BGRA unorm8\n"
+++"\n"
+++"  __CLK_VALID_IMAGE_TYPE_COUNT,\n"
+++"  __CLK_INVALID_IMAGE_TYPE = __CLK_VALID_IMAGE_TYPE_COUNT,\n"
+++"  __CLK_VALID_IMAGE_TYPE_MASK_BITS = 4,         // number of bits required to\n"
+++"                                                // represent any image type\n"
+++"  __CLK_VALID_IMAGE_TYPE_MASK = ( 1 << __CLK_VALID_IMAGE_TYPE_MASK_BITS ) - 1\n"
+++"}clk_channel_type;\n"
+++"\n"
+++"typedef enum clk_sampler_type {\n"
+++"    __CLK_ADDRESS_BASE             = 0,\n"
+++"    CLK_ADDRESS_NONE               = 0 << __CLK_ADDRESS_BASE,\n"
+++"    CLK_ADDRESS_CLAMP              = 1 << __CLK_ADDRESS_BASE,\n"
+++"    CLK_ADDRESS_CLAMP_TO_EDGE      = 2 << __CLK_ADDRESS_BASE,\n"
+++"    CLK_ADDRESS_REPEAT             = 3 << __CLK_ADDRESS_BASE,\n"
+++"    CLK_ADDRESS_MIRROR             = 4 << __CLK_ADDRESS_BASE,\n"
+++"\n"
+++"#if (__NV_CL_C_VERSION >= __NV_CL_C_VERSION_1_1)\n"
+++"    CLK_ADDRESS_MIRRORED_REPEAT    = CLK_ADDRESS_MIRROR,\n"
+++"#endif\n"
+++"    __CLK_ADDRESS_MASK             = CLK_ADDRESS_NONE | CLK_ADDRESS_CLAMP |\n"
+++"                                     CLK_ADDRESS_CLAMP_TO_EDGE |\n"
+++"                                     CLK_ADDRESS_REPEAT | CLK_ADDRESS_MIRROR,\n"
+++"    __CLK_ADDRESS_BITS             = 3,        // number of bits required to\n"
+++"                                               // represent address info\n"
+++"\n"
+++"    __CLK_NORMALIZED_BASE          = __CLK_ADDRESS_BITS,\n"
+++"    CLK_NORMALIZED_COORDS_FALSE    = 0,\n"
+++"    CLK_NORMALIZED_COORDS_TRUE     = 1 << __CLK_NORMALIZED_BASE,\n"
+++"    __CLK_NORMALIZED_MASK          = CLK_NORMALIZED_COORDS_FALSE |\n"
+++"                                     CLK_NORMALIZED_COORDS_TRUE,\n"
+++"    __CLK_NORMALIZED_BITS          = 1,        // number of bits required to\n"
+++"                                               // represent normalization\n"
+++"\n"
+++"    __CLK_FILTER_BASE              = __CLK_NORMALIZED_BASE +\n"
+++"                                     __CLK_NORMALIZED_BITS,\n"
+++"    CLK_FILTER_NEAREST             = 0 << __CLK_FILTER_BASE,\n"
+++"    CLK_FILTER_LINEAR              = 1 << __CLK_FILTER_BASE,\n"
+++"    CLK_FILTER_ANISOTROPIC         = 2 << __CLK_FILTER_BASE,\n"
+++"    __CLK_FILTER_MASK              = CLK_FILTER_NEAREST | CLK_FILTER_LINEAR |\n"
+++"                                     CLK_FILTER_ANISOTROPIC,\n"
+++"    __CLK_FILTER_BITS              = 2,        // number of bits required to\n"
+++"                                               // represent address info\n"
+++"\n"
+++"    __CLK_MIP_BASE                 = __CLK_FILTER_BASE + __CLK_FILTER_BITS,\n"
+++"    CLK_MIP_NEAREST                = 0 << __CLK_MIP_BASE,\n"
+++"    CLK_MIP_LINEAR                 = 1 << __CLK_MIP_BASE,\n"
+++"    CLK_MIP_ANISOTROPIC            = 2 << __CLK_MIP_BASE,\n"
+++"    __CLK_MIP_MASK                 = CLK_MIP_NEAREST | CLK_MIP_LINEAR |\n"
+++"                                     CLK_MIP_ANISOTROPIC,\n"
+++"    __CLK_MIP_BITS                 = 2,\n"
+++"\n"
+++"    __CLK_SAMPLER_BITS             = __CLK_MIP_BASE + __CLK_MIP_BITS,\n"
+++"    __CLK_SAMPLER_MASK             = __CLK_MIP_MASK | __CLK_FILTER_MASK |\n"
+++"                                     __CLK_NORMALIZED_MASK | __CLK_ADDRESS_MASK,\n"
+++"\n"
+++"    __CLK_ANISOTROPIC_RATIO_BITS   = 5,\n"
+++"    __CLK_ANISOTROPIC_RATIO_MASK   = (int) 0x80000000 >>\n"
+++"                                      (__CLK_ANISOTROPIC_RATIO_BITS-1)\n"
+++"} clk_sampler_type;\n"
+++"\n"
+++"// Memory synchronization\n"
+++"#define CLK_LOCAL_MEM_FENCE     (1 << 0)\n"
+++"#define CLK_GLOBAL_MEM_FENCE    (1 << 1)\n"
+++;
+++}
+++
diff --cc debian/patches/clang-from-path
index aec7c66,0000000..24bc834
mode 100644,000000..100644
--- a/debian/patches/clang-from-path
+++ b/debian/patches/clang-from-path
@@@ -1,18 -1,0 +1,20 @@@
 +Description: Use clang from PATH
 +Author: Simon Richter <sjr at debian.org>
 +Last-Update: 2013-04-02
 +
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/backend/src/backend/program.cpp
- +++ beignet-0.0.0+git2013.04.01+d1b234c/backend/src/backend/program.cpp
- @@ -116,9 +116,9 @@ namespace gbe {
++Index: beignet-0.0.0+git2013.04.11+e6b503e/backend/src/backend/program.cpp
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/backend/src/backend/program.cpp	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/src/backend/program.cpp	2013-04-15 18:33:25.392352309 +0200
++@@ -119,9 +119,9 @@
 + 
 +     // Now compile the code to llvm using clang
 + #if LLVM_VERSION_MINOR <= 1
 +-    std::string compileCmd = LLVM_PREFIX "/bin/clang -x cl -fno-color-diagnostics -emit-llvm -O3 -ccc-host-triple ptx32 -c ";
 ++    std::string compileCmd = "clang -x cl -fno-color-diagnostics -emit-llvm -O3 -ccc-host-triple ptx32 -c ";
 + #else
- -    std::string compileCmd = LLVM_PREFIX "/bin/clang -ffp-contract=off -target nvptx -x cl -fno-color-diagnostics -emit-llvm -O3 -c ";
- +    std::string compileCmd = "clang -ffp-contract=off -target nvptx -x cl -fno-color-diagnostics -emit-llvm -O3 -c ";
++-    std::string compileCmd = LLVM_PREFIX "/bin/clang -ffp-contract=off -emit-llvm -O3 -target nvptx -x cl -c ";
+++    std::string compileCmd = "clang -ffp-contract=off -emit-llvm -O3 -target nvptx -x cl -c ";
 + #endif /* LLVM_VERSION_MINOR <= 1 */
 +     compileCmd += clName;
-      compileCmd += " -o ";
++     compileCmd += " ";
diff --cc debian/patches/device-info-query
index c54ba9e,0000000..38a13b2
mode 100644,000000..100644
--- a/debian/patches/device-info-query
+++ b/debian/patches/device-info-query
@@@ -1,54 -1,0 +1,54 @@@
 +commit ab7af52f7e9cd4d6b5a7f1fce4552c3e97b49099
 +Author: Simon Richter <Simon.Richter at hogyros.de>
 +Date:   Thu Apr 11 13:59:30 2013 +0200
 +
 +    Allow size queries in device_id accessors
 +    
 +    Query functions with variable output length can be called with an output
 +    buffer length and address of zero to find out the number of elements
 +    available.
 +
- Index: beignet-0.0.0+git2013.04.01+d1b234c/src/cl_device_id.c
++Index: beignet-0.0.0+git2013.04.11+e6b503e/src/cl_device_id.c
 +===================================================================
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/src/cl_device_id.c	2013-04-11 14:38:02.730759888 +0200
- +++ beignet-0.0.0+git2013.04.01+d1b234c/src/cl_device_id.c	2013-04-11 14:38:25.486758873 +0200
- @@ -128,21 +128,25 @@
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/src/cl_device_id.c	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/src/cl_device_id.c	2013-04-15 18:34:02.220354446 +0200
++@@ -131,21 +131,25 @@
 + 
 + #define DECL_FIELD(CASE,FIELD)                                      \
 +   case JOIN(CL_DEVICE_,CASE):                                       \
 +-      if (param_value_size < sizeof(((cl_device_id)NULL)->FIELD))   \
 +-        return CL_INVALID_VALUE;                                    \
 +       if (param_value_size_ret != NULL)                             \
 +         *param_value_size_ret = sizeof(((cl_device_id)NULL)->FIELD);\
 ++      if (param_value == NULL)                                      \
 ++        return CL_SUCCESS;                                          \
 ++      if (param_value_size < sizeof(((cl_device_id)NULL)->FIELD))   \
 ++        return CL_INVALID_VALUE;                                    \
 +       memcpy(param_value,                                           \
 +              &device->FIELD,                                        \
 +              sizeof(((cl_device_id)NULL)->FIELD));                  \
 +-        return CL_SUCCESS;
 ++      return CL_SUCCESS;
 + 
 + #define DECL_STRING_FIELD(CASE,FIELD)                               \
 +   case JOIN(CL_DEVICE_,CASE):                                       \
 +-    if (param_value_size < device->JOIN(FIELD,_sz))                 \
 +-      return CL_INVALID_VALUE;                                      \
 +     if (param_value_size_ret != NULL)                               \
 +       *param_value_size_ret = device->JOIN(FIELD,_sz);              \
 ++    if (param_value == NULL)                                        \
 ++      return CL_SUCCESS;                                            \
 ++    if (param_value_size < device->JOIN(FIELD,_sz))                 \
 ++      return CL_INVALID_VALUE;                                      \
 +     memcpy(param_value, device->FIELD, device->JOIN(FIELD,_sz));    \
 +     return CL_SUCCESS;
 + 
- @@ -157,8 +161,6 @@
-                 device != &intel_ivb_gt2_device &&
-                 device != &intel_hsw_device))
++@@ -282,8 +286,6 @@
++   if (UNLIKELY(device != &intel_ivb_gt1_device &&
++                device != &intel_ivb_gt2_device))
 +     return CL_INVALID_DEVICE;
 +-  if (UNLIKELY(param_value == NULL))
 +-    return CL_INVALID_VALUE;
 + 
-    /* Find the correct parameter */
 +   switch (param_name) {
++     DECL_FIELD(WORK_GROUP_SIZE, wg_sz)
diff --cc debian/patches/glibc-memalign
index cbb25b7,0000000..653799c
mode 100644,000000..100644
--- a/debian/patches/glibc-memalign
+++ b/debian/patches/glibc-memalign
@@@ -1,19 -1,0 +1,19 @@@
 +commit 3be62a8aacd8cd18484b381ab9536160c7de7119
 +Author: Simon Richter <Simon.Richter at hogyros.de>
 +Date:   Fri Apr 12 11:21:19 2013 +0200
 +
 +    Accept glibc's implementation of memalign()
 +
- Index: beignet-0.0.0+git2013.04.01+d1b234c/backend/src/sys/alloc.cpp
++Index: beignet-0.0.0+git2013.04.11+e6b503e/backend/src/sys/alloc.cpp
 +===================================================================
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/backend/src/sys/alloc.cpp	2013-03-29 11:40:11.000000000 +0100
- +++ beignet-0.0.0+git2013.04.01+d1b234c/backend/src/sys/alloc.cpp	2013-04-12 11:22:24.421303851 +0200
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/backend/src/sys/alloc.cpp	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/src/sys/alloc.cpp	2013-04-15 18:34:31.608356151 +0200
 +@@ -271,7 +271,7 @@
 + /// Linux Platform
 + ////////////////////////////////////////////////////////////////////////////////
 + 
 +-#if defined(__LINUX__)
 ++#if defined(__LINUX__) || defined(__GLIBC__)
 + 
 + #include <unistd.h>
 + #include <sys/mman.h>
diff --cc debian/patches/ignore-missing-egl
index 0000000,0000000..19f0721
new file mode 100644
--- /dev/null
+++ b/debian/patches/ignore-missing-egl
@@@ -1,0 -1,0 +1,50 @@@
++Description: Ignore missing EGL support (version in Debian is too old)
++Author: Simon Richter <sjr at debian.org>
++Last-Update: 2013-04-15
++
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/backend/src/backend/program.cpp
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/src/backend/program.cpp
++@@ -118,7 +118,7 @@ namespace gbe {
++     fclose(clFile);
++ 
++     // Now compile the code to llvm using clang
++-#if LLVM_VERSION_MINOR <= 1
+++#if 1 //LLVM_VERSION_MINOR <= 1
++     std::string compileCmd = "clang -x cl -fno-color-diagnostics -emit-llvm -O3 -ccc-host-triple ptx32 -c ";
++ #else
++     std::string compileCmd = "clang -ffp-contract=off -emit-llvm -O3 -target nvptx -x cl -c ";
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/src/CMakeLists.txt
+++++ beignet-0.0.0+git2013.04.11+e6b503e/src/CMakeLists.txt
++@@ -32,6 +32,9 @@ if (EGL_FOUND)
++ set (OPENCL_SRC ${OPENCL_SRC} cl_mem_gl.c cl_gl_api.c x11/gbm_dri2_x11_platform.c)
++ SET(CMAKE_CXX_FLAGS "-DHAS_EGL ${CMAKE_CXX_FLAGS}")
++ SET(CMAKE_C_FLAGS "-DHAS_EGL ${CMAKE_C_FLAGS}")
+++SET(OPTIONAL_EGL_LIBRARY "${EGL_LIBRARY}")
+++else(EGL_FOUND)
+++SET(OPTIONAL_EGL_LIBRARY "")
++ endif (EGL_FOUND)
++ 
++ link_directories (${LLVM_LIBRARY_DIR})
++@@ -45,6 +48,6 @@ target_link_libraries(
++                       ${DRM_INTEL_LIBRARY}
++                       ${DRM_LIBRARY}
++                       ${OPENGL_LIBRARIES}
++-                      ${EGL_LIBRARY}
+++                      ${OPTIONAL_EGL_LIBRARY}
++                       ${GBM_LIBRARY})
++ install (TARGETS cl LIBRARY DESTINATION lib)
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/utests/utest_helper.hpp
+++++ beignet-0.0.0+git2013.04.11+e6b503e/utests/utest_helper.hpp
++@@ -128,9 +128,9 @@ extern cl_mem buf[MAX_BUFFER_N];
++ extern void* buf_data[MAX_BUFFER_N];
++ extern size_t globals[3];
++ extern size_t locals[3];
++-extern Display    *xDisplay;
++-extern EGLDisplay  eglDisplay;
++-extern EGLSurface  eglSurface;
+++//extern Display    *xDisplay;
+++//extern EGLDisplay  eglDisplay;
+++//extern EGLSurface  eglSurface;
++ 
++ 
++ enum {
diff --cc debian/patches/implement-gefa
index 1e1792e,0000000..39c9764
mode 100644,000000..100644
--- a/debian/patches/implement-gefa
+++ b/debian/patches/implement-gefa
@@@ -1,21 -1,0 +1,21 @@@
 +commit 08dadaf3f345f3feceefaacebf5045c72821b449
 +Author: Simon Richter <Simon.Richter at hogyros.de>
 +Date:   Tue Apr 2 15:11:01 2013 +0200
 +
 +    "Implement" clGetExtensionFunctionAddress()
 +    
 +    This function can legally return NULL in the current implementation.
 +
- diff --git a/src/cl_api.c b/src/cl_api.c
- index 6856d6a..253c29c 100644
- --- a/src/cl_api.c
- +++ b/src/cl_api.c
- @@ -1109,7 +1109,7 @@ clEnqueueBarrier(cl_command_queue  command_queue)
++Index: beignet-0.0.0+git2013.04.11+e6b503e/src/cl_api.c
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/src/cl_api.c	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/src/cl_api.c	2013-04-15 18:33:32.788352738 +0200
++@@ -1169,7 +1169,7 @@
 + void*
 + clGetExtensionFunctionAddress(const char *func_name)
 + {
 +-  NOT_IMPLEMENTED;
 ++  /* No extensions supported at present */
 +   return NULL;
 + }
 + 
diff --cc debian/patches/khronos
index fd750b7,0000000..a191933
mode 100644,000000..100644
--- a/debian/patches/khronos
+++ b/debian/patches/khronos
@@@ -1,2853 -1,0 +1,3100 @@@
 +Description: Use Khronos Group headers
 +Author: Simon Richter <sjr at debian.org>
 +Last-Update: 2013-04-01
 +
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/include/CL/cl_ext.h
- +++ beignet-0.0.0+git2013.04.01+d1b234c/include/CL/cl_ext.h
- @@ -1,209 +1 @@
- -/* 
- - * Copyright © 2012 Intel Corporation
++Index: beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl_ext.h
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/include/CL/cl_ext.h	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl_ext.h	2013-04-15 18:25:01.036323041 +0200
++@@ -1,251 +1 @@
++-/*******************************************************************************
++- * Copyright (c) 2008 - 2012 The Khronos Group Inc.
 +- *
- - * This library is free software; you can redistribute it and/or
- - * modify it under the terms of the GNU Lesser General Public
- - * License as published by the Free Software Foundation; either
- - * version 2 of the License, or (at your option) any later version.
++- * Permission is hereby granted, free of charge, to any person obtaining a
++- * copy of this software and/or associated documentation files (the
++- * "Materials"), to deal in the Materials without restriction, including
++- * without limitation the rights to use, copy, modify, merge, publish,
++- * distribute, sublicense, and/or sell copies of the Materials, and to
++- * permit persons to whom the Materials are furnished to do so, subject to
++- * the following conditions:
 +- *
- - * This library is distributed in the hope that it will be useful,
- - * but WITHOUT ANY WARRANTY; without even the implied warranty of
- - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- - * Lesser General Public License for more details.
++- * The above copyright notice and this permission notice shall be included
++- * in all copies or substantial portions of the Materials.
 +- *
- - * You should have received a copy of the GNU Lesser General Public
- - * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- - *
- - * Author: Benjamin Segovia <benjamin.segovia at intel.com>
- - */
++- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
++- ******************************************************************************/
 +-
 +-/* $Revision: 11928 $ on $Date: 2010-07-13 09:04:56 -0700 (Tue, 13 Jul 2010) $ */
 +-
 +-/* cl_ext.h contains OpenCL extensions which don't have external */
 +-/* (OpenGL, D3D) dependencies.                                   */
 +-
 +-#ifndef __CL_EXT_H
 +-#define __CL_EXT_H
 +-
 +-#ifdef __cplusplus
 +-extern "C" {
 +-#endif
 +-
 +-#ifdef __APPLE__
 +-	#include <OpenCL/cl.h>
 +-    #include <AvailabilityMacros.h>
 +-#else
 +-	#include <CL/cl.h>
 +-#endif
 +-
- -/* cl_khr_fp64 extension - no extension #define since it has no functions  */
- -#define CL_DEVICE_DOUBLE_FP_CONFIG                  0x1032
- -
 +-/* cl_khr_fp16 extension - no extension #define since it has no functions  */
 +-#define CL_DEVICE_HALF_FP_CONFIG                    0x1033
 +-
 +-/* Memory object destruction
 +- *
 +- * Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR
 +- *
 +- * Registers a user callback function that will be called when the memory object is deleted and its resources 
 +- * freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback 
 +- * stack associated with memobj. The registered user callback functions are called in the reverse order in 
 +- * which they were registered. The user callback functions are called and then the memory object is deleted 
 +- * and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be 
 +- * notified when the memory referenced by host_ptr, specified when the memory object is created and used as 
 +- * the storage bits for the memory object, can be reused or freed.
 +- *
 +- * The application may not call CL api's with the cl_mem object passed to the pfn_notify.
 +- *
 +- * Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
 +- * before using.
 +- */
 +-#define cl_APPLE_SetMemObjectDestructor 1
 +-cl_int	CL_API_ENTRY clSetMemObjectDestructorAPPLE(  cl_mem /* memobj */, 
 +-                                        void (* /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/), 
 +-                                        void * /*user_data */ )             CL_EXT_SUFFIX__VERSION_1_0;  
 +-
 +-
 +-/* Context Logging Functions
 +- *
 +- * The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext().
 +- * Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS)
 +- * before using.
 +- *
 +- * clLogMessagesToSystemLog fowards on all log messages to the Apple System Logger 
 +- */
 +-#define cl_APPLE_ContextLoggingFunctions 1
 +-extern void CL_API_ENTRY clLogMessagesToSystemLogAPPLE(  const char * /* errstr */, 
 +-                                            const void * /* private_info */, 
 +-                                            size_t       /* cb */, 
 +-                                            void *       /* user_data */ )  CL_EXT_SUFFIX__VERSION_1_0;
 +-
 +-/* clLogMessagesToStdout sends all log messages to the file descriptor stdout */
 +-extern void CL_API_ENTRY clLogMessagesToStdoutAPPLE(   const char * /* errstr */, 
 +-                                          const void * /* private_info */, 
 +-                                          size_t       /* cb */, 
 +-                                          void *       /* user_data */ )    CL_EXT_SUFFIX__VERSION_1_0;
 +-
 +-/* clLogMessagesToStderr sends all log messages to the file descriptor stderr */
 +-extern void CL_API_ENTRY clLogMessagesToStderrAPPLE(   const char * /* errstr */, 
 +-                                          const void * /* private_info */, 
 +-                                          size_t       /* cb */, 
 +-                                          void *       /* user_data */ )    CL_EXT_SUFFIX__VERSION_1_0;
 +-
 +-
 +-/************************ 
 +-* cl_khr_icd extension *                                                  
 +-************************/
 +-#define cl_khr_icd 1
 +-
 +-/* cl_platform_info                                                        */
 +-#define CL_PLATFORM_ICD_SUFFIX_KHR                  0x0920
 +-
 +-/* Additional Error Codes                                                  */
 +-#define CL_PLATFORM_NOT_FOUND_KHR                   -1001
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clIcdGetPlatformIDsKHR(cl_uint          /* num_entries */,
 +-                       cl_platform_id * /* platforms */,
 +-                       cl_uint *        /* num_platforms */);
 +-
 +-typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
 +-    cl_uint          /* num_entries */,
 +-    cl_platform_id * /* platforms */,
 +-    cl_uint *        /* num_platforms */);
 +-
 +-
++-/* Extension: cl_khr_image2D_buffer
++- *
++- * This extension allows a 2D image to be created from a cl_mem buffer without a copy.
++- * The type associated with a 2D image created from a buffer in an OpenCL program is image2d_t.
++- * Both the sampler and sampler-less read_image built-in functions are supported for 2D images
++- * and 2D images created from a buffer.  Similarly, the write_image built-ins are also supported
++- * for 2D images created from a buffer.
++- *
++- * When the 2D image from buffer is created, the client must specify the width,
++- * height, image format (i.e. channel order and channel data type) and optionally the row pitch
++- *
++- * The pitch specified must be a multiple of CL_DEVICE_IMAGE_PITCH_ALIGNMENT pixels.
++- * The base address of the buffer must be aligned to CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT pixels.
++- */
++-    
++-/*************************************
++- * cl_khr_initalize_memory extension *
++- *************************************/
++-    
++-#define CL_CONTEXT_MEMORY_INITIALIZE_KHR            0x200E
++-    
++-    
++-/**************************************
++- * cl_khr_terminate_context extension *
++- **************************************/
++-    
++-#define CL_DEVICE_TERMINATE_CAPABILITY_KHR          0x200F
++-#define CL_CONTEXT_TERMINATE_KHR                    0x2010
++-
++-#define cl_khr_terminate_context 1
++-extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
++-
++-typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
++-    
++-    
++-/*
++- * Extension: cl_khr_spir
++- *
++- * This extension adds support to create an OpenCL program object from a 
++- * Standard Portable Intermediate Representation (SPIR) instance
++- */
++-
 +-/******************************************
 +-* cl_nv_device_attribute_query extension *
 +-******************************************/
 +-/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */
 +-#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV       0x4000
 +-#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV       0x4001
 +-#define CL_DEVICE_REGISTERS_PER_BLOCK_NV            0x4002
 +-#define CL_DEVICE_WARP_SIZE_NV                      0x4003
 +-#define CL_DEVICE_GPU_OVERLAP_NV                    0x4004
 +-#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV            0x4005
 +-#define CL_DEVICE_INTEGRATED_MEMORY_NV              0x4006
 +-
 +-
 +-/*********************************
 +-* cl_amd_device_attribute_query *
 +-*********************************/
 +-#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD        0x4036
 +-
- -
 +-#ifdef CL_VERSION_1_1
 +-   /***********************************
 +-    * cl_ext_device_fission extension *
 +-    ***********************************/
 +-    #define cl_ext_device_fission   1
 +-    
 +-    extern CL_API_ENTRY cl_int CL_API_CALL
 +-    clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; 
 +-    
 +-    typedef CL_API_ENTRY cl_int 
 +-    (CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
 +-
 +-    extern CL_API_ENTRY cl_int CL_API_CALL
 +-    clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; 
 +-    
 +-    typedef CL_API_ENTRY cl_int 
 +-    (CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
 +-
 +-    typedef cl_ulong  cl_device_partition_property_ext;
 +-    extern CL_API_ENTRY cl_int CL_API_CALL
 +-    clCreateSubDevicesEXT(  cl_device_id /*in_device*/,
 +-                            const cl_device_partition_property_ext * /* properties */,
 +-                            cl_uint /*num_entries*/,
 +-                            cl_device_id * /*out_devices*/,
 +-                            cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
 +-
 +-    typedef CL_API_ENTRY cl_int 
 +-    ( CL_API_CALL * clCreateSubDevicesEXT_fn)(  cl_device_id /*in_device*/,
 +-                                                const cl_device_partition_property_ext * /* properties */,
 +-                                                cl_uint /*num_entries*/,
 +-                                                cl_device_id * /*out_devices*/,
 +-                                                cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1;
 +-
 +-    /* cl_device_partition_property_ext */
 +-    #define CL_DEVICE_PARTITION_EQUALLY_EXT             0x4050
 +-    #define CL_DEVICE_PARTITION_BY_COUNTS_EXT           0x4051
 +-    #define CL_DEVICE_PARTITION_BY_NAMES_EXT            0x4052
 +-    #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT  0x4053
 +-    
 +-    /* clDeviceGetInfo selectors */
 +-    #define CL_DEVICE_PARENT_DEVICE_EXT                 0x4054
 +-    #define CL_DEVICE_PARTITION_TYPES_EXT               0x4055
 +-    #define CL_DEVICE_AFFINITY_DOMAINS_EXT              0x4056
 +-    #define CL_DEVICE_REFERENCE_COUNT_EXT               0x4057
 +-    #define CL_DEVICE_PARTITION_STYLE_EXT               0x4058
 +-    
 +-    /* error codes */
 +-    #define CL_DEVICE_PARTITION_FAILED_EXT              -1057
 +-    #define CL_INVALID_PARTITION_COUNT_EXT              -1058
 +-    #define CL_INVALID_PARTITION_NAME_EXT               -1059
 +-    
 +-    /* CL_AFFINITY_DOMAINs */
 +-    #define CL_AFFINITY_DOMAIN_L1_CACHE_EXT             0x1
 +-    #define CL_AFFINITY_DOMAIN_L2_CACHE_EXT             0x2
 +-    #define CL_AFFINITY_DOMAIN_L3_CACHE_EXT             0x3
 +-    #define CL_AFFINITY_DOMAIN_L4_CACHE_EXT             0x4
 +-    #define CL_AFFINITY_DOMAIN_NUMA_EXT                 0x10
 +-    #define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT     0x100
 +-    
 +-    /* cl_device_partition_property_ext list terminators */
 +-    #define CL_PROPERTIES_LIST_END_EXT                  ((cl_device_partition_property_ext) 0)
 +-    #define CL_PARTITION_BY_COUNTS_LIST_END_EXT         ((cl_device_partition_property_ext) 0)
 +-    #define CL_PARTITION_BY_NAMES_LIST_END_EXT          ((cl_device_partition_property_ext) 0 - 1)
 +-
 +-
 +-
 +-#endif /* CL_VERSION_1_1 */
 +-
 +-#ifdef __cplusplus
 +-}
 +-#endif
 +-
 +-
 +-#endif /* __CL_EXT_H */
 ++#include_next <CL/cl_ext.h>
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/include/CL/opencl.h
- +++ beignet-0.0.0+git2013.04.01+d1b234c/include/CL/opencl.h
- @@ -1,50 +1 @@
- -/* 
- - * Copyright © 2012 Intel Corporation
- - *
- - * This library is free software; you can redistribute it and/or
- - * modify it under the terms of the GNU Lesser General Public
- - * License as published by the Free Software Foundation; either
- - * version 2 of the License, or (at your option) any later version.
++Index: beignet-0.0.0+git2013.04.11+e6b503e/include/CL/opencl.h
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/include/CL/opencl.h	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/include/CL/opencl.h	2013-04-15 18:25:01.036323041 +0200
++@@ -1,54 +1 @@
++-/*******************************************************************************
++- * Copyright (c) 2008-2012 The Khronos Group Inc.
 +- *
- - * This library is distributed in the hope that it will be useful,
- - * but WITHOUT ANY WARRANTY; without even the implied warranty of
- - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- - * Lesser General Public License for more details.
++- * Permission is hereby granted, free of charge, to any person obtaining a
++- * copy of this software and/or associated documentation files (the
++- * "Materials"), to deal in the Materials without restriction, including
++- * without limitation the rights to use, copy, modify, merge, publish,
++- * distribute, sublicense, and/or sell copies of the Materials, and to
++- * permit persons to whom the Materials are furnished to do so, subject to
++- * the following conditions:
 +- *
- - * You should have received a copy of the GNU Lesser General Public
- - * License along with this library. If not, see <http://www.gnu.org/licenses/>.
++- * The above copyright notice and this permission notice shall be included
++- * in all copies or substantial portions of the Materials.
 +- *
- - * Author: Benjamin Segovia <benjamin.segovia at intel.com>
- - */
++- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
++- ******************************************************************************/
 +-
 +-/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
 +-
 +-#ifndef __OPENCL_H
 +-#define __OPENCL_H
 +-
 +-#ifdef __cplusplus
 +-extern "C" {
 +-#endif
 +-
 +-#ifdef __APPLE__
 +-
 +-#include <OpenCL/cl.h>
 +-#include <OpenCL/cl_gl.h>
 +-#include <OpenCL/cl_gl_ext.h>
 +-#include <OpenCL/cl_ext.h>
 +-
 +-#else
 +-
 +-#include <CL/cl.h>
 +-#include <CL/cl_gl.h>
 +-#include <CL/cl_gl_ext.h>
 +-#include <CL/cl_ext.h>
 +-
 +-#endif
 +-
 +-#ifdef __cplusplus
 +-}
 +-#endif
 +-
 +-#endif  /* __OPENCL_H   */
 +-
 ++#include_next <CL/opencl.h>
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/include/CL/cl_d3d10.h
- +++ beignet-0.0.0+git2013.04.01+d1b234c/include/CL/cl_d3d10.h
- @@ -1,129 +1 @@
- -/* 
- - * Copyright © 2012 Intel Corporation
- - *
- - * This library is free software; you can redistribute it and/or
- - * modify it under the terms of the GNU Lesser General Public
- - * License as published by the Free Software Foundation; either
- - * version 2 of the License, or (at your option) any later version.
++Index: beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl_d3d10.h
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/include/CL/cl_d3d10.h	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl_d3d10.h	2013-04-15 18:25:01.036323041 +0200
++@@ -1,126 +1 @@
++-/**********************************************************************************
++- * Copyright (c) 2008-2012 The Khronos Group Inc.
 +- *
- - * This library is distributed in the hope that it will be useful,
- - * but WITHOUT ANY WARRANTY; without even the implied warranty of
- - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- - * Lesser General Public License for more details.
++- * Permission is hereby granted, free of charge, to any person obtaining a
++- * copy of this software and/or associated documentation files (the
++- * "Materials"), to deal in the Materials without restriction, including
++- * without limitation the rights to use, copy, modify, merge, publish,
++- * distribute, sublicense, and/or sell copies of the Materials, and to
++- * permit persons to whom the Materials are furnished to do so, subject to
++- * the following conditions:
 +- *
- - * You should have received a copy of the GNU Lesser General Public
- - * License along with this library. If not, see <http://www.gnu.org/licenses/>.
++- * The above copyright notice and this permission notice shall be included
++- * in all copies or substantial portions of the Materials.
 +- *
- - * Author: Benjamin Segovia <benjamin.segovia at intel.com>
- - */
++- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
++- **********************************************************************************/
 +-
 +-/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
 +-
 +-#ifndef __OPENCL_CL_D3D10_H
 +-#define __OPENCL_CL_D3D10_H
 +-
- -#ifdef __D3D10__
 +-#include <d3d10.h>
- -#endif
 +-#include <CL/cl.h>
 +-#include <CL/cl_platform.h>
 +-
 +-#ifdef __cplusplus
 +-extern "C" {
 +-#endif
 +-
 +-/******************************************************************************
 +- * cl_khr_d3d10_sharing                                                       */
 +-#define cl_khr_d3d10_sharing 1
 +-
 +-typedef cl_uint cl_d3d10_device_source_khr;
 +-typedef cl_uint cl_d3d10_device_set_khr;
 +-
 +-/******************************************************************************/
 +-
 +-// Error Codes
 +-#define CL_INVALID_D3D10_DEVICE_KHR                  -1002
 +-#define CL_INVALID_D3D10_RESOURCE_KHR                -1003
 +-#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR       -1004
 +-#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR           -1005
 +-
 +-// cl_d3d10_device_source_nv
 +-#define CL_D3D10_DEVICE_KHR                          0x4010
 +-#define CL_D3D10_DXGI_ADAPTER_KHR                    0x4011
 +-
 +-// cl_d3d10_device_set_nv
 +-#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR           0x4012
 +-#define CL_ALL_DEVICES_FOR_D3D10_KHR                 0x4013
 +-
 +-// cl_context_info
 +-#define CL_CONTEXT_D3D10_DEVICE_KHR                  0x4014
 +-#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
 +-
 +-// cl_mem_info
 +-#define CL_MEM_D3D10_RESOURCE_KHR                    0x4015
 +-
 +-// cl_image_info
 +-#define CL_IMAGE_D3D10_SUBRESOURCE_KHR               0x4016
 +-
 +-// cl_command_type
 +-#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR         0x4017
 +-#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR         0x4018
 +-
 +-/******************************************************************************/
- -#ifndef __D3D10__
- -typedef struct {int i;} ID3D10Buffer;
- -typedef struct {int i;} ID3D10Texture2D;
- -typedef struct {int i;} ID3D10Texture3D;
- -#endif
 +-
 +-typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
 +-    cl_platform_id             platform,
 +-    cl_d3d10_device_source_khr d3d_device_source,
 +-    void *                     d3d_object,
 +-    cl_d3d10_device_set_khr    d3d_device_set,
 +-    cl_uint                    num_entries,
 +-    cl_device_id *             devices,
 +-    cl_uint *                  num_devices) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
 +-    cl_context     context,
 +-    cl_mem_flags   flags,
 +-    ID3D10Buffer * resource,
 +-    cl_int *       errcode_ret) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
 +-    cl_context        context,
 +-    cl_mem_flags      flags,
 +-    ID3D10Texture2D * resource,
 +-    UINT              subresource,
 +-    cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
 +-    cl_context        context,
 +-    cl_mem_flags      flags,
 +-    ID3D10Texture3D * resource,
 +-    UINT              subresource,
 +-    cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
 +-    cl_command_queue command_queue,
 +-    cl_uint          num_objects,
 +-    const cl_mem *   mem_objects,
 +-    cl_uint          num_events_in_wait_list,
 +-    const cl_event * event_wait_list,
 +-    cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
 +-    cl_command_queue command_queue,
 +-    cl_uint          num_objects,
- -    cl_mem *         mem_objects,
++-    const cl_mem *   mem_objects,
 +-    cl_uint          num_events_in_wait_list,
 +-    const cl_event * event_wait_list,
 +-    cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-#ifdef __cplusplus
 +-}
 +-#endif
 +-
 +-#endif  // __OPENCL_CL_D3D10_H
 +-
 ++#include_next <CL/cl_d3d10.h>
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/include/CL/cl.h
- +++ beignet-0.0.0+git2013.04.01+d1b234c/include/CL/cl.h
- @@ -1,994 +1 @@
- -/* 
- - * Copyright © 2012 Intel Corporation
++Index: beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl.h
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/include/CL/cl.h	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl.h	2013-04-15 18:25:01.036323041 +0200
++@@ -1,1214 +1 @@
++-/*******************************************************************************
++- * Copyright (c) 2008 - 2012 The Khronos Group Inc.
 +- *
- - * This library is free software; you can redistribute it and/or
- - * modify it under the terms of the GNU Lesser General Public
- - * License as published by the Free Software Foundation; either
- - * version 2 of the License, or (at your option) any later version.
++- * Permission is hereby granted, free of charge, to any person obtaining a
++- * copy of this software and/or associated documentation files (the
++- * "Materials"), to deal in the Materials without restriction, including
++- * without limitation the rights to use, copy, modify, merge, publish,
++- * distribute, sublicense, and/or sell copies of the Materials, and to
++- * permit persons to whom the Materials are furnished to do so, subject to
++- * the following conditions:
 +- *
- - * This library is distributed in the hope that it will be useful,
- - * but WITHOUT ANY WARRANTY; without even the implied warranty of
- - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- - * Lesser General Public License for more details.
++- * The above copyright notice and this permission notice shall be included
++- * in all copies or substantial portions of the Materials.
 +- *
- - * You should have received a copy of the GNU Lesser General Public
- - * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- - *
- - * Author: Benjamin Segovia <benjamin.segovia at intel.com>
- - */
- -
- -/* $Revision: 11985 $ on $Date: 2010-07-15 11:16:06 -0700 (Thu, 15 Jul 2010) $ */
++- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
++- ******************************************************************************/
 +-
 +-#ifndef __OPENCL_CL_H
 +-#define __OPENCL_CL_H
 +-
 +-#ifdef __APPLE__
 +-#include <OpenCL/cl_platform.h>
 +-#else
 +-#include <CL/cl_platform.h>
 +-#endif	
 +-
 +-#ifdef __cplusplus
 +-extern "C" {
 +-#endif
 +-
 +-/******************************************************************************/
 +-
 +-typedef struct _cl_platform_id *    cl_platform_id;
 +-typedef struct _cl_device_id *      cl_device_id;
 +-typedef struct _cl_context *        cl_context;
 +-typedef struct _cl_command_queue *  cl_command_queue;
 +-typedef struct _cl_mem *            cl_mem;
 +-typedef struct _cl_program *        cl_program;
 +-typedef struct _cl_kernel *         cl_kernel;
 +-typedef struct _cl_event *          cl_event;
 +-typedef struct _cl_sampler *        cl_sampler;
 +-
 +-typedef cl_uint             cl_bool;                     /* WARNING!  Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */ 
 +-typedef cl_ulong            cl_bitfield;
 +-typedef cl_bitfield         cl_device_type;
 +-typedef cl_uint             cl_platform_info;
 +-typedef cl_uint             cl_device_info;
 +-typedef cl_bitfield         cl_device_fp_config;
 +-typedef cl_uint             cl_device_mem_cache_type;
 +-typedef cl_uint             cl_device_local_mem_type;
 +-typedef cl_bitfield         cl_device_exec_capabilities;
 +-typedef cl_bitfield         cl_command_queue_properties;
++-typedef intptr_t            cl_device_partition_property;
++-typedef cl_bitfield         cl_device_affinity_domain;
 +-
 +-typedef intptr_t            cl_context_properties;
 +-typedef cl_uint             cl_context_info;
 +-typedef cl_uint             cl_command_queue_info;
 +-typedef cl_uint             cl_channel_order;
 +-typedef cl_uint             cl_channel_type;
 +-typedef cl_bitfield         cl_mem_flags;
- -typedef cl_uint             cl_mem_type;
++-typedef cl_uint             cl_mem_object_type;
 +-typedef cl_uint             cl_mem_info;
++-typedef cl_bitfield         cl_mem_migration_flags;
 +-typedef cl_uint             cl_image_info;
 +-typedef cl_uint             cl_buffer_create_type;
 +-typedef cl_uint             cl_addressing_mode;
 +-typedef cl_uint             cl_filter_mode;
 +-typedef cl_uint             cl_sampler_info;
 +-typedef cl_bitfield         cl_map_flags;
 +-typedef cl_uint             cl_program_info;
 +-typedef cl_uint             cl_program_build_info;
++-typedef cl_uint             cl_program_binary_type;
 +-typedef cl_int              cl_build_status;
 +-typedef cl_uint             cl_kernel_info;
++-typedef cl_uint             cl_kernel_arg_info;
++-typedef cl_uint             cl_kernel_arg_address_qualifier;
++-typedef cl_uint             cl_kernel_arg_access_qualifier;
++-typedef cl_bitfield         cl_kernel_arg_type_qualifier;
 +-typedef cl_uint             cl_kernel_work_group_info;
 +-typedef cl_uint             cl_event_info;
 +-typedef cl_uint             cl_command_type;
 +-typedef cl_uint             cl_profiling_info;
 +-
++-
 +-typedef struct _cl_image_format {
 +-    cl_channel_order        image_channel_order;
 +-    cl_channel_type         image_channel_data_type;
 +-} cl_image_format;
 +-
++-typedef struct _cl_image_desc {
++-    cl_mem_object_type      image_type;
++-    size_t                  image_width;
++-    size_t                  image_height;
++-    size_t                  image_depth;
++-    size_t                  image_array_size;
++-    size_t                  image_row_pitch;
++-    size_t                  image_slice_pitch;
++-    cl_uint                 num_mip_levels;
++-    cl_uint                 num_samples;
++-    cl_mem                  buffer;
++-} cl_image_desc;
 +-
 +-typedef struct _cl_buffer_region {
 +-    size_t                  origin;
 +-    size_t                  size;
 +-} cl_buffer_region;
 +-
++-
 +-/******************************************************************************/
 +-
 +-/* Error Codes */
 +-#define CL_SUCCESS                                  0
 +-#define CL_DEVICE_NOT_FOUND                         -1
 +-#define CL_DEVICE_NOT_AVAILABLE                     -2
 +-#define CL_COMPILER_NOT_AVAILABLE                   -3
- -#define CL_MEM_ALLOCATION_FAILURE            -4
++-#define CL_MEM_OBJECT_ALLOCATION_FAILURE            -4
 +-#define CL_OUT_OF_RESOURCES                         -5
 +-#define CL_OUT_OF_HOST_MEMORY                       -6
 +-#define CL_PROFILING_INFO_NOT_AVAILABLE             -7
 +-#define CL_MEM_COPY_OVERLAP                         -8
 +-#define CL_IMAGE_FORMAT_MISMATCH                    -9
 +-#define CL_IMAGE_FORMAT_NOT_SUPPORTED               -10
 +-#define CL_BUILD_PROGRAM_FAILURE                    -11
 +-#define CL_MAP_FAILURE                              -12
 +-#define CL_MISALIGNED_SUB_BUFFER_OFFSET             -13
 +-#define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
++-#define CL_COMPILE_PROGRAM_FAILURE                  -15
++-#define CL_LINKER_NOT_AVAILABLE                     -16
++-#define CL_LINK_PROGRAM_FAILURE                     -17
++-#define CL_DEVICE_PARTITION_FAILED                  -18
++-#define CL_KERNEL_ARG_INFO_NOT_AVAILABLE            -19
 +-
 +-#define CL_INVALID_VALUE                            -30
 +-#define CL_INVALID_DEVICE_TYPE                      -31
 +-#define CL_INVALID_PLATFORM                         -32
 +-#define CL_INVALID_DEVICE                           -33
 +-#define CL_INVALID_CONTEXT                          -34
 +-#define CL_INVALID_QUEUE_PROPERTIES                 -35
 +-#define CL_INVALID_COMMAND_QUEUE                    -36
 +-#define CL_INVALID_HOST_PTR                         -37
- -#define CL_INVALID_MEM                       -38
++-#define CL_INVALID_MEM_OBJECT                       -38
 +-#define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR          -39
 +-#define CL_INVALID_IMAGE_SIZE                       -40
 +-#define CL_INVALID_SAMPLER                          -41
 +-#define CL_INVALID_BINARY                           -42
 +-#define CL_INVALID_BUILD_OPTIONS                    -43
 +-#define CL_INVALID_PROGRAM                          -44
 +-#define CL_INVALID_PROGRAM_EXECUTABLE               -45
 +-#define CL_INVALID_KERNEL_NAME                      -46
 +-#define CL_INVALID_KERNEL_DEFINITION                -47
 +-#define CL_INVALID_KERNEL                           -48
 +-#define CL_INVALID_ARG_INDEX                        -49
 +-#define CL_INVALID_ARG_VALUE                        -50
 +-#define CL_INVALID_ARG_SIZE                         -51
 +-#define CL_INVALID_KERNEL_ARGS                      -52
 +-#define CL_INVALID_WORK_DIMENSION                   -53
 +-#define CL_INVALID_WORK_GROUP_SIZE                  -54
 +-#define CL_INVALID_WORK_ITEM_SIZE                   -55
 +-#define CL_INVALID_GLOBAL_OFFSET                    -56
 +-#define CL_INVALID_EVENT_WAIT_LIST                  -57
 +-#define CL_INVALID_EVENT                            -58
 +-#define CL_INVALID_OPERATION                        -59
 +-#define CL_INVALID_GL_OBJECT                        -60
 +-#define CL_INVALID_BUFFER_SIZE                      -61
 +-#define CL_INVALID_MIP_LEVEL                        -62
 +-#define CL_INVALID_GLOBAL_WORK_SIZE                 -63
 +-#define CL_INVALID_PROPERTY                         -64
++-#define CL_INVALID_IMAGE_DESCRIPTOR                 -65
++-#define CL_INVALID_COMPILER_OPTIONS                 -66
++-#define CL_INVALID_LINKER_OPTIONS                   -67
++-#define CL_INVALID_DEVICE_PARTITION_COUNT           -68
 +-
 +-/* OpenCL Version */
 +-#define CL_VERSION_1_0                              1
 +-#define CL_VERSION_1_1                              1
++-#define CL_VERSION_1_2                              1
 +-
 +-/* cl_bool */
 +-#define CL_FALSE                                    0
 +-#define CL_TRUE                                     1
++-#define CL_BLOCKING                                 CL_TRUE
++-#define CL_NON_BLOCKING                             CL_FALSE
 +-
 +-/* cl_platform_info */
 +-#define CL_PLATFORM_PROFILE                         0x0900
 +-#define CL_PLATFORM_VERSION                         0x0901
 +-#define CL_PLATFORM_NAME                            0x0902
 +-#define CL_PLATFORM_VENDOR                          0x0903
 +-#define CL_PLATFORM_EXTENSIONS                      0x0904
 +-
 +-/* cl_device_type - bitfield */
 +-#define CL_DEVICE_TYPE_DEFAULT                      (1 << 0)
 +-#define CL_DEVICE_TYPE_CPU                          (1 << 1)
 +-#define CL_DEVICE_TYPE_GPU                          (1 << 2)
 +-#define CL_DEVICE_TYPE_ACCELERATOR                  (1 << 3)
++-#define CL_DEVICE_TYPE_CUSTOM                       (1 << 4)
 +-#define CL_DEVICE_TYPE_ALL                          0xFFFFFFFF
 +-
 +-/* cl_device_info */
 +-#define CL_DEVICE_TYPE                              0x1000
 +-#define CL_DEVICE_VENDOR_ID                         0x1001
 +-#define CL_DEVICE_MAX_COMPUTE_UNITS                 0x1002
 +-#define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS          0x1003
 +-#define CL_DEVICE_MAX_WORK_GROUP_SIZE               0x1004
 +-#define CL_DEVICE_MAX_WORK_ITEM_SIZES               0x1005
 +-#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR       0x1006
 +-#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT      0x1007
 +-#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT        0x1008
 +-#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG       0x1009
 +-#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT      0x100A
 +-#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE     0x100B
 +-#define CL_DEVICE_MAX_CLOCK_FREQUENCY               0x100C
 +-#define CL_DEVICE_ADDRESS_BITS                      0x100D
 +-#define CL_DEVICE_MAX_READ_IMAGE_ARGS               0x100E
 +-#define CL_DEVICE_MAX_WRITE_IMAGE_ARGS              0x100F
 +-#define CL_DEVICE_MAX_MEM_ALLOC_SIZE                0x1010
 +-#define CL_DEVICE_IMAGE2D_MAX_WIDTH                 0x1011
 +-#define CL_DEVICE_IMAGE2D_MAX_HEIGHT                0x1012
 +-#define CL_DEVICE_IMAGE3D_MAX_WIDTH                 0x1013
 +-#define CL_DEVICE_IMAGE3D_MAX_HEIGHT                0x1014
 +-#define CL_DEVICE_IMAGE3D_MAX_DEPTH                 0x1015
 +-#define CL_DEVICE_IMAGE_SUPPORT                     0x1016
 +-#define CL_DEVICE_MAX_PARAMETER_SIZE                0x1017
 +-#define CL_DEVICE_MAX_SAMPLERS                      0x1018
 +-#define CL_DEVICE_MEM_BASE_ADDR_ALIGN               0x1019
 +-#define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE          0x101A
 +-#define CL_DEVICE_SINGLE_FP_CONFIG                  0x101B
 +-#define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE             0x101C
 +-#define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE         0x101D
 +-#define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE             0x101E
 +-#define CL_DEVICE_GLOBAL_MEM_SIZE                   0x101F
 +-#define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE          0x1020
 +-#define CL_DEVICE_MAX_CONSTANT_ARGS                 0x1021
 +-#define CL_DEVICE_LOCAL_MEM_TYPE                    0x1022
 +-#define CL_DEVICE_LOCAL_MEM_SIZE                    0x1023
 +-#define CL_DEVICE_ERROR_CORRECTION_SUPPORT          0x1024
 +-#define CL_DEVICE_PROFILING_TIMER_RESOLUTION        0x1025
 +-#define CL_DEVICE_ENDIAN_LITTLE                     0x1026
 +-#define CL_DEVICE_AVAILABLE                         0x1027
 +-#define CL_DEVICE_COMPILER_AVAILABLE                0x1028
 +-#define CL_DEVICE_EXECUTION_CAPABILITIES            0x1029
 +-#define CL_DEVICE_QUEUE_PROPERTIES                  0x102A
 +-#define CL_DEVICE_NAME                              0x102B
 +-#define CL_DEVICE_VENDOR                            0x102C
 +-#define CL_DRIVER_VERSION                           0x102D
 +-#define CL_DEVICE_PROFILE                           0x102E
 +-#define CL_DEVICE_VERSION                           0x102F
 +-#define CL_DEVICE_EXTENSIONS                        0x1030
 +-#define CL_DEVICE_PLATFORM                          0x1031
- -/* 0x1032 reserved for CL_DEVICE_DOUBLE_FP_CONFIG */
++-#define CL_DEVICE_DOUBLE_FP_CONFIG                  0x1032
 +-/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
 +-#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF       0x1034
 +-#define CL_DEVICE_HOST_UNIFIED_MEMORY               0x1035
 +-#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR          0x1036
 +-#define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT         0x1037
 +-#define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT           0x1038
 +-#define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG          0x1039
 +-#define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT         0x103A
 +-#define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE        0x103B
 +-#define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF          0x103C
 +-#define CL_DEVICE_OPENCL_C_VERSION                  0x103D
++-#define CL_DEVICE_LINKER_AVAILABLE                  0x103E
++-#define CL_DEVICE_BUILT_IN_KERNELS                  0x103F
++-#define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE             0x1040
++-#define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE              0x1041
++-#define CL_DEVICE_PARENT_DEVICE                     0x1042
++-#define CL_DEVICE_PARTITION_MAX_SUB_DEVICES         0x1043
++-#define CL_DEVICE_PARTITION_PROPERTIES              0x1044
++-#define CL_DEVICE_PARTITION_AFFINITY_DOMAIN         0x1045
++-#define CL_DEVICE_PARTITION_TYPE                    0x1046
++-#define CL_DEVICE_REFERENCE_COUNT                   0x1047
++-#define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC       0x1048
++-#define CL_DEVICE_PRINTF_BUFFER_SIZE                0x1049
++-#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT             0x104A
++-#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT      0x104B
 +-
 +-/* cl_device_fp_config - bitfield */
 +-#define CL_FP_DENORM                                (1 << 0)
 +-#define CL_FP_INF_NAN                               (1 << 1)
 +-#define CL_FP_ROUND_TO_NEAREST                      (1 << 2)
 +-#define CL_FP_ROUND_TO_ZERO                         (1 << 3)
 +-#define CL_FP_ROUND_TO_INF                          (1 << 4)
 +-#define CL_FP_FMA                                   (1 << 5)
 +-#define CL_FP_SOFT_FLOAT                            (1 << 6)
++-#define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT         (1 << 7)
 +-
 +-/* cl_device_mem_cache_type */
 +-#define CL_NONE                                     0x0
 +-#define CL_READ_ONLY_CACHE                          0x1
 +-#define CL_READ_WRITE_CACHE                         0x2
 +-
 +-/* cl_device_local_mem_type */
 +-#define CL_LOCAL                                    0x1
 +-#define CL_GLOBAL                                   0x2
 +-
 +-/* cl_device_exec_capabilities - bitfield */
 +-#define CL_EXEC_KERNEL                              (1 << 0)
 +-#define CL_EXEC_NATIVE_KERNEL                       (1 << 1)
 +-
 +-/* cl_command_queue_properties - bitfield */
 +-#define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE      (1 << 0)
 +-#define CL_QUEUE_PROFILING_ENABLE                   (1 << 1)
 +-
 +-/* cl_context_info  */
 +-#define CL_CONTEXT_REFERENCE_COUNT                  0x1080
 +-#define CL_CONTEXT_DEVICES                          0x1081
 +-#define CL_CONTEXT_PROPERTIES                       0x1082
 +-#define CL_CONTEXT_NUM_DEVICES                      0x1083
 +-
- -/* cl_context_info + cl_context_properties */
++-/* cl_context_properties */
 +-#define CL_CONTEXT_PLATFORM                         0x1084
++-#define CL_CONTEXT_INTEROP_USER_SYNC                0x1085
++-    
++-/* cl_device_partition_property */
++-#define CL_DEVICE_PARTITION_EQUALLY                 0x1086
++-#define CL_DEVICE_PARTITION_BY_COUNTS               0x1087
++-#define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END      0x0
++-#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN      0x1088
++-    
++-/* cl_device_affinity_domain */
++-#define CL_DEVICE_AFFINITY_DOMAIN_NUMA                     (1 << 0)
++-#define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE                 (1 << 1)
++-#define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE                 (1 << 2)
++-#define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE                 (1 << 3)
++-#define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE                 (1 << 4)
++-#define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE       (1 << 5)
 +-
 +-/* cl_command_queue_info */
 +-#define CL_QUEUE_CONTEXT                            0x1090
 +-#define CL_QUEUE_DEVICE                             0x1091
 +-#define CL_QUEUE_REFERENCE_COUNT                    0x1092
 +-#define CL_QUEUE_PROPERTIES                         0x1093
 +-
 +-/* cl_mem_flags - bitfield */
 +-#define CL_MEM_READ_WRITE                           (1 << 0)
 +-#define CL_MEM_WRITE_ONLY                           (1 << 1)
 +-#define CL_MEM_READ_ONLY                            (1 << 2)
 +-#define CL_MEM_USE_HOST_PTR                         (1 << 3)
 +-#define CL_MEM_ALLOC_HOST_PTR                       (1 << 4)
 +-#define CL_MEM_COPY_HOST_PTR                        (1 << 5)
++-// reserved                                         (1 << 6)    
++-#define CL_MEM_HOST_WRITE_ONLY                      (1 << 7)
++-#define CL_MEM_HOST_READ_ONLY                       (1 << 8)
++-#define CL_MEM_HOST_NO_ACCESS                       (1 << 9)
++-
++-/* cl_mem_migration_flags - bitfield */
++-#define CL_MIGRATE_MEM_OBJECT_HOST                  (1 << 0)
++-#define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED     (1 << 1)
 +-
 +-/* cl_channel_order */
 +-#define CL_R                                        0x10B0
 +-#define CL_A                                        0x10B1
 +-#define CL_RG                                       0x10B2
 +-#define CL_RA                                       0x10B3
 +-#define CL_RGB                                      0x10B4
 +-#define CL_RGBA                                     0x10B5
 +-#define CL_BGRA                                     0x10B6
 +-#define CL_ARGB                                     0x10B7
 +-#define CL_INTENSITY                                0x10B8
 +-#define CL_LUMINANCE                                0x10B9
 +-#define CL_Rx                                       0x10BA
 +-#define CL_RGx                                      0x10BB
 +-#define CL_RGBx                                     0x10BC
++-#define CL_DEPTH                                    0x10BD
++-#define CL_DEPTH_STENCIL                            0x10BE
 +-
 +-/* cl_channel_type */
 +-#define CL_SNORM_INT8                               0x10D0
 +-#define CL_SNORM_INT16                              0x10D1
 +-#define CL_UNORM_INT8                               0x10D2
 +-#define CL_UNORM_INT16                              0x10D3
 +-#define CL_UNORM_SHORT_565                          0x10D4
 +-#define CL_UNORM_SHORT_555                          0x10D5
 +-#define CL_UNORM_INT_101010                         0x10D6
 +-#define CL_SIGNED_INT8                              0x10D7
 +-#define CL_SIGNED_INT16                             0x10D8
 +-#define CL_SIGNED_INT32                             0x10D9
 +-#define CL_UNSIGNED_INT8                            0x10DA
 +-#define CL_UNSIGNED_INT16                           0x10DB
 +-#define CL_UNSIGNED_INT32                           0x10DC
 +-#define CL_HALF_FLOAT                               0x10DD
 +-#define CL_FLOAT                                    0x10DE
++-#define CL_UNORM_INT24                              0x10DF
 +-
- -/* cl_mem_type */
++-/* cl_mem_object_type */
 +-#define CL_MEM_OBJECT_BUFFER                        0x10F0
 +-#define CL_MEM_OBJECT_IMAGE2D                       0x10F1
 +-#define CL_MEM_OBJECT_IMAGE3D                       0x10F2
++-#define CL_MEM_OBJECT_IMAGE2D_ARRAY                 0x10F3
++-#define CL_MEM_OBJECT_IMAGE1D                       0x10F4
++-#define CL_MEM_OBJECT_IMAGE1D_ARRAY                 0x10F5
++-#define CL_MEM_OBJECT_IMAGE1D_BUFFER                0x10F6
 +-
 +-/* cl_mem_info */
 +-#define CL_MEM_TYPE                                 0x1100
 +-#define CL_MEM_FLAGS                                0x1101
 +-#define CL_MEM_SIZE                                 0x1102
 +-#define CL_MEM_HOST_PTR                             0x1103
 +-#define CL_MEM_MAP_COUNT                            0x1104
 +-#define CL_MEM_REFERENCE_COUNT                      0x1105
 +-#define CL_MEM_CONTEXT                              0x1106
 +-#define CL_MEM_ASSOCIATED_MEMOBJECT                 0x1107
 +-#define CL_MEM_OFFSET                               0x1108
 +-
 +-/* cl_image_info */
 +-#define CL_IMAGE_FORMAT                             0x1110
 +-#define CL_IMAGE_ELEMENT_SIZE                       0x1111
 +-#define CL_IMAGE_ROW_PITCH                          0x1112
 +-#define CL_IMAGE_SLICE_PITCH                        0x1113
 +-#define CL_IMAGE_WIDTH                              0x1114
 +-#define CL_IMAGE_HEIGHT                             0x1115
 +-#define CL_IMAGE_DEPTH                              0x1116
++-#define CL_IMAGE_ARRAY_SIZE                         0x1117
++-#define CL_IMAGE_BUFFER                             0x1118
++-#define CL_IMAGE_NUM_MIP_LEVELS                     0x1119
++-#define CL_IMAGE_NUM_SAMPLES                        0x111A
 +-
 +-/* cl_addressing_mode */
 +-#define CL_ADDRESS_NONE                             0x1130
 +-#define CL_ADDRESS_CLAMP_TO_EDGE                    0x1131
 +-#define CL_ADDRESS_CLAMP                            0x1132
 +-#define CL_ADDRESS_REPEAT                           0x1133
 +-#define CL_ADDRESS_MIRRORED_REPEAT                  0x1134
 +-
 +-/* cl_filter_mode */
 +-#define CL_FILTER_NEAREST                           0x1140
 +-#define CL_FILTER_LINEAR                            0x1141
 +-
 +-/* cl_sampler_info */
 +-#define CL_SAMPLER_REFERENCE_COUNT                  0x1150
 +-#define CL_SAMPLER_CONTEXT                          0x1151
 +-#define CL_SAMPLER_NORMALIZED_COORDS                0x1152
 +-#define CL_SAMPLER_ADDRESSING_MODE                  0x1153
 +-#define CL_SAMPLER_FILTER_MODE                      0x1154
 +-
 +-/* cl_map_flags - bitfield */
 +-#define CL_MAP_READ                                 (1 << 0)
 +-#define CL_MAP_WRITE                                (1 << 1)
++-#define CL_MAP_WRITE_INVALIDATE_REGION              (1 << 2)
 +-
 +-/* cl_program_info */
 +-#define CL_PROGRAM_REFERENCE_COUNT                  0x1160
 +-#define CL_PROGRAM_CONTEXT                          0x1161
 +-#define CL_PROGRAM_NUM_DEVICES                      0x1162
 +-#define CL_PROGRAM_DEVICES                          0x1163
 +-#define CL_PROGRAM_SOURCE                           0x1164
 +-#define CL_PROGRAM_BINARY_SIZES                     0x1165
 +-#define CL_PROGRAM_BINARIES                         0x1166
++-#define CL_PROGRAM_NUM_KERNELS                      0x1167
++-#define CL_PROGRAM_KERNEL_NAMES                     0x1168
 +-
 +-/* cl_program_build_info */
 +-#define CL_PROGRAM_BUILD_STATUS                     0x1181
 +-#define CL_PROGRAM_BUILD_OPTIONS                    0x1182
 +-#define CL_PROGRAM_BUILD_LOG                        0x1183
++-#define CL_PROGRAM_BINARY_TYPE                      0x1184
++-    
++-/* cl_program_binary_type */
++-#define CL_PROGRAM_BINARY_TYPE_NONE                 0x0
++-#define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT      0x1
++-#define CL_PROGRAM_BINARY_TYPE_LIBRARY              0x2
++-#define CL_PROGRAM_BINARY_TYPE_EXECUTABLE           0x4
 +-
 +-/* cl_build_status */
 +-#define CL_BUILD_SUCCESS                            0
 +-#define CL_BUILD_NONE                               -1
 +-#define CL_BUILD_ERROR                              -2
 +-#define CL_BUILD_IN_PROGRESS                        -3
 +-
 +-/* cl_kernel_info */
 +-#define CL_KERNEL_FUNCTION_NAME                     0x1190
 +-#define CL_KERNEL_NUM_ARGS                          0x1191
 +-#define CL_KERNEL_REFERENCE_COUNT                   0x1192
 +-#define CL_KERNEL_CONTEXT                           0x1193
 +-#define CL_KERNEL_PROGRAM                           0x1194
++-#define CL_KERNEL_ATTRIBUTES                        0x1195
++-
++-/* cl_kernel_arg_info */
++-#define CL_KERNEL_ARG_ADDRESS_QUALIFIER             0x1196
++-#define CL_KERNEL_ARG_ACCESS_QUALIFIER              0x1197
++-#define CL_KERNEL_ARG_TYPE_NAME                     0x1198
++-#define CL_KERNEL_ARG_TYPE_QUALIFIER                0x1199
++-#define CL_KERNEL_ARG_NAME                          0x119A
++-
++-/* cl_kernel_arg_address_qualifier */
++-#define CL_KERNEL_ARG_ADDRESS_GLOBAL                0x119B
++-#define CL_KERNEL_ARG_ADDRESS_LOCAL                 0x119C
++-#define CL_KERNEL_ARG_ADDRESS_CONSTANT              0x119D
++-#define CL_KERNEL_ARG_ADDRESS_PRIVATE               0x119E
++-
++-/* cl_kernel_arg_access_qualifier */
++-#define CL_KERNEL_ARG_ACCESS_READ_ONLY              0x11A0
++-#define CL_KERNEL_ARG_ACCESS_WRITE_ONLY             0x11A1
++-#define CL_KERNEL_ARG_ACCESS_READ_WRITE             0x11A2
++-#define CL_KERNEL_ARG_ACCESS_NONE                   0x11A3
++-    
++-/* cl_kernel_arg_type_qualifer */
++-#define CL_KERNEL_ARG_TYPE_NONE                     0
++-#define CL_KERNEL_ARG_TYPE_CONST                    (1 << 0)
++-#define CL_KERNEL_ARG_TYPE_RESTRICT                 (1 << 1)
++-#define CL_KERNEL_ARG_TYPE_VOLATILE                 (1 << 2)
 +-
 +-/* cl_kernel_work_group_info */
 +-#define CL_KERNEL_WORK_GROUP_SIZE                   0x11B0
 +-#define CL_KERNEL_COMPILE_WORK_GROUP_SIZE           0x11B1
 +-#define CL_KERNEL_LOCAL_MEM_SIZE                    0x11B2
 +-#define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
 +-#define CL_KERNEL_PRIVATE_MEM_SIZE                  0x11B4
++-#define CL_KERNEL_GLOBAL_WORK_SIZE                  0x11B5
 +-
 +-/* cl_event_info  */
 +-#define CL_EVENT_COMMAND_QUEUE                      0x11D0
 +-#define CL_EVENT_COMMAND_TYPE                       0x11D1
 +-#define CL_EVENT_REFERENCE_COUNT                    0x11D2
 +-#define CL_EVENT_COMMAND_EXECUTION_STATUS           0x11D3
 +-#define CL_EVENT_CONTEXT                            0x11D4
 +-
 +-/* cl_command_type */
 +-#define CL_COMMAND_NDRANGE_KERNEL                   0x11F0
 +-#define CL_COMMAND_TASK                             0x11F1
 +-#define CL_COMMAND_NATIVE_KERNEL                    0x11F2
 +-#define CL_COMMAND_READ_BUFFER                      0x11F3
 +-#define CL_COMMAND_WRITE_BUFFER                     0x11F4
 +-#define CL_COMMAND_COPY_BUFFER                      0x11F5
 +-#define CL_COMMAND_READ_IMAGE                       0x11F6
 +-#define CL_COMMAND_WRITE_IMAGE                      0x11F7
 +-#define CL_COMMAND_COPY_IMAGE                       0x11F8
 +-#define CL_COMMAND_COPY_IMAGE_TO_BUFFER             0x11F9
 +-#define CL_COMMAND_COPY_BUFFER_TO_IMAGE             0x11FA
 +-#define CL_COMMAND_MAP_BUFFER                       0x11FB
 +-#define CL_COMMAND_MAP_IMAGE                        0x11FC
 +-#define CL_COMMAND_UNMAP_MEM_OBJECT                 0x11FD
 +-#define CL_COMMAND_MARKER                           0x11FE
 +-#define CL_COMMAND_ACQUIRE_GL_OBJECTS               0x11FF
 +-#define CL_COMMAND_RELEASE_GL_OBJECTS               0x1200
 +-#define CL_COMMAND_READ_BUFFER_RECT                 0x1201
 +-#define CL_COMMAND_WRITE_BUFFER_RECT                0x1202
 +-#define CL_COMMAND_COPY_BUFFER_RECT                 0x1203
 +-#define CL_COMMAND_USER                             0x1204
++-#define CL_COMMAND_BARRIER                          0x1205
++-#define CL_COMMAND_MIGRATE_MEM_OBJECTS              0x1206
++-#define CL_COMMAND_FILL_BUFFER                      0x1207
++-#define CL_COMMAND_FILL_IMAGE                       0x1208
 +-
 +-/* command execution status */
 +-#define CL_COMPLETE                                 0x0
 +-#define CL_RUNNING                                  0x1
 +-#define CL_SUBMITTED                                0x2
 +-#define CL_QUEUED                                   0x3
- -  
++-
 +-/* cl_buffer_create_type  */
 +-#define CL_BUFFER_CREATE_TYPE_REGION                0x1220
 +-
 +-/* cl_profiling_info  */
 +-#define CL_PROFILING_COMMAND_QUEUED                 0x1280
 +-#define CL_PROFILING_COMMAND_SUBMIT                 0x1281
 +-#define CL_PROFILING_COMMAND_START                  0x1282
 +-#define CL_PROFILING_COMMAND_END                    0x1283
 +-
 +-/********************************************************************************************************/
 +-
 +-/* Platform API */
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetPlatformIDs(cl_uint          /* num_entries */,
 +-                 cl_platform_id * /* platforms */,
 +-                 cl_uint *        /* num_platforms */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL 
 +-clGetPlatformInfo(cl_platform_id   /* platform */, 
 +-                  cl_platform_info /* param_name */,
 +-                  size_t           /* param_value_size */, 
 +-                  void *           /* param_value */,
 +-                  size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-/* Device APIs */
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetDeviceIDs(cl_platform_id   /* platform */,
 +-               cl_device_type   /* device_type */, 
 +-               cl_uint          /* num_entries */, 
 +-               cl_device_id *   /* devices */, 
 +-               cl_uint *        /* num_devices */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetDeviceInfo(cl_device_id    /* device */,
 +-                cl_device_info  /* param_name */, 
 +-                size_t          /* param_value_size */, 
 +-                void *          /* param_value */,
 +-                size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
++-    
++-extern CL_API_ENTRY cl_int CL_API_CALL
++-clCreateSubDevices(cl_device_id                         /* in_device */,
++-                   const cl_device_partition_property * /* properties */,
++-                   cl_uint                              /* num_devices */,
++-                   cl_device_id *                       /* out_devices */,
++-                   cl_uint *                            /* num_devices_ret */) CL_API_SUFFIX__VERSION_1_2;
 +-
++-extern CL_API_ENTRY cl_int CL_API_CALL
++-clRetainDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
++-    
++-extern CL_API_ENTRY cl_int CL_API_CALL
++-clReleaseDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
++-    
 +-/* Context APIs  */
 +-extern CL_API_ENTRY cl_context CL_API_CALL
 +-clCreateContext(const cl_context_properties * /* properties */,
- -                cl_uint                       /* num_devices */,
- -                const cl_device_id *          /* devices */,
++-                cl_uint                 /* num_devices */,
++-                const cl_device_id *    /* devices */,
 +-                void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
- -                void *                        /* user_data */,
- -                cl_int *                      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
++-                void *                  /* user_data */,
++-                cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_context CL_API_CALL
- -clCreateContextFromtype(const cl_context_properties * /* properties */,
- -                        cl_device_type                /* device_type */,
++-clCreateContextFromType(const cl_context_properties * /* properties */,
++-                        cl_device_type          /* device_type */,
 +-                        void (CL_CALLBACK *     /* pfn_notify*/ )(const char *, const void *, size_t, void *),
- -                        void *                        /* user_data */,
- -                        cl_int *                      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
++-                        void *                  /* user_data */,
++-                        cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clReleaseContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetContextInfo(cl_context         /* context */, 
 +-                 cl_context_info    /* param_name */, 
 +-                 size_t             /* param_value_size */, 
 +-                 void *             /* param_value */, 
 +-                 size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-/* Command Queue APIs */
 +-extern CL_API_ENTRY cl_command_queue CL_API_CALL
 +-clCreateCommandQueue(cl_context                     /* context */, 
 +-                     cl_device_id                   /* device */, 
 +-                     cl_command_queue_properties    /* properties */,
 +-                     cl_int *                       /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clRetainCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clReleaseCommandQueue(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetCommandQueueInfo(cl_command_queue      /* command_queue */,
 +-                      cl_command_queue_info /* param_name */,
 +-                      size_t                /* param_value_size */,
 +-                      void *                /* param_value */,
 +-                      size_t *              /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
- -#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
- -#warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1!
- -/* 
- - *  WARNING:
- - *     This API introduces mutable state into the OpenCL implementation. It has been REMOVED
- - *  to better facilitate thread safety.  The 1.0 API is not thread safe. It is not tested by the
- - *  OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
- - *  It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
- - *
- - *  Software developers previously relying on this API are instructed to set the command queue 
- - *  properties when creating the queue, instead. 
- - */
- -extern CL_API_ENTRY cl_int CL_API_CALL
- -clSetCommandQueueProperty(cl_command_queue              /* command_queue */,
- -                          cl_command_queue_properties   /* properties */, 
- -                          cl_bool                        /* enable */,
- -                          cl_command_queue_properties * /* old_properties */) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
- -#endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
- -
 +-/* Memory Object APIs */
 +-extern CL_API_ENTRY cl_mem CL_API_CALL
 +-clCreateBuffer(cl_context   /* context */,
 +-               cl_mem_flags /* flags */,
 +-               size_t       /* size */,
 +-               void *       /* host_ptr */,
 +-               cl_int *     /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_mem CL_API_CALL
 +-clCreateSubBuffer(cl_mem                   /* buffer */,
 +-                  cl_mem_flags             /* flags */,
 +-                  cl_buffer_create_type    /* buffer_create_type */,
 +-                  const void *             /* buffer_create_info */,
 +-                  cl_int *                 /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
 +-
 +-extern CL_API_ENTRY cl_mem CL_API_CALL
- -clCreateImage2D(cl_context              /* context */,
- -                cl_mem_flags            /* flags */,
- -                const cl_image_format * /* image_format */,
- -                size_t                  /* image_width */,
- -                size_t                  /* image_height */,
- -                size_t                  /* image_row_pitch */, 
- -                void *                  /* host_ptr */,
- -                cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
- -                        
- -extern CL_API_ENTRY cl_mem CL_API_CALL
- -clCreateImage3D(cl_context              /* context */,
- -                cl_mem_flags            /* flags */,
- -                const cl_image_format * /* image_format */,
- -                size_t                  /* image_width */, 
- -                size_t                  /* image_height */,
- -                size_t                  /* image_depth */, 
- -                size_t                  /* image_row_pitch */, 
- -                size_t                  /* image_slice_pitch */, 
- -                void *                  /* host_ptr */,
- -                cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
++-clCreateImage(cl_context              /* context */,
++-              cl_mem_flags            /* flags */,
++-              const cl_image_format * /* image_format */,
++-              const cl_image_desc *   /* image_desc */, 
++-              void *                  /* host_ptr */,
++-              cl_int *                /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
 +-                        
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clReleaseMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetSupportedImageFormats(cl_context           /* context */,
 +-                           cl_mem_flags         /* flags */,
- -                           cl_mem_type   /* image_type */,
++-                           cl_mem_object_type   /* image_type */,
 +-                           cl_uint              /* num_entries */,
 +-                           cl_image_format *    /* image_formats */,
 +-                           cl_uint *            /* num_image_formats */) CL_API_SUFFIX__VERSION_1_0;
 +-                                    
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetMemObjectInfo(cl_mem           /* memobj */,
 +-                   cl_mem_info      /* param_name */, 
 +-                   size_t           /* param_value_size */,
 +-                   void *           /* param_value */,
 +-                   size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetImageInfo(cl_mem           /* image */,
 +-               cl_image_info    /* param_name */, 
 +-               size_t           /* param_value_size */,
 +-               void *           /* param_value */,
 +-               size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clSetMemObjectDestructorCallback(  cl_mem /* memobj */, 
 +-                                    void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/), 
 +-                                    void * /*user_data */ )             CL_API_SUFFIX__VERSION_1_1;  
 +-
- -/* Sampler APIs  */
++-/* Sampler APIs */
 +-extern CL_API_ENTRY cl_sampler CL_API_CALL
 +-clCreateSampler(cl_context          /* context */,
 +-                cl_bool             /* normalized_coords */, 
 +-                cl_addressing_mode  /* addressing_mode */, 
 +-                cl_filter_mode      /* filter_mode */,
 +-                cl_int *            /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clRetainSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clReleaseSampler(cl_sampler /* sampler */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetSamplerInfo(cl_sampler         /* sampler */,
 +-                 cl_sampler_info    /* param_name */,
 +-                 size_t             /* param_value_size */,
 +-                 void *             /* param_value */,
 +-                 size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
- -
++-                            
 +-/* Program Object APIs  */
 +-extern CL_API_ENTRY cl_program CL_API_CALL
 +-clCreateProgramWithSource(cl_context        /* context */,
 +-                          cl_uint           /* count */,
 +-                          const char **     /* strings */,
 +-                          const size_t *    /* lengths */,
 +-                          cl_int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_program CL_API_CALL
 +-clCreateProgramWithBinary(cl_context                     /* context */,
 +-                          cl_uint                        /* num_devices */,
 +-                          const cl_device_id *           /* device_list */,
 +-                          const size_t *                 /* lengths */,
 +-                          const unsigned char **         /* binaries */,
 +-                          cl_int *                       /* binary_status */,
 +-                          cl_int *                       /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
++-extern CL_API_ENTRY cl_program CL_API_CALL
++-clCreateProgramWithBuiltInKernels(cl_context            /* context */,
++-                                  cl_uint               /* num_devices */,
++-                                  const cl_device_id *  /* device_list */,
++-                                  const char *          /* kernel_names */,
++-                                  cl_int *              /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
++-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clReleaseProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clBuildProgram(cl_program           /* program */,
 +-               cl_uint              /* num_devices */,
 +-               const cl_device_id * /* device_list */,
 +-               const char *         /* options */, 
 +-               void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
 +-               void *               /* user_data */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
- -clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_0;
++-clCompileProgram(cl_program           /* program */,
++-                 cl_uint              /* num_devices */,
++-                 const cl_device_id * /* device_list */,
++-                 const char *         /* options */, 
++-                 cl_uint              /* num_input_headers */,
++-                 const cl_program *   /* input_headers */,
++-                 const char **        /* header_include_names */,
++-                 void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
++-                 void *               /* user_data */) CL_API_SUFFIX__VERSION_1_2;
++-
++-extern CL_API_ENTRY cl_program CL_API_CALL
++-clLinkProgram(cl_context           /* context */,
++-              cl_uint              /* num_devices */,
++-              const cl_device_id * /* device_list */,
++-              const char *         /* options */, 
++-              cl_uint              /* num_input_programs */,
++-              const cl_program *   /* input_programs */,
++-              void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
++-              void *               /* user_data */,
++-              cl_int *             /* errcode_ret */ ) CL_API_SUFFIX__VERSION_1_2;
++-
++-
++-extern CL_API_ENTRY cl_int CL_API_CALL
++-clUnloadPlatformCompiler(cl_platform_id /* platform */) CL_API_SUFFIX__VERSION_1_2;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetProgramInfo(cl_program         /* program */,
 +-                 cl_program_info    /* param_name */,
 +-                 size_t             /* param_value_size */,
 +-                 void *             /* param_value */,
 +-                 size_t *           /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetProgramBuildInfo(cl_program            /* program */,
 +-                      cl_device_id          /* device */,
 +-                      cl_program_build_info /* param_name */,
 +-                      size_t                /* param_value_size */,
 +-                      void *                /* param_value */,
 +-                      size_t *              /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-                            
 +-/* Kernel Object APIs */
 +-extern CL_API_ENTRY cl_kernel CL_API_CALL
 +-clCreateKernel(cl_program      /* program */,
 +-               const char *    /* kernel_name */,
 +-               cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clCreateKernelsInProgram(cl_program     /* program */,
 +-                         cl_uint        /* num_kernels */,
 +-                         cl_kernel *    /* kernels */,
 +-                         cl_uint *      /* num_kernels_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clRetainKernel(cl_kernel    /* kernel */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clReleaseKernel(cl_kernel   /* kernel */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clSetKernelArg(cl_kernel    /* kernel */,
 +-               cl_uint      /* arg_index */,
 +-               size_t       /* arg_size */,
 +-               const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetKernelInfo(cl_kernel       /* kernel */,
 +-                cl_kernel_info  /* param_name */,
 +-                size_t          /* param_value_size */,
 +-                void *          /* param_value */,
 +-                size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
++-clGetKernelArgInfo(cl_kernel       /* kernel */,
++-                   cl_uint         /* arg_indx */,
++-                   cl_kernel_arg_info  /* param_name */,
++-                   size_t          /* param_value_size */,
++-                   void *          /* param_value */,
++-                   size_t *        /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2;
++-
++-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetKernelWorkGroupInfo(cl_kernel                  /* kernel */,
 +-                         cl_device_id               /* device */,
 +-                         cl_kernel_work_group_info  /* param_name */,
 +-                         size_t                     /* param_value_size */,
 +-                         void *                     /* param_value */,
 +-                         size_t *                   /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
- -/* Event Object APIs  */
++-/* Event Object APIs */
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clWaitForEvents(cl_uint             /* num_events */,
 +-                const cl_event *    /* event_list */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetEventInfo(cl_event         /* event */,
 +-               cl_event_info    /* param_name */,
 +-               size_t           /* param_value_size */,
 +-               void *           /* param_value */,
 +-               size_t *         /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-                            
 +-extern CL_API_ENTRY cl_event CL_API_CALL
 +-clCreateUserEvent(cl_context    /* context */,
 +-                  cl_int *      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;               
 +-                            
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clRetainEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clReleaseEvent(cl_event /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clSetUserEventStatus(cl_event   /* event */,
 +-                     cl_int     /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
 +-                     
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clSetEventCallback( cl_event    /* event */,
 +-                    cl_int      /* command_exec_callback_type */,
 +-                    void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
 +-                    void *      /* user_data */) CL_API_SUFFIX__VERSION_1_1;
 +-
- -/* Profiling APIs  */
++-/* Profiling APIs */
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetEventProfilingInfo(cl_event            /* event */,
 +-                        cl_profiling_info   /* param_name */,
 +-                        size_t              /* param_value_size */,
 +-                        void *              /* param_value */,
 +-                        size_t *            /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-                                
 +-/* Flush and Finish APIs */
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clFlush(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clFinish(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-/* Enqueued Commands APIs */
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueReadBuffer(cl_command_queue    /* command_queue */,
 +-                    cl_mem              /* buffer */,
 +-                    cl_bool             /* blocking_read */,
 +-                    size_t              /* offset */,
- -                    size_t              /* cb */, 
++-                    size_t              /* size */, 
 +-                    void *              /* ptr */,
 +-                    cl_uint             /* num_events_in_wait_list */,
 +-                    const cl_event *    /* event_wait_list */,
 +-                    cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-                            
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueReadBufferRect(cl_command_queue    /* command_queue */,
 +-                        cl_mem              /* buffer */,
 +-                        cl_bool             /* blocking_read */,
- -                        const size_t *      /* buffer_origin */,
- -                        const size_t *      /* host_origin */, 
++-                        const size_t *      /* buffer_offset */,
++-                        const size_t *      /* host_offset */, 
 +-                        const size_t *      /* region */,
 +-                        size_t              /* buffer_row_pitch */,
 +-                        size_t              /* buffer_slice_pitch */,
 +-                        size_t              /* host_row_pitch */,
 +-                        size_t              /* host_slice_pitch */,                        
 +-                        void *              /* ptr */,
 +-                        cl_uint             /* num_events_in_wait_list */,
 +-                        const cl_event *    /* event_wait_list */,
 +-                        cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
 +-                            
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueWriteBuffer(cl_command_queue   /* command_queue */, 
 +-                     cl_mem             /* buffer */, 
 +-                     cl_bool            /* blocking_write */, 
 +-                     size_t             /* offset */, 
- -                     size_t             /* cb */, 
++-                     size_t             /* size */, 
 +-                     const void *       /* ptr */, 
 +-                     cl_uint            /* num_events_in_wait_list */, 
 +-                     const cl_event *   /* event_wait_list */, 
 +-                     cl_event *         /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-                            
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueWriteBufferRect(cl_command_queue    /* command_queue */,
 +-                         cl_mem              /* buffer */,
 +-                         cl_bool             /* blocking_write */,
- -                         const size_t *      /* buffer_origin */,
- -                         const size_t *      /* host_origin */, 
++-                         const size_t *      /* buffer_offset */,
++-                         const size_t *      /* host_offset */, 
 +-                         const size_t *      /* region */,
 +-                         size_t              /* buffer_row_pitch */,
 +-                         size_t              /* buffer_slice_pitch */,
 +-                         size_t              /* host_row_pitch */,
 +-                         size_t              /* host_slice_pitch */,                        
 +-                         const void *        /* ptr */,
 +-                         cl_uint             /* num_events_in_wait_list */,
 +-                         const cl_event *    /* event_wait_list */,
 +-                         cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
 +-                            
 +-extern CL_API_ENTRY cl_int CL_API_CALL
++-clEnqueueFillBuffer(cl_command_queue   /* command_queue */,
++-                    cl_mem             /* buffer */, 
++-                    const void *       /* pattern */, 
++-                    size_t             /* pattern_size */, 
++-                    size_t             /* offset */, 
++-                    size_t             /* size */, 
++-                    cl_uint            /* num_events_in_wait_list */, 
++-                    const cl_event *   /* event_wait_list */, 
++-                    cl_event *         /* event */) CL_API_SUFFIX__VERSION_1_2;
++-                            
++-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueCopyBuffer(cl_command_queue    /* command_queue */, 
 +-                    cl_mem              /* src_buffer */,
 +-                    cl_mem              /* dst_buffer */, 
 +-                    size_t              /* src_offset */,
 +-                    size_t              /* dst_offset */,
- -                    size_t              /* cb */, 
++-                    size_t              /* size */, 
 +-                    cl_uint             /* num_events_in_wait_list */,
 +-                    const cl_event *    /* event_wait_list */,
 +-                    cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-                            
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueCopyBufferRect(cl_command_queue    /* command_queue */, 
 +-                        cl_mem              /* src_buffer */,
 +-                        cl_mem              /* dst_buffer */, 
 +-                        const size_t *      /* src_origin */,
 +-                        const size_t *      /* dst_origin */,
 +-                        const size_t *      /* region */, 
 +-                        size_t              /* src_row_pitch */,
 +-                        size_t              /* src_slice_pitch */,
 +-                        size_t              /* dst_row_pitch */,
 +-                        size_t              /* dst_slice_pitch */,
 +-                        cl_uint             /* num_events_in_wait_list */,
 +-                        const cl_event *    /* event_wait_list */,
 +-                        cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
 +-                            
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueReadImage(cl_command_queue     /* command_queue */,
 +-                   cl_mem               /* image */,
 +-                   cl_bool              /* blocking_read */, 
 +-                   const size_t *       /* origin[3] */,
 +-                   const size_t *       /* region[3] */,
 +-                   size_t               /* row_pitch */,
 +-                   size_t               /* slice_pitch */, 
 +-                   void *               /* ptr */,
 +-                   cl_uint              /* num_events_in_wait_list */,
 +-                   const cl_event *     /* event_wait_list */,
 +-                   cl_event *           /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueWriteImage(cl_command_queue    /* command_queue */,
 +-                    cl_mem              /* image */,
 +-                    cl_bool             /* blocking_write */, 
 +-                    const size_t *      /* origin[3] */,
 +-                    const size_t *      /* region[3] */,
 +-                    size_t              /* input_row_pitch */,
 +-                    size_t              /* input_slice_pitch */, 
 +-                    const void *        /* ptr */,
 +-                    cl_uint             /* num_events_in_wait_list */,
 +-                    const cl_event *    /* event_wait_list */,
 +-                    cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
++-clEnqueueFillImage(cl_command_queue   /* command_queue */,
++-                   cl_mem             /* image */, 
++-                   const void *       /* fill_color */, 
++-                   const size_t *     /* origin[3] */, 
++-                   const size_t *     /* region[3] */, 
++-                   cl_uint            /* num_events_in_wait_list */, 
++-                   const cl_event *   /* event_wait_list */, 
++-                   cl_event *         /* event */) CL_API_SUFFIX__VERSION_1_2;
++-                            
++-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueCopyImage(cl_command_queue     /* command_queue */,
 +-                   cl_mem               /* src_image */,
 +-                   cl_mem               /* dst_image */, 
 +-                   const size_t *       /* src_origin[3] */,
 +-                   const size_t *       /* dst_origin[3] */,
 +-                   const size_t *       /* region[3] */, 
 +-                   cl_uint              /* num_events_in_wait_list */,
 +-                   const cl_event *     /* event_wait_list */,
 +-                   cl_event *           /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueCopyImageToBuffer(cl_command_queue /* command_queue */,
 +-                           cl_mem           /* src_image */,
 +-                           cl_mem           /* dst_buffer */, 
 +-                           const size_t *   /* src_origin[3] */,
 +-                           const size_t *   /* region[3] */, 
 +-                           size_t           /* dst_offset */,
 +-                           cl_uint          /* num_events_in_wait_list */,
 +-                           const cl_event * /* event_wait_list */,
 +-                           cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueCopyBufferToImage(cl_command_queue /* command_queue */,
 +-                           cl_mem           /* src_buffer */,
 +-                           cl_mem           /* dst_image */, 
 +-                           size_t           /* src_offset */,
 +-                           const size_t *   /* dst_origin[3] */,
 +-                           const size_t *   /* region[3] */, 
 +-                           cl_uint          /* num_events_in_wait_list */,
 +-                           const cl_event * /* event_wait_list */,
 +-                           cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY void * CL_API_CALL
 +-clEnqueueMapBuffer(cl_command_queue /* command_queue */,
 +-                   cl_mem           /* buffer */,
 +-                   cl_bool          /* blocking_map */, 
 +-                   cl_map_flags     /* map_flags */,
 +-                   size_t           /* offset */,
- -                   size_t           /* cb */,
++-                   size_t           /* size */,
 +-                   cl_uint          /* num_events_in_wait_list */,
 +-                   const cl_event * /* event_wait_list */,
 +-                   cl_event *       /* event */,
 +-                   cl_int *         /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY void * CL_API_CALL
 +-clEnqueueMapImage(cl_command_queue  /* command_queue */,
 +-                  cl_mem            /* image */, 
 +-                  cl_bool           /* blocking_map */, 
 +-                  cl_map_flags      /* map_flags */, 
 +-                  const size_t *    /* origin[3] */,
 +-                  const size_t *    /* region[3] */,
 +-                  size_t *          /* image_row_pitch */,
 +-                  size_t *          /* image_slice_pitch */,
 +-                  cl_uint           /* num_events_in_wait_list */,
 +-                  const cl_event *  /* event_wait_list */,
 +-                  cl_event *        /* event */,
 +-                  cl_int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
 +-                        cl_mem           /* memobj */,
 +-                        void *           /* mapped_ptr */,
 +-                        cl_uint          /* num_events_in_wait_list */,
 +-                        const cl_event *  /* event_wait_list */,
 +-                        cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
++-clEnqueueMigrateMemObjects(cl_command_queue       /* command_queue */,
++-                           cl_uint                /* num_mem_objects */,
++-                           const cl_mem *         /* mem_objects */,
++-                           cl_mem_migration_flags /* flags */,
++-                           cl_uint                /* num_events_in_wait_list */,
++-                           const cl_event *       /* event_wait_list */,
++-                           cl_event *             /* event */) CL_API_SUFFIX__VERSION_1_2;
++-
++-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
 +-                       cl_kernel        /* kernel */,
 +-                       cl_uint          /* work_dim */,
 +-                       const size_t *   /* global_work_offset */,
 +-                       const size_t *   /* global_work_size */,
 +-                       const size_t *   /* local_work_size */,
 +-                       cl_uint          /* num_events_in_wait_list */,
 +-                       const cl_event * /* event_wait_list */,
 +-                       cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueTask(cl_command_queue  /* command_queue */,
 +-              cl_kernel         /* kernel */,
 +-              cl_uint           /* num_events_in_wait_list */,
 +-              const cl_event *  /* event_wait_list */,
 +-              cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueNativeKernel(cl_command_queue  /* command_queue */,
- -					  void (*user_func)(void *), 
++-					  void (CL_CALLBACK * /*user_func*/)(void *), 
 +-                      void *            /* args */,
 +-                      size_t            /* cb_args */, 
 +-                      cl_uint           /* num_mem_objects */,
 +-                      const cl_mem *    /* mem_list */,
 +-                      const void **     /* args_mem_loc */,
 +-                      cl_uint           /* num_events_in_wait_list */,
 +-                      const cl_event *  /* event_wait_list */,
 +-                      cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
- -clEnqueueMarker(cl_command_queue    /* command_queue */,
- -                cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_0;
++-clEnqueueMarkerWithWaitList(cl_command_queue /* command_queue */,
++-                            cl_uint           /* num_events_in_wait_list */,
++-                            const cl_event *  /* event_wait_list */,
++-                            cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_2;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
- -clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
- -                       cl_uint          /* num_events */,
- -                       const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
++-clEnqueueBarrierWithWaitList(cl_command_queue /* command_queue */,
++-                             cl_uint           /* num_events_in_wait_list */,
++-                             const cl_event *  /* event_wait_list */,
++-                             cl_event *        /* event */) CL_API_SUFFIX__VERSION_1_2;
 +-
- -extern CL_API_ENTRY cl_int CL_API_CALL
- -clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-/* Extension function access
 +- *
 +- * Returns the extension function address for the given function name,
 +- * or NULL if a valid function can not be found.  The client must
 +- * check to make sure the address is not NULL, before using or 
 +- * calling the returned function address.
 +- */
- -extern CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
++-extern CL_API_ENTRY void * CL_API_CALL 
++-clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */,
++-                                         const char *   /* func_name */) CL_API_SUFFIX__VERSION_1_2;
++-    
++-
++-// Deprecated OpenCL 1.1 APIs
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
++-clCreateImage2D(cl_context              /* context */,
++-                cl_mem_flags            /* flags */,
++-                const cl_image_format * /* image_format */,
++-                size_t                  /* image_width */,
++-                size_t                  /* image_height */,
++-                size_t                  /* image_row_pitch */, 
++-                void *                  /* host_ptr */,
++-                cl_int *                /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++-    
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
++-clCreateImage3D(cl_context              /* context */,
++-                cl_mem_flags            /* flags */,
++-                const cl_image_format * /* image_format */,
++-                size_t                  /* image_width */, 
++-                size_t                  /* image_height */,
++-                size_t                  /* image_depth */, 
++-                size_t                  /* image_row_pitch */, 
++-                size_t                  /* image_slice_pitch */, 
++-                void *                  /* host_ptr */,
++-                cl_int *                /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++-    
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
++-clEnqueueMarker(cl_command_queue    /* command_queue */,
++-                cl_event *          /* event */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++-    
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
++-clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
++-                        cl_uint          /* num_events */,
++-                        const cl_event * /* event_list */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++-    
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
++-clEnqueueBarrier(cl_command_queue /* command_queue */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++-
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
++-clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++-    
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
++-clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
 +-
 +-#ifdef __cplusplus
 +-}
 +-#endif
 +-
 +-#endif  /* __OPENCL_CL_H */
 +-
 ++#include_next <CL/cl.h>
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/include/CL/cl_platform.h
- +++ beignet-0.0.0+git2013.04.01+d1b234c/include/CL/cl_platform.h
- @@ -1,1194 +1 @@
- -/* 
- - * Copyright © 2012 Intel Corporation
++Index: beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl_platform.h
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/include/CL/cl_platform.h	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl_platform.h	2013-04-15 18:25:01.036323041 +0200
++@@ -1,1254 +1 @@
++-/**********************************************************************************
++- * Copyright (c) 2008-2012 The Khronos Group Inc.
 +- *
- - * This library is free software; you can redistribute it and/or
- - * modify it under the terms of the GNU Lesser General Public
- - * License as published by the Free Software Foundation; either
- - * version 2 of the License, or (at your option) any later version.
++- * Permission is hereby granted, free of charge, to any person obtaining a
++- * copy of this software and/or associated documentation files (the
++- * "Materials"), to deal in the Materials without restriction, including
++- * without limitation the rights to use, copy, modify, merge, publish,
++- * distribute, sublicense, and/or sell copies of the Materials, and to
++- * permit persons to whom the Materials are furnished to do so, subject to
++- * the following conditions:
 +- *
- - * This library is distributed in the hope that it will be useful,
- - * but WITHOUT ANY WARRANTY; without even the implied warranty of
- - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- - * Lesser General Public License for more details.
++- * The above copyright notice and this permission notice shall be included
++- * in all copies or substantial portions of the Materials.
 +- *
- - * You should have received a copy of the GNU Lesser General Public
- - * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- - *
- - * Author: Benjamin Segovia <benjamin.segovia at intel.com>
- - */
++- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
++- **********************************************************************************/
 +-
 +-/* $Revision: 11803 $ on $Date: 2010-06-25 10:02:12 -0700 (Fri, 25 Jun 2010) $ */
 +-
 +-#ifndef __CL_PLATFORM_H
 +-#define __CL_PLATFORM_H
 +-
 +-#ifdef __APPLE__
 +-    /* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */
 +-    #include <AvailabilityMacros.h>
 +-#endif
 +-
 +-#ifdef __cplusplus
 +-extern "C" {
 +-#endif
 +-
 +-#if defined(_WIN32)
 +-    #define CL_API_ENTRY
 +-    #define CL_API_CALL     __stdcall
 +-    #define CL_CALLBACK     __stdcall
 +-#else
 +-    #define CL_API_ENTRY
 +-    #define CL_API_CALL
 +-    #define CL_CALLBACK
 +-#endif
 +-
 +-#ifdef __APPLE__
- -    #define CL_EXTENSION_WEAK_LINK                  __attribute__((weak_import))       
- -    #define CL_API_SUFFIX__VERSION_1_0              AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
- -    #define CL_EXT_SUFFIX__VERSION_1_0              CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
- -    #define CL_API_SUFFIX__VERSION_1_1              CL_EXTENSION_WEAK_LINK
- -    #define CL_EXT_SUFFIX__VERSION_1_1              CL_EXTENSION_WEAK_LINK
- -    #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
++-    #define CL_EXTENSION_WEAK_LINK       __attribute__((weak_import))
++-    #define CL_API_SUFFIX__VERSION_1_0                  AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
++-    #define CL_EXT_SUFFIX__VERSION_1_0                  CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
++-    #define CL_API_SUFFIX__VERSION_1_1                  AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
++-    #define GCL_API_SUFFIX__VERSION_1_1                 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
++-    #define CL_EXT_SUFFIX__VERSION_1_1                  CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
++-    #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED       CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
++-    
++-    #ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
++-        #define CL_API_SUFFIX__VERSION_1_2              AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
++-        #define GCL_API_SUFFIX__VERSION_1_2             AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
++-        #define CL_EXT_SUFFIX__VERSION_1_2              CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
++-        #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
++-        #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
++-    #else
++-        #warning  This path should never happen outside of internal operating system development.  AvailabilityMacros do not function correctly here!
++-        #define CL_API_SUFFIX__VERSION_1_2              AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
++-        #define GCL_API_SUFFIX__VERSION_1_2             AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
++-        #define CL_EXT_SUFFIX__VERSION_1_2              CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
++-        #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
++-    #endif
 +-#else
- -    #define CL_EXTENSION_WEAK_LINK                         
++-    #define CL_EXTENSION_WEAK_LINK  
 +-    #define CL_API_SUFFIX__VERSION_1_0
 +-    #define CL_EXT_SUFFIX__VERSION_1_0
 +-    #define CL_API_SUFFIX__VERSION_1_1
 +-    #define CL_EXT_SUFFIX__VERSION_1_1
- -    #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
++-    #define CL_API_SUFFIX__VERSION_1_2
++-    #define CL_EXT_SUFFIX__VERSION_1_2
++-    
++-    #ifdef __GNUC__
++-        #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
++-            #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
++-            #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED    
++-        #else
++-            #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED __attribute__((deprecated))
++-            #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED    
++-        #endif
++-    
++-        #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
++-            #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED    
++-            #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED    
++-        #else
++-            #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
++-            #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED    
++-        #endif
++-    #elif _WIN32
++-        #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
++-            #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED    
++-            #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED    
++-        #else
++-            #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED 
++-            #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED __declspec(deprecated)     
++-        #endif
++-    
++-        #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
++-            #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
++-            #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED    
++-        #else
++-            #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED 
++-            #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED __declspec(deprecated)     
++-        #endif
++-    #else
++-        #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
++-        #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
++-    
++-        #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
++-        #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
++-    #endif
 +-#endif
 +-
 +-#if (defined (_WIN32) && defined(_MSC_VER))
 +-
 +-/* scalar types  */
 +-typedef signed   __int8         cl_char;
 +-typedef unsigned __int8         cl_uchar;
 +-typedef signed   __int16        cl_short;
 +-typedef unsigned __int16        cl_ushort;
 +-typedef signed   __int32        cl_int;
 +-typedef unsigned __int32        cl_uint;
 +-typedef signed   __int64        cl_long;
 +-typedef unsigned __int64        cl_ulong;
 +-
 +-typedef unsigned __int16        cl_half;
 +-typedef float                   cl_float;
 +-typedef double                  cl_double;
 +-
 +-/* Macro names and corresponding values defined by OpenCL */
 +-#define CL_CHAR_BIT         8
 +-#define CL_SCHAR_MAX        127
 +-#define CL_SCHAR_MIN        (-127-1)
 +-#define CL_CHAR_MAX         CL_SCHAR_MAX
 +-#define CL_CHAR_MIN         CL_SCHAR_MIN
 +-#define CL_UCHAR_MAX        255
 +-#define CL_SHRT_MAX         32767
 +-#define CL_SHRT_MIN         (-32767-1)
 +-#define CL_USHRT_MAX        65535
 +-#define CL_INT_MAX          2147483647
 +-#define CL_INT_MIN          (-2147483647-1)
 +-#define CL_UINT_MAX         0xffffffffU
 +-#define CL_LONG_MAX         ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
 +-#define CL_LONG_MIN         ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
 +-#define CL_ULONG_MAX        ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
 +-
 +-#define CL_FLT_DIG          6
 +-#define CL_FLT_MANT_DIG     24
 +-#define CL_FLT_MAX_10_EXP   +38
 +-#define CL_FLT_MAX_EXP      +128
 +-#define CL_FLT_MIN_10_EXP   -37
 +-#define CL_FLT_MIN_EXP      -125
 +-#define CL_FLT_RADIX        2
 +-#define CL_FLT_MAX          340282346638528859811704183484516925440.0f
 +-#define CL_FLT_MIN          1.175494350822287507969e-38f
- -#define CL_FLT_EPSILON      MAKE_HEX_DOUBLE(0x1.0p-23f, 0x1L, -23)
++-#define CL_FLT_EPSILON      0x1.0p-23f
 +-
 +-#define CL_DBL_DIG          15
 +-#define CL_DBL_MANT_DIG     53
 +-#define CL_DBL_MAX_10_EXP   +308
 +-#define CL_DBL_MAX_EXP      +1024
 +-#define CL_DBL_MIN_10_EXP   -307
 +-#define CL_DBL_MIN_EXP      -1021
 +-#define CL_DBL_RADIX        2
 +-#define CL_DBL_MAX          179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
 +-#define CL_DBL_MIN          2.225073858507201383090e-308
 +-#define CL_DBL_EPSILON      2.220446049250313080847e-16
 +-
 +-#define  CL_M_E             2.718281828459045090796
 +-#define  CL_M_LOG2E         1.442695040888963387005
 +-#define  CL_M_LOG10E        0.434294481903251816668
 +-#define  CL_M_LN2           0.693147180559945286227
 +-#define  CL_M_LN10          2.302585092994045901094
 +-#define  CL_M_PI            3.141592653589793115998
 +-#define  CL_M_PI_2          1.570796326794896557999
 +-#define  CL_M_PI_4          0.785398163397448278999
 +-#define  CL_M_1_PI          0.318309886183790691216
 +-#define  CL_M_2_PI          0.636619772367581382433
 +-#define  CL_M_2_SQRTPI      1.128379167095512558561
 +-#define  CL_M_SQRT2         1.414213562373095145475
 +-#define  CL_M_SQRT1_2       0.707106781186547572737
 +-
 +-#define  CL_M_E_F           2.71828174591064f
 +-#define  CL_M_LOG2E_F       1.44269502162933f
 +-#define  CL_M_LOG10E_F      0.43429449200630f
 +-#define  CL_M_LN2_F         0.69314718246460f
 +-#define  CL_M_LN10_F        2.30258512496948f
 +-#define  CL_M_PI_F          3.14159274101257f
 +-#define  CL_M_PI_2_F        1.57079637050629f
 +-#define  CL_M_PI_4_F        0.78539818525314f
 +-#define  CL_M_1_PI_F        0.31830987334251f
 +-#define  CL_M_2_PI_F        0.63661974668503f
 +-#define  CL_M_2_SQRTPI_F    1.12837922573090f
 +-#define  CL_M_SQRT2_F       1.41421353816986f
 +-#define  CL_M_SQRT1_2_F     0.70710676908493f
 +-
 +-#define CL_NAN              (CL_INFINITY - CL_INFINITY)
 +-#define CL_HUGE_VALF        ((cl_float) 1e50)
 +-#define CL_HUGE_VAL         ((cl_double) 1e500)
 +-#define CL_MAXFLOAT         CL_FLT_MAX
 +-#define CL_INFINITY         CL_HUGE_VALF
 +-
 +-#else
 +-
 +-#include <stdint.h>
 +-
 +-/* scalar types  */
 +-typedef int8_t          cl_char;
 +-typedef uint8_t         cl_uchar;
 +-typedef int16_t         cl_short    __attribute__((aligned(2)));
 +-typedef uint16_t        cl_ushort   __attribute__((aligned(2)));
 +-typedef int32_t         cl_int      __attribute__((aligned(4)));
 +-typedef uint32_t        cl_uint     __attribute__((aligned(4)));
 +-typedef int64_t         cl_long     __attribute__((aligned(8)));
 +-typedef uint64_t        cl_ulong    __attribute__((aligned(8)));
 +-
 +-typedef uint16_t        cl_half     __attribute__((aligned(2)));
 +-typedef float           cl_float    __attribute__((aligned(4)));
 +-typedef double          cl_double   __attribute__((aligned(8)));
 +-
 +-/* Macro names and corresponding values defined by OpenCL */
 +-#define CL_CHAR_BIT         8
 +-#define CL_SCHAR_MAX        127
 +-#define CL_SCHAR_MIN        (-127-1)
 +-#define CL_CHAR_MAX         CL_SCHAR_MAX
 +-#define CL_CHAR_MIN         CL_SCHAR_MIN
 +-#define CL_UCHAR_MAX        255
 +-#define CL_SHRT_MAX         32767
 +-#define CL_SHRT_MIN         (-32767-1)
 +-#define CL_USHRT_MAX        65535
 +-#define CL_INT_MAX          2147483647
 +-#define CL_INT_MIN          (-2147483647-1)
 +-#define CL_UINT_MAX         0xffffffffU
 +-#define CL_LONG_MAX         ((cl_long) 0x7FFFFFFFFFFFFFFFLL)
 +-#define CL_LONG_MIN         ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL)
 +-#define CL_ULONG_MAX        ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL)
 +-
 +-#define CL_FLT_DIG          6
 +-#define CL_FLT_MANT_DIG     24
 +-#define CL_FLT_MAX_10_EXP   +38
 +-#define CL_FLT_MAX_EXP      +128
 +-#define CL_FLT_MIN_10_EXP   -37
 +-#define CL_FLT_MIN_EXP      -125
 +-#define CL_FLT_RADIX        2
 +-#define CL_FLT_MAX          0x1.fffffep127f
 +-#define CL_FLT_MIN          0x1.0p-126f
 +-#define CL_FLT_EPSILON      0x1.0p-23f
 +-
 +-#define CL_DBL_DIG          15
 +-#define CL_DBL_MANT_DIG     53
 +-#define CL_DBL_MAX_10_EXP   +308
 +-#define CL_DBL_MAX_EXP      +1024
 +-#define CL_DBL_MIN_10_EXP   -307
 +-#define CL_DBL_MIN_EXP      -1021
 +-#define CL_DBL_RADIX        2
 +-#define CL_DBL_MAX          0x1.fffffffffffffp1023
 +-#define CL_DBL_MIN          0x1.0p-1022
 +-#define CL_DBL_EPSILON      0x1.0p-52
 +-
 +-#define  CL_M_E             2.718281828459045090796
 +-#define  CL_M_LOG2E         1.442695040888963387005
 +-#define  CL_M_LOG10E        0.434294481903251816668
 +-#define  CL_M_LN2           0.693147180559945286227
 +-#define  CL_M_LN10          2.302585092994045901094
 +-#define  CL_M_PI            3.141592653589793115998
 +-#define  CL_M_PI_2          1.570796326794896557999
 +-#define  CL_M_PI_4          0.785398163397448278999
 +-#define  CL_M_1_PI          0.318309886183790691216
 +-#define  CL_M_2_PI          0.636619772367581382433
 +-#define  CL_M_2_SQRTPI      1.128379167095512558561
 +-#define  CL_M_SQRT2         1.414213562373095145475
 +-#define  CL_M_SQRT1_2       0.707106781186547572737
 +-
 +-#define  CL_M_E_F           2.71828174591064f
 +-#define  CL_M_LOG2E_F       1.44269502162933f
 +-#define  CL_M_LOG10E_F      0.43429449200630f
 +-#define  CL_M_LN2_F         0.69314718246460f
 +-#define  CL_M_LN10_F        2.30258512496948f
 +-#define  CL_M_PI_F          3.14159274101257f
 +-#define  CL_M_PI_2_F        1.57079637050629f
 +-#define  CL_M_PI_4_F        0.78539818525314f
 +-#define  CL_M_1_PI_F        0.31830987334251f
 +-#define  CL_M_2_PI_F        0.63661974668503f
 +-#define  CL_M_2_SQRTPI_F    1.12837922573090f
 +-#define  CL_M_SQRT2_F       1.41421353816986f
 +-#define  CL_M_SQRT1_2_F     0.70710676908493f
 +-
 +-#if defined( __GNUC__ )
 +-   #define CL_HUGE_VALF     __builtin_huge_valf()
 +-   #define CL_HUGE_VAL      __builtin_huge_val()
 +-   #define CL_NAN           __builtin_nanf( "" )
 +-#else
 +-   #define CL_HUGE_VALF     ((cl_float) 1e50)
 +-   #define CL_HUGE_VAL      ((cl_double) 1e500)
 +-   float nanf( const char * );
 +-   #define CL_NAN           nanf( "" )  
 +-#endif
 +-#define CL_MAXFLOAT         CL_FLT_MAX
 +-#define CL_INFINITY         CL_HUGE_VALF
 +-
 +-#endif
 +-
 +-#include <stddef.h>
 +-
- -/* Mirror types to GL types. Mirror types allow us to avoid deciding which headers to load based on whether we are using GL or GLES here. */
++-/* Mirror types to GL types. Mirror types allow us to avoid deciding which 87s to load based on whether we are using GL or GLES here. */
 +-typedef unsigned int cl_GLuint;
 +-typedef int          cl_GLint;
 +-typedef unsigned int cl_GLenum;
 +-
 +-/*
 +- * Vector types 
 +- *
 +- *  Note:   OpenCL requires that all types be naturally aligned. 
 +- *          This means that vector types must be naturally aligned.
 +- *          For example, a vector of four floats must be aligned to
 +- *          a 16 byte boundary (calculated as 4 * the natural 4-byte 
 +- *          alignment of the float).  The alignment qualifiers here
 +- *          will only function properly if your compiler supports them
 +- *          and if you don't actively work to defeat them.  For example,
 +- *          in order for a cl_float4 to be 16 byte aligned in a struct,
 +- *          the start of the struct must itself be 16-byte aligned. 
 +- *
 +- *          Maintaining proper alignment is the user's responsibility.
 +- */
 +-
 +-/* Define basic vector types */
 +-#if defined( __VEC__ )
 +-   #include <altivec.h>   /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
 +-   typedef vector unsigned char     __cl_uchar16;
 +-   typedef vector signed char       __cl_char16;
 +-   typedef vector unsigned short    __cl_ushort8;
 +-   typedef vector signed short      __cl_short8;
 +-   typedef vector unsigned int      __cl_uint4;
 +-   typedef vector signed int        __cl_int4;
 +-   typedef vector float             __cl_float4;
 +-   #define  __CL_UCHAR16__  1
 +-   #define  __CL_CHAR16__   1
 +-   #define  __CL_USHORT8__  1
 +-   #define  __CL_SHORT8__   1
 +-   #define  __CL_UINT4__    1
 +-   #define  __CL_INT4__     1
 +-   #define  __CL_FLOAT4__   1
 +-#endif
 +-
 +-#if defined( __SSE__ )
 +-    #if defined( __MINGW64__ )
 +-        #include <intrin.h>
 +-    #else
 +-        #include <xmmintrin.h>
 +-    #endif
 +-    #if defined( __GNUC__ )
 +-        typedef float __cl_float4   __attribute__((vector_size(16)));
 +-    #else
 +-        typedef __m128 __cl_float4;
 +-    #endif
 +-    #define __CL_FLOAT4__   1
 +-#endif
 +-
 +-#if defined( __SSE2__ )
 +-    #if defined( __MINGW64__ )
 +-        #include <intrin.h>
 +-    #else
 +-        #include <emmintrin.h>
 +-    #endif
 +-    #if defined( __GNUC__ )
 +-        typedef cl_uchar    __cl_uchar16    __attribute__((vector_size(16)));
 +-        typedef cl_char     __cl_char16     __attribute__((vector_size(16)));
 +-        typedef cl_ushort   __cl_ushort8    __attribute__((vector_size(16)));
 +-        typedef cl_short    __cl_short8     __attribute__((vector_size(16)));
 +-        typedef cl_uint     __cl_uint4      __attribute__((vector_size(16)));
 +-        typedef cl_int      __cl_int4       __attribute__((vector_size(16)));
 +-        typedef cl_ulong    __cl_ulong2     __attribute__((vector_size(16)));
 +-        typedef cl_long     __cl_long2      __attribute__((vector_size(16)));
 +-        typedef cl_double   __cl_double2    __attribute__((vector_size(16)));
 +-    #else
 +-        typedef __m128i __cl_uchar16;
 +-        typedef __m128i __cl_char16;
 +-        typedef __m128i __cl_ushort8;
 +-        typedef __m128i __cl_short8;
 +-        typedef __m128i __cl_uint4;
 +-        typedef __m128i __cl_int4;
 +-        typedef __m128i __cl_ulong2;
 +-        typedef __m128i __cl_long2;
 +-        typedef __m128d __cl_double2;
 +-    #endif
 +-    #define __CL_UCHAR16__  1
 +-    #define __CL_CHAR16__   1
 +-    #define __CL_USHORT8__  1
 +-    #define __CL_SHORT8__   1
 +-    #define __CL_INT4__     1
 +-    #define __CL_UINT4__    1
 +-    #define __CL_ULONG2__   1
 +-    #define __CL_LONG2__    1
 +-    #define __CL_DOUBLE2__  1
 +-#endif
 +-
 +-#if defined( __MMX__ )
 +-    #include <mmintrin.h>
 +-    #if defined( __GNUC__ )
 +-        typedef cl_uchar    __cl_uchar8     __attribute__((vector_size(8)));
 +-        typedef cl_char     __cl_char8      __attribute__((vector_size(8)));
 +-        typedef cl_ushort   __cl_ushort4    __attribute__((vector_size(8)));
 +-        typedef cl_short    __cl_short4     __attribute__((vector_size(8)));
 +-        typedef cl_uint     __cl_uint2      __attribute__((vector_size(8)));
 +-        typedef cl_int      __cl_int2       __attribute__((vector_size(8)));
 +-        typedef cl_ulong    __cl_ulong1     __attribute__((vector_size(8)));
 +-        typedef cl_long     __cl_long1      __attribute__((vector_size(8)));
 +-        typedef cl_float    __cl_float2     __attribute__((vector_size(8)));
 +-    #else
 +-        typedef __m64       __cl_uchar8;
 +-        typedef __m64       __cl_char8;
 +-        typedef __m64       __cl_ushort4;
 +-        typedef __m64       __cl_short4;
 +-        typedef __m64       __cl_uint2;
 +-        typedef __m64       __cl_int2;
 +-        typedef __m64       __cl_ulong1;
 +-        typedef __m64       __cl_long1;
 +-        typedef __m64       __cl_float2;
 +-    #endif
 +-    #define __CL_UCHAR8__   1
 +-    #define __CL_CHAR8__    1
 +-    #define __CL_USHORT4__  1
 +-    #define __CL_SHORT4__   1
 +-    #define __CL_INT2__     1
 +-    #define __CL_UINT2__    1
 +-    #define __CL_ULONG1__   1
 +-    #define __CL_LONG1__    1
 +-    #define __CL_FLOAT2__   1
 +-#endif
 +-
 +-#if defined( __AVX__ )
 +-    #if defined( __MINGW64__ )
 +-        #include <intrin.h>
 +-    #else
 +-        #include <immintrin.h> 
 +-    #endif
 +-    #if defined( __GNUC__ )
 +-        typedef cl_float    __cl_float8     __attribute__((vector_size(32)));
 +-        typedef cl_double   __cl_double4    __attribute__((vector_size(32)));
 +-    #else
 +-        typedef __m256      __cl_float8;
 +-        typedef __m256d     __cl_double4;
 +-    #endif
 +-    #define __CL_FLOAT8__   1
 +-    #define __CL_DOUBLE4__  1
 +-#endif
 +-
 +-/* Define alignment keys */
 +-#if defined( __GNUC__ )
 +-    #define CL_ALIGNED(_x)          __attribute__ ((aligned(_x)))
 +-#elif defined( _WIN32) && (_MSC_VER)
 +-    /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements     */
 +-    /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx                                                 */
 +-    /* #include <crtdefs.h>                                                                                             */
 +-    /* #define CL_ALIGNED(_x)          _CRT_ALIGN(_x)                                                                   */
 +-    #define CL_ALIGNED(_x)
 +-#else
 +-   #warning  Need to implement some method to align data here
 +-   #define  CL_ALIGNED(_x)
 +-#endif
 +-
 +-/* Indicate whether .xyzw, .s0123 and .hi.lo are supported */
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-    /* .xyzw and .s0123...{f|F} are supported */
 +-    #define CL_HAS_NAMED_VECTOR_FIELDS 1
 +-    /* .hi and .lo are supported */
 +-    #define CL_HAS_HI_LO_VECTOR_FIELDS 1
 +-#endif
 +-
 +-/* Define cl_vector types */
 +-
 +-/* ---- cl_charn ---- */
 +-typedef union
 +-{
 +-    cl_char  CL_ALIGNED(2) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_char  x, y; };
 +-   __extension__ struct{ cl_char  s0, s1; };
 +-   __extension__ struct{ cl_char  lo, hi; };
 +-#endif
 +-#if defined( __CL_CHAR2__) 
 +-    __cl_char2     v2;
 +-#endif
 +-}cl_char2;
 +-
 +-typedef union
 +-{
 +-    cl_char  CL_ALIGNED(4) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_char  x, y, z, w; };
 +-   __extension__ struct{ cl_char  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_char2 lo, hi; };
 +-#endif
 +-#if defined( __CL_CHAR2__) 
 +-    __cl_char2     v2[2];
 +-#endif
 +-#if defined( __CL_CHAR4__) 
 +-    __cl_char4     v4;
 +-#endif
 +-}cl_char4;
 +-
 +-/* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */
 +-typedef  cl_char4  cl_char3;
 +-
 +-typedef union
 +-{
 +-    cl_char   CL_ALIGNED(8) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_char  x, y, z, w; };
 +-   __extension__ struct{ cl_char  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_char4 lo, hi; };
 +-#endif
 +-#if defined( __CL_CHAR2__) 
 +-    __cl_char2     v2[4];
 +-#endif
 +-#if defined( __CL_CHAR4__) 
 +-    __cl_char4     v4[2];
 +-#endif
 +-#if defined( __CL_CHAR8__ )
 +-    __cl_char8     v8;
 +-#endif
 +-}cl_char8;
 +-
 +-typedef union
 +-{
 +-    cl_char  CL_ALIGNED(16) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_char  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_char  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_char8 lo, hi; };
 +-#endif
 +-#if defined( __CL_CHAR2__) 
 +-    __cl_char2     v2[8];
 +-#endif
 +-#if defined( __CL_CHAR4__) 
 +-    __cl_char4     v4[4];
 +-#endif
 +-#if defined( __CL_CHAR8__ )
 +-    __cl_char8     v8[2];
 +-#endif
 +-#if defined( __CL_CHAR16__ )
 +-    __cl_char16    v16;
 +-#endif
 +-}cl_char16;
 +-
 +-
 +-/* ---- cl_ucharn ---- */
 +-typedef union
 +-{
 +-    cl_uchar  CL_ALIGNED(2) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_uchar  x, y; };
 +-   __extension__ struct{ cl_uchar  s0, s1; };
 +-   __extension__ struct{ cl_uchar  lo, hi; };
 +-#endif
 +-#if defined( __cl_uchar2__) 
 +-    __cl_uchar2     v2;
 +-#endif
 +-}cl_uchar2;
 +-
 +-typedef union
 +-{
 +-    cl_uchar  CL_ALIGNED(4) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_uchar  x, y, z, w; };
 +-   __extension__ struct{ cl_uchar  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_uchar2 lo, hi; };
 +-#endif
 +-#if defined( __CL_UCHAR2__) 
 +-    __cl_uchar2     v2[2];
 +-#endif
 +-#if defined( __CL_UCHAR4__) 
 +-    __cl_uchar4     v4;
 +-#endif
 +-}cl_uchar4;
 +-
 +-/* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */
 +-typedef  cl_uchar4  cl_uchar3;
 +-
 +-typedef union
 +-{
 +-    cl_uchar   CL_ALIGNED(8) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_uchar  x, y, z, w; };
 +-   __extension__ struct{ cl_uchar  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_uchar4 lo, hi; };
 +-#endif
 +-#if defined( __CL_UCHAR2__) 
 +-    __cl_uchar2     v2[4];
 +-#endif
 +-#if defined( __CL_UCHAR4__) 
 +-    __cl_uchar4     v4[2];
 +-#endif
 +-#if defined( __CL_UCHAR8__ )
 +-    __cl_uchar8     v8;
 +-#endif
 +-}cl_uchar8;
 +-
 +-typedef union
 +-{
 +-    cl_uchar  CL_ALIGNED(16) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_uchar  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_uchar  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_uchar8 lo, hi; };
 +-#endif
 +-#if defined( __CL_UCHAR2__) 
 +-    __cl_uchar2     v2[8];
 +-#endif
 +-#if defined( __CL_UCHAR4__) 
 +-    __cl_uchar4     v4[4];
 +-#endif
 +-#if defined( __CL_UCHAR8__ )
 +-    __cl_uchar8     v8[2];
 +-#endif
 +-#if defined( __CL_UCHAR16__ )
 +-    __cl_uchar16    v16;
 +-#endif
 +-}cl_uchar16;
 +-
 +-
 +-/* ---- cl_shortn ---- */
 +-typedef union
 +-{
 +-    cl_short  CL_ALIGNED(4) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_short  x, y; };
 +-   __extension__ struct{ cl_short  s0, s1; };
 +-   __extension__ struct{ cl_short  lo, hi; };
 +-#endif
 +-#if defined( __CL_SHORT2__) 
 +-    __cl_short2     v2;
 +-#endif
 +-}cl_short2;
 +-
 +-typedef union
 +-{
 +-    cl_short  CL_ALIGNED(8) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_short  x, y, z, w; };
 +-   __extension__ struct{ cl_short  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_short2 lo, hi; };
 +-#endif
 +-#if defined( __CL_SHORT2__) 
 +-    __cl_short2     v2[2];
 +-#endif
 +-#if defined( __CL_SHORT4__) 
 +-    __cl_short4     v4;
 +-#endif
 +-}cl_short4;
 +-
 +-/* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */
 +-typedef  cl_short4  cl_short3;
 +-
 +-typedef union
 +-{
 +-    cl_short   CL_ALIGNED(16) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_short  x, y, z, w; };
 +-   __extension__ struct{ cl_short  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_short4 lo, hi; };
 +-#endif
 +-#if defined( __CL_SHORT2__) 
 +-    __cl_short2     v2[4];
 +-#endif
 +-#if defined( __CL_SHORT4__) 
 +-    __cl_short4     v4[2];
 +-#endif
 +-#if defined( __CL_SHORT8__ )
 +-    __cl_short8     v8;
 +-#endif
 +-}cl_short8;
 +-
 +-typedef union
 +-{
 +-    cl_short  CL_ALIGNED(32) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_short  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_short  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_short8 lo, hi; };
 +-#endif
 +-#if defined( __CL_SHORT2__) 
 +-    __cl_short2     v2[8];
 +-#endif
 +-#if defined( __CL_SHORT4__) 
 +-    __cl_short4     v4[4];
 +-#endif
 +-#if defined( __CL_SHORT8__ )
 +-    __cl_short8     v8[2];
 +-#endif
 +-#if defined( __CL_SHORT16__ )
 +-    __cl_short16    v16;
 +-#endif
 +-}cl_short16;
 +-
 +-
 +-/* ---- cl_ushortn ---- */
 +-typedef union
 +-{
 +-    cl_ushort  CL_ALIGNED(4) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_ushort  x, y; };
 +-   __extension__ struct{ cl_ushort  s0, s1; };
 +-   __extension__ struct{ cl_ushort  lo, hi; };
 +-#endif
 +-#if defined( __CL_USHORT2__) 
 +-    __cl_ushort2     v2;
 +-#endif
 +-}cl_ushort2;
 +-
 +-typedef union
 +-{
 +-    cl_ushort  CL_ALIGNED(8) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_ushort  x, y, z, w; };
 +-   __extension__ struct{ cl_ushort  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_ushort2 lo, hi; };
 +-#endif
 +-#if defined( __CL_USHORT2__) 
 +-    __cl_ushort2     v2[2];
 +-#endif
 +-#if defined( __CL_USHORT4__) 
 +-    __cl_ushort4     v4;
 +-#endif
 +-}cl_ushort4;
 +-
 +-/* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */
 +-typedef  cl_ushort4  cl_ushort3;
 +-
 +-typedef union
 +-{
 +-    cl_ushort   CL_ALIGNED(16) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_ushort  x, y, z, w; };
 +-   __extension__ struct{ cl_ushort  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_ushort4 lo, hi; };
 +-#endif
 +-#if defined( __CL_USHORT2__) 
 +-    __cl_ushort2     v2[4];
 +-#endif
 +-#if defined( __CL_USHORT4__) 
 +-    __cl_ushort4     v4[2];
 +-#endif
 +-#if defined( __CL_USHORT8__ )
 +-    __cl_ushort8     v8;
 +-#endif
 +-}cl_ushort8;
 +-
 +-typedef union
 +-{
 +-    cl_ushort  CL_ALIGNED(32) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_ushort  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_ushort  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_ushort8 lo, hi; };
 +-#endif
 +-#if defined( __CL_USHORT2__) 
 +-    __cl_ushort2     v2[8];
 +-#endif
 +-#if defined( __CL_USHORT4__) 
 +-    __cl_ushort4     v4[4];
 +-#endif
 +-#if defined( __CL_USHORT8__ )
 +-    __cl_ushort8     v8[2];
 +-#endif
 +-#if defined( __CL_USHORT16__ )
 +-    __cl_ushort16    v16;
 +-#endif
 +-}cl_ushort16;
 +-
 +-/* ---- cl_intn ---- */
 +-typedef union
 +-{
 +-    cl_int  CL_ALIGNED(8) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_int  x, y; };
 +-   __extension__ struct{ cl_int  s0, s1; };
 +-   __extension__ struct{ cl_int  lo, hi; };
 +-#endif
 +-#if defined( __CL_INT2__) 
 +-    __cl_int2     v2;
 +-#endif
 +-}cl_int2;
 +-
 +-typedef union
 +-{
 +-    cl_int  CL_ALIGNED(16) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_int  x, y, z, w; };
 +-   __extension__ struct{ cl_int  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_int2 lo, hi; };
 +-#endif
 +-#if defined( __CL_INT2__) 
 +-    __cl_int2     v2[2];
 +-#endif
 +-#if defined( __CL_INT4__) 
 +-    __cl_int4     v4;
 +-#endif
 +-}cl_int4;
 +-
 +-/* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */
 +-typedef  cl_int4  cl_int3;
 +-
 +-typedef union
 +-{
 +-    cl_int   CL_ALIGNED(32) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_int  x, y, z, w; };
 +-   __extension__ struct{ cl_int  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_int4 lo, hi; };
 +-#endif
 +-#if defined( __CL_INT2__) 
 +-    __cl_int2     v2[4];
 +-#endif
 +-#if defined( __CL_INT4__) 
 +-    __cl_int4     v4[2];
 +-#endif
 +-#if defined( __CL_INT8__ )
 +-    __cl_int8     v8;
 +-#endif
 +-}cl_int8;
 +-
 +-typedef union
 +-{
 +-    cl_int  CL_ALIGNED(64) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_int  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_int  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_int8 lo, hi; };
 +-#endif
 +-#if defined( __CL_INT2__) 
 +-    __cl_int2     v2[8];
 +-#endif
 +-#if defined( __CL_INT4__) 
 +-    __cl_int4     v4[4];
 +-#endif
 +-#if defined( __CL_INT8__ )
 +-    __cl_int8     v8[2];
 +-#endif
 +-#if defined( __CL_INT16__ )
 +-    __cl_int16    v16;
 +-#endif
 +-}cl_int16;
 +-
 +-
 +-/* ---- cl_uintn ---- */
 +-typedef union
 +-{
 +-    cl_uint  CL_ALIGNED(8) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_uint  x, y; };
 +-   __extension__ struct{ cl_uint  s0, s1; };
 +-   __extension__ struct{ cl_uint  lo, hi; };
 +-#endif
 +-#if defined( __CL_UINT2__) 
 +-    __cl_uint2     v2;
 +-#endif
 +-}cl_uint2;
 +-
 +-typedef union
 +-{
 +-    cl_uint  CL_ALIGNED(16) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_uint  x, y, z, w; };
 +-   __extension__ struct{ cl_uint  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_uint2 lo, hi; };
 +-#endif
 +-#if defined( __CL_UINT2__) 
 +-    __cl_uint2     v2[2];
 +-#endif
 +-#if defined( __CL_UINT4__) 
 +-    __cl_uint4     v4;
 +-#endif
 +-}cl_uint4;
 +-
 +-/* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */
 +-typedef  cl_uint4  cl_uint3;
 +-
 +-typedef union
 +-{
 +-    cl_uint   CL_ALIGNED(32) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_uint  x, y, z, w; };
 +-   __extension__ struct{ cl_uint  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_uint4 lo, hi; };
 +-#endif
 +-#if defined( __CL_UINT2__) 
 +-    __cl_uint2     v2[4];
 +-#endif
 +-#if defined( __CL_UINT4__) 
 +-    __cl_uint4     v4[2];
 +-#endif
 +-#if defined( __CL_UINT8__ )
 +-    __cl_uint8     v8;
 +-#endif
 +-}cl_uint8;
 +-
 +-typedef union
 +-{
 +-    cl_uint  CL_ALIGNED(64) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_uint  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_uint  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_uint8 lo, hi; };
 +-#endif
 +-#if defined( __CL_UINT2__) 
 +-    __cl_uint2     v2[8];
 +-#endif
 +-#if defined( __CL_UINT4__) 
 +-    __cl_uint4     v4[4];
 +-#endif
 +-#if defined( __CL_UINT8__ )
 +-    __cl_uint8     v8[2];
 +-#endif
 +-#if defined( __CL_UINT16__ )
 +-    __cl_uint16    v16;
 +-#endif
 +-}cl_uint16;
 +-
 +-/* ---- cl_longn ---- */
 +-typedef union
 +-{
 +-    cl_long  CL_ALIGNED(16) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_long  x, y; };
 +-   __extension__ struct{ cl_long  s0, s1; };
 +-   __extension__ struct{ cl_long  lo, hi; };
 +-#endif
 +-#if defined( __CL_LONG2__) 
 +-    __cl_long2     v2;
 +-#endif
 +-}cl_long2;
 +-
 +-typedef union
 +-{
 +-    cl_long  CL_ALIGNED(32) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_long  x, y, z, w; };
 +-   __extension__ struct{ cl_long  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_long2 lo, hi; };
 +-#endif
 +-#if defined( __CL_LONG2__) 
 +-    __cl_long2     v2[2];
 +-#endif
 +-#if defined( __CL_LONG4__) 
 +-    __cl_long4     v4;
 +-#endif
 +-}cl_long4;
 +-
 +-/* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */
 +-typedef  cl_long4  cl_long3;
 +-
 +-typedef union
 +-{
 +-    cl_long   CL_ALIGNED(64) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_long  x, y, z, w; };
 +-   __extension__ struct{ cl_long  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_long4 lo, hi; };
 +-#endif
 +-#if defined( __CL_LONG2__) 
 +-    __cl_long2     v2[4];
 +-#endif
 +-#if defined( __CL_LONG4__) 
 +-    __cl_long4     v4[2];
 +-#endif
 +-#if defined( __CL_LONG8__ )
 +-    __cl_long8     v8;
 +-#endif
 +-}cl_long8;
 +-
 +-typedef union
 +-{
 +-    cl_long  CL_ALIGNED(128) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_long  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_long  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_long8 lo, hi; };
 +-#endif
 +-#if defined( __CL_LONG2__) 
 +-    __cl_long2     v2[8];
 +-#endif
 +-#if defined( __CL_LONG4__) 
 +-    __cl_long4     v4[4];
 +-#endif
 +-#if defined( __CL_LONG8__ )
 +-    __cl_long8     v8[2];
 +-#endif
 +-#if defined( __CL_LONG16__ )
 +-    __cl_long16    v16;
 +-#endif
 +-}cl_long16;
 +-
 +-
 +-/* ---- cl_ulongn ---- */
 +-typedef union
 +-{
 +-    cl_ulong  CL_ALIGNED(16) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_ulong  x, y; };
 +-   __extension__ struct{ cl_ulong  s0, s1; };
 +-   __extension__ struct{ cl_ulong  lo, hi; };
 +-#endif
 +-#if defined( __CL_ULONG2__) 
 +-    __cl_ulong2     v2;
 +-#endif
 +-}cl_ulong2;
 +-
 +-typedef union
 +-{
 +-    cl_ulong  CL_ALIGNED(32) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_ulong  x, y, z, w; };
 +-   __extension__ struct{ cl_ulong  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_ulong2 lo, hi; };
 +-#endif
 +-#if defined( __CL_ULONG2__) 
 +-    __cl_ulong2     v2[2];
 +-#endif
 +-#if defined( __CL_ULONG4__) 
 +-    __cl_ulong4     v4;
 +-#endif
 +-}cl_ulong4;
 +-
 +-/* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */
 +-typedef  cl_ulong4  cl_ulong3;
 +-
 +-typedef union
 +-{
 +-    cl_ulong   CL_ALIGNED(64) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_ulong  x, y, z, w; };
 +-   __extension__ struct{ cl_ulong  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_ulong4 lo, hi; };
 +-#endif
 +-#if defined( __CL_ULONG2__) 
 +-    __cl_ulong2     v2[4];
 +-#endif
 +-#if defined( __CL_ULONG4__) 
 +-    __cl_ulong4     v4[2];
 +-#endif
 +-#if defined( __CL_ULONG8__ )
 +-    __cl_ulong8     v8;
 +-#endif
 +-}cl_ulong8;
 +-
 +-typedef union
 +-{
 +-    cl_ulong  CL_ALIGNED(128) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_ulong  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_ulong  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_ulong8 lo, hi; };
 +-#endif
 +-#if defined( __CL_ULONG2__) 
 +-    __cl_ulong2     v2[8];
 +-#endif
 +-#if defined( __CL_ULONG4__) 
 +-    __cl_ulong4     v4[4];
 +-#endif
 +-#if defined( __CL_ULONG8__ )
 +-    __cl_ulong8     v8[2];
 +-#endif
 +-#if defined( __CL_ULONG16__ )
 +-    __cl_ulong16    v16;
 +-#endif
 +-}cl_ulong16;
 +-
 +-
 +-/* --- cl_floatn ---- */
 +-
 +-typedef union
 +-{
 +-    cl_float  CL_ALIGNED(8) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_float  x, y; };
 +-   __extension__ struct{ cl_float  s0, s1; };
 +-   __extension__ struct{ cl_float  lo, hi; };
 +-#endif
 +-#if defined( __CL_FLOAT2__) 
 +-    __cl_float2     v2;
 +-#endif
 +-}cl_float2;
 +-
 +-typedef union
 +-{
 +-    cl_float  CL_ALIGNED(16) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_float   x, y, z, w; };
 +-   __extension__ struct{ cl_float   s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_float2  lo, hi; };
 +-#endif
 +-#if defined( __CL_FLOAT2__) 
 +-    __cl_float2     v2[2];
 +-#endif
 +-#if defined( __CL_FLOAT4__) 
 +-    __cl_float4     v4;
 +-#endif
 +-}cl_float4;
 +-
 +-/* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */
 +-typedef  cl_float4  cl_float3;
 +-
 +-typedef union
 +-{
 +-    cl_float   CL_ALIGNED(32) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_float   x, y, z, w; };
 +-   __extension__ struct{ cl_float   s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_float4  lo, hi; };
 +-#endif
 +-#if defined( __CL_FLOAT2__) 
 +-    __cl_float2     v2[4];
 +-#endif
 +-#if defined( __CL_FLOAT4__) 
 +-    __cl_float4     v4[2];
 +-#endif
 +-#if defined( __CL_FLOAT8__ )
 +-    __cl_float8     v8;
 +-#endif
 +-}cl_float8;
 +-
 +-typedef union
 +-{
 +-    cl_float  CL_ALIGNED(64) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_float  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_float  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_float8 lo, hi; };
 +-#endif
 +-#if defined( __CL_FLOAT2__) 
 +-    __cl_float2     v2[8];
 +-#endif
 +-#if defined( __CL_FLOAT4__) 
 +-    __cl_float4     v4[4];
 +-#endif
 +-#if defined( __CL_FLOAT8__ )
 +-    __cl_float8     v8[2];
 +-#endif
 +-#if defined( __CL_FLOAT16__ )
 +-    __cl_float16    v16;
 +-#endif
 +-}cl_float16;
 +-
 +-/* --- cl_doublen ---- */
 +-
 +-typedef union
 +-{
 +-    cl_double  CL_ALIGNED(16) s[2];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_double  x, y; };
 +-   __extension__ struct{ cl_double s0, s1; };
 +-   __extension__ struct{ cl_double lo, hi; };
 +-#endif
 +-#if defined( __CL_DOUBLE2__) 
 +-    __cl_double2     v2;
 +-#endif
 +-}cl_double2;
 +-
 +-typedef union
 +-{
 +-    cl_double  CL_ALIGNED(32) s[4];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_double  x, y, z, w; };
 +-   __extension__ struct{ cl_double  s0, s1, s2, s3; };
 +-   __extension__ struct{ cl_double2 lo, hi; };
 +-#endif
 +-#if defined( __CL_DOUBLE2__) 
 +-    __cl_double2     v2[2];
 +-#endif
 +-#if defined( __CL_DOUBLE4__) 
 +-    __cl_double4     v4;
 +-#endif
 +-}cl_double4;
 +-
 +-/* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */
 +-typedef  cl_double4  cl_double3;
 +-
 +-typedef union
 +-{
 +-    cl_double   CL_ALIGNED(64) s[8];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_double  x, y, z, w; };
 +-   __extension__ struct{ cl_double  s0, s1, s2, s3, s4, s5, s6, s7; };
 +-   __extension__ struct{ cl_double4 lo, hi; };
 +-#endif
 +-#if defined( __CL_DOUBLE2__) 
 +-    __cl_double2     v2[4];
 +-#endif
 +-#if defined( __CL_DOUBLE4__) 
 +-    __cl_double4     v4[2];
 +-#endif
 +-#if defined( __CL_DOUBLE8__ )
 +-    __cl_double8     v8;
 +-#endif
 +-}cl_double8;
 +-
 +-typedef union
 +-{
 +-    cl_double  CL_ALIGNED(128) s[16];
 +-#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
 +-   __extension__ struct{ cl_double  x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
 +-   __extension__ struct{ cl_double  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
 +-   __extension__ struct{ cl_double8 lo, hi; };
 +-#endif
 +-#if defined( __CL_DOUBLE2__) 
 +-    __cl_double2     v2[8];
 +-#endif
 +-#if defined( __CL_DOUBLE4__) 
 +-    __cl_double4     v4[4];
 +-#endif
 +-#if defined( __CL_DOUBLE8__ )
 +-    __cl_double8     v8[2];
 +-#endif
 +-#if defined( __CL_DOUBLE16__ )
 +-    __cl_double16    v16;
 +-#endif
 +-}cl_double16;
 +-
 +-/* Macro to facilitate debugging 
 +- * Usage:
 +- *   Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source. 
- - *   The first line ends with:   CL_PROGRAM_STRING_BEGIN \"
++- *   The first line ends with:   CL_PROGRAM_STRING_DEBUG_INFO \"
 +- *   Each line thereafter of OpenCL C source must end with: \n\
 +- *   The last line ends in ";
 +- *
 +- *   Example:
 +- *
- - *   const char *my_program = CL_PROGRAM_STRING_BEGIN "\
++- *   const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\
 +- *   kernel void foo( int a, float * b )             \n\
 +- *   {                                               \n\
 +- *      // my comment                                \n\
 +- *      *b[ get_global_id(0)] = a;                   \n\
 +- *   }                                               \n\
 +- *   ";
 +- *
 +- * This should correctly set up the line, (column) and file information for your source 
 +- * string so you can do source level debugging.
 +- */
 +-#define  __CL_STRINGIFY( _x )               # _x
 +-#define  _CL_STRINGIFY( _x )                __CL_STRINGIFY( _x )
 +-#define  CL_PROGRAM_STRING_DEBUG_INFO       "#line "  _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n" 
 +-  
 +-#ifdef __cplusplus
 +-}
 +-#endif
 +-
 +-#endif  /* __CL_PLATFORM_H  */
 ++#include_next <CL/cl_platform.h>
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/include/CL/cl_gl.h
- +++ beignet-0.0.0+git2013.04.01+d1b234c/include/CL/cl_gl.h
- @@ -1,151 +1 @@
- -/* 
- - * Copyright © 2012 Intel Corporation
- - *
- - * This library is free software; you can redistribute it and/or
- - * modify it under the terms of the GNU Lesser General Public
- - * License as published by the Free Software Foundation; either
- - * version 2 of the License, or (at your option) any later version.
++Index: beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl_gl.h
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/include/CL/cl_gl.h	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/include/CL/cl_gl.h	2013-04-15 18:25:01.036323041 +0200
++@@ -1,161 +1 @@
++-/**********************************************************************************
++- * Copyright (c) 2008 - 2012 The Khronos Group Inc.
 +- *
- - * This library is distributed in the hope that it will be useful,
- - * but WITHOUT ANY WARRANTY; without even the implied warranty of
- - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- - * Lesser General Public License for more details.
++- * Permission is hereby granted, free of charge, to any person obtaining a
++- * copy of this software and/or associated documentation files (the
++- * "Materials"), to deal in the Materials without restriction, including
++- * without limitation the rights to use, copy, modify, merge, publish,
++- * distribute, sublicense, and/or sell copies of the Materials, and to
++- * permit persons to whom the Materials are furnished to do so, subject to
++- * the following conditions:
 +- *
- - * You should have received a copy of the GNU Lesser General Public
- - * License along with this library. If not, see <http://www.gnu.org/licenses/>.
++- * The above copyright notice and this permission notice shall be included
++- * in all copies or substantial portions of the Materials.
 +- *
- - * Author: Benjamin Segovia <benjamin.segovia at intel.com>
- - */
- -
- -/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
- -
- -/*
- - * cl_gl.h contains Khronos-approved (KHR) OpenCL extensions which have
- - * OpenGL dependencies. The application is responsible for #including
- - * OpenGL or OpenGL ES headers before #including cl_gl.h.
- - */
++- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
++- **********************************************************************************/
 +-
 +-#ifndef __OPENCL_CL_GL_H
 +-#define __OPENCL_CL_GL_H
 +-
 +-#ifdef __APPLE__
 +-#include <OpenCL/cl.h>
- -#include <OpenGL/CGLDevice.h>
 +-#else
 +-#include <CL/cl.h>
 +-#endif	
 +-
 +-#ifdef __cplusplus
 +-extern "C" {
 +-#endif
 +-
 +-typedef cl_uint     cl_gl_object_type;
 +-typedef cl_uint     cl_gl_texture_info;
 +-typedef cl_uint     cl_gl_platform_info;
 +-typedef struct __GLsync *cl_GLsync;
 +-
- -/* cl_gl_object_type */
- -#define CL_GL_OBJECT_BUFFER             0x2000
- -#define CL_GL_OBJECT_TEXTURE2D          0x2001
- -#define CL_GL_OBJECT_TEXTURE3D          0x2002
- -#define CL_GL_OBJECT_RENDERBUFFER       0x2003
++-/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken           */
++-#define CL_GL_OBJECT_BUFFER                     0x2000
++-#define CL_GL_OBJECT_TEXTURE2D                  0x2001
++-#define CL_GL_OBJECT_TEXTURE3D                  0x2002
++-#define CL_GL_OBJECT_RENDERBUFFER               0x2003
++-#define CL_GL_OBJECT_TEXTURE2D_ARRAY            0x200E
++-#define CL_GL_OBJECT_TEXTURE1D                  0x200F
++-#define CL_GL_OBJECT_TEXTURE1D_ARRAY            0x2010
++-#define CL_GL_OBJECT_TEXTURE_BUFFER             0x2011
++-
++-/* cl_gl_texture_info           */
++-#define CL_GL_TEXTURE_TARGET                    0x2004
++-#define CL_GL_MIPMAP_LEVEL                      0x2005
 +-
- -/* cl_gl_texture_info */
- -#define CL_GL_TEXTURE_TARGET            0x2004
- -#define CL_GL_MIPMAP_LEVEL              0x2005
 +-
 +-extern CL_API_ENTRY cl_mem CL_API_CALL
 +-clCreateFromGLBuffer(cl_context     /* context */,
 +-                     cl_mem_flags   /* flags */,
 +-                     cl_GLuint      /* bufobj */,
 +-                     int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_mem CL_API_CALL
- -clCreateFromGLTexture2D(cl_context      /* context */,
- -                        cl_mem_flags    /* flags */,
- -                        cl_GLenum       /* target */,
- -                        cl_GLint        /* miplevel */,
- -                        cl_GLuint       /* texture */,
- -                        cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
- -
- -extern CL_API_ENTRY cl_mem CL_API_CALL
- -clCreateFromGLTexture3D(cl_context      /* context */,
- -                        cl_mem_flags    /* flags */,
- -                        cl_GLenum       /* target */,
- -                        cl_GLint        /* miplevel */,
- -                        cl_GLuint       /* texture */,
- -                        cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
- -
++-clCreateFromGLTexture(cl_context      /* context */,
++-                      cl_mem_flags    /* flags */,
++-                      cl_GLenum       /* target */,
++-                      cl_GLint        /* miplevel */,
++-                      cl_GLuint       /* texture */,
++-                      cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
++-    
 +-extern CL_API_ENTRY cl_mem CL_API_CALL
 +-clCreateFromGLRenderbuffer(cl_context   /* context */,
 +-                           cl_mem_flags /* flags */,
 +-                           cl_GLuint    /* renderbuffer */,
 +-                           cl_int *     /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetGLObjectInfo(cl_mem                /* memobj */,
 +-                  cl_gl_object_type *   /* gl_object_type */,
- -                  cl_GLuint *              /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
++-                  cl_GLuint *           /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
 +-                  
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetGLTextureInfo(cl_mem               /* memobj */,
 +-                   cl_gl_texture_info   /* param_name */,
 +-                   size_t               /* param_value_size */,
 +-                   void *               /* param_value */,
 +-                   size_t *             /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueAcquireGLObjects(cl_command_queue      /* command_queue */,
 +-                          cl_uint               /* num_objects */,
 +-                          const cl_mem *        /* mem_objects */,
 +-                          cl_uint               /* num_events_in_wait_list */,
 +-                          const cl_event *      /* event_wait_list */,
 +-                          cl_event *            /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clEnqueueReleaseGLObjects(cl_command_queue      /* command_queue */,
 +-                          cl_uint               /* num_objects */,
 +-                          const cl_mem *        /* mem_objects */,
 +-                          cl_uint               /* num_events_in_wait_list */,
 +-                          const cl_event *      /* event_wait_list */,
 +-                          cl_event *            /* event */) CL_API_SUFFIX__VERSION_1_0;
 +-
- -/* cl_khr_gl_sharing extension  */
 +-
++-// Deprecated OpenCL 1.1 APIs
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
++-clCreateFromGLTexture2D(cl_context      /* context */,
++-                        cl_mem_flags    /* flags */,
++-                        cl_GLenum       /* target */,
++-                        cl_GLint        /* miplevel */,
++-                        cl_GLuint       /* texture */,
++-                        cl_int *        /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++-    
++-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
++-clCreateFromGLTexture3D(cl_context      /* context */,
++-                        cl_mem_flags    /* flags */,
++-                        cl_GLenum       /* target */,
++-                        cl_GLint        /* miplevel */,
++-                        cl_GLuint       /* texture */,
++-                        cl_int *        /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++-    
++-/* cl_khr_gl_sharing extension  */
++-    
 +-#define cl_khr_gl_sharing 1
- -
++-    
 +-typedef cl_uint     cl_gl_context_info;
- -
++-    
 +-/* Additional Error Codes  */
 +-#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR  -1000
- -
++-    
 +-/* cl_gl_context_info  */
 +-#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR    0x2006
 +-#define CL_DEVICES_FOR_GL_CONTEXT_KHR           0x2007
- -
++-    
 +-/* Additional cl_context_properties  */
 +-#define CL_GL_CONTEXT_KHR                       0x2008
 +-#define CL_EGL_DISPLAY_KHR                      0x2009
 +-#define CL_GLX_DISPLAY_KHR                      0x200A
 +-#define CL_WGL_HDC_KHR                          0x200B
 +-#define CL_CGL_SHAREGROUP_KHR                   0x200C
- -
++-    
 +-extern CL_API_ENTRY cl_int CL_API_CALL
 +-clGetGLContextInfoKHR(const cl_context_properties * /* properties */,
 +-                      cl_gl_context_info            /* param_name */,
 +-                      size_t                        /* param_value_size */,
 +-                      void *                        /* param_value */,
 +-                      size_t *                      /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
- -
++-    
 +-typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
 +-    const cl_context_properties * properties,
 +-    cl_gl_context_info            param_name,
 +-    size_t                        param_value_size,
 +-    void *                        param_value,
 +-    size_t *                      param_value_size_ret);
 +-
 +-#ifdef __cplusplus
 +-}
 +-#endif
 +-
- -#endif  /* __OPENCL_CL_GL_H  */
++-#endif  /* __OPENCL_CL_GL_H */
 ++#include_next <CL/cl_gl.h>
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/src/cl_image.c
- +++ beignet-0.0.0+git2013.04.01+d1b234c/src/cl_image.c
- @@ -189,7 +189,7 @@ static const size_t cl_image_type_n = SI
-  
-  cl_int
-  cl_image_get_supported_fmt(cl_context ctx,
- -                           cl_mem_type image_type,
- +                           cl_mem_object_type image_type,
-                             cl_uint num_entries,
-                             cl_image_format *image_formats,
-                             cl_uint *num_image_formats)
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/src/cl_utils.h
- +++ beignet-0.0.0+git2013.04.01+d1b234c/src/cl_utils.h
- @@ -121,11 +121,11 @@ do {
-  #define CHECK_MEM(MEM)                                      \
-  do {                                                        \
-    if (UNLIKELY(MEM == NULL)) {                              \
- -    err = CL_INVALID_MEM;                                   \
- +    err = CL_INVALID_MEM_OBJECT;                            \
-      goto error;                                             \
-    }                                                         \
-    if (UNLIKELY(MEM->magic != CL_MAGIC_MEM_HEADER)) {        \
- -    err = CL_INVALID_MEM;                                   \
- +    err = CL_INVALID_MEM_OBJECT;                            \
-      goto error;                                             \
-    }                                                         \
-  } while (0)
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/src/cl_mem.c
- +++ beignet-0.0.0+git2013.04.01+d1b234c/src/cl_mem.c
- @@ -67,7 +67,7 @@ cl_mem_allocate(cl_context ctx,
-    assert(bufmgr);
-    mem->bo = cl_buffer_alloc(bufmgr, "CL memory object", sz, alignment);
-    if (UNLIKELY(mem->bo == NULL)) {
- -    err = CL_MEM_ALLOCATION_FAILURE;
- +    err = CL_MEM_OBJECT_ALLOCATION_FAILURE;
-      goto error;
-    }
-  
- @@ -376,7 +376,7 @@ cl_mem_pin(cl_mem mem)
-  {
-    assert(mem);
-    if (UNLIKELY((mem->flags & CL_MEM_PINNABLE) == 0))
- -    return CL_INVALID_MEM;
- +    return CL_INVALID_MEM_OBJECT;
-    cl_buffer_pin(mem->bo, 4096);
-    return CL_SUCCESS;
-  }
- @@ -386,7 +386,7 @@ cl_mem_unpin(cl_mem mem)
-  {
-    assert(mem);
-    if (UNLIKELY((mem->flags & CL_MEM_PINNABLE) == 0))
- -    return CL_INVALID_MEM;
- +    return CL_INVALID_MEM_OBJECT;
-    cl_buffer_unpin(mem->bo);
-    return CL_SUCCESS;
-  }
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/src/cl_api.c
- +++ beignet-0.0.0+git2013.04.01+d1b234c/src/cl_api.c
- @@ -306,7 +306,7 @@ error:
-  cl_int
-  clGetSupportedImageFormats(cl_context       ctx,
-                             cl_mem_flags     flags,
- -                           cl_mem_type      image_type,
- +                           cl_mem_object_type image_type,
-                             cl_uint          num_entries,
-                             cl_image_format *image_formats,
-                             cl_uint *        num_image_formats)
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/src/cl_image.h
- +++ beignet-0.0.0+git2013.04.01+d1b234c/src/cl_image.h
- @@ -35,7 +35,7 @@ extern uint32_t cl_image_get_intel_forma
-  
-  /* Return the list of formats supported by the API */
-  extern cl_int cl_image_get_supported_fmt(cl_context context,
- -                                         cl_mem_type image_type,
- +                                         cl_mem_object_type image_type,
-                                           cl_uint num_entries,
-                                           cl_image_format *image_formats,
-                                           cl_uint *num_image_formats);
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/utests/utest_error.c
- +++ beignet-0.0.0+git2013.04.01+d1b234c/utests/utest_error.c
- @@ -25,7 +25,7 @@ const char *err_msg[] = {
-    [-CL_DEVICE_NOT_FOUND] = "CL_DEVICE_NOT_FOUND",
-    [-CL_DEVICE_NOT_AVAILABLE] = "CL_DEVICE_NOT_AVAILABLE",
-    [-CL_COMPILER_NOT_AVAILABLE] = "CL_COMPILER_NOT_AVAILABLE",
- -  [-CL_MEM_ALLOCATION_FAILURE] = "CL_MEM_ALLOCATION_FAILURE",
- +  [-CL_MEM_OBJECT_ALLOCATION_FAILURE] = "CL_MEM_OBJECT_ALLOCATION_FAILURE",
-    [-CL_OUT_OF_RESOURCES] = "CL_OUT_OF_RESOURCES",
-    [-CL_OUT_OF_HOST_MEMORY] = "CL_OUT_OF_HOST_MEMORY",
-    [-CL_PROFILING_INFO_NOT_AVAILABLE] = "CL_PROFILING_INFO_NOT_AVAILABLE",
- @@ -44,7 +44,7 @@ const char *err_msg[] = {
-    [-CL_INVALID_QUEUE_PROPERTIES] = "CL_INVALID_QUEUE_PROPERTIES",
-    [-CL_INVALID_COMMAND_QUEUE] = "CL_INVALID_COMMAND_QUEUE",
-    [-CL_INVALID_HOST_PTR] = "CL_INVALID_HOST_PTR",
- -  [-CL_INVALID_MEM] = "CL_INVALID_MEM",
- +  [-CL_INVALID_MEM_OBJECT] = "CL_INVALID_MEM_OBJECT",
-    [-CL_INVALID_IMAGE_FORMAT_DESCRIPTOR] = "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR",
-    [-CL_INVALID_IMAGE_SIZE] = "CL_INVALID_IMAGE_SIZE",
-    [-CL_INVALID_SAMPLER] = "CL_INVALID_SAMPLER",
diff --cc debian/patches/llvm-3.2
index 0000000,0000000..22d5b2f
new file mode 100644
--- /dev/null
+++ b/debian/patches/llvm-3.2
@@@ -1,0 -1,0 +1,19 @@@
++Description: Look harder for LLVM 3.2
++Author: Simon Richter <sjr at debian.org>
++Last-Update: 2013-04-15
++
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/CMake/FindLLVM.cmake
+++++ beignet-0.0.0+git2013.04.11+e6b503e/CMake/FindLLVM.cmake
++@@ -7,9 +7,9 @@
++ # LLVM_MODULE_LIBS - list of llvm libs for working with modules.
++ # LLVM_FOUND       - True if llvm found.
++ if (LLVM_INSTALL_DIR)
++-  find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config llvm-config-32 llvm-config-3.0 DOC "llvm-config executable" PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
++-else (LLVM_INSTALL_DIR)
++-  find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config llvm-config-32 llvm-config-3.0 DOC "llvm-config executable")
+++  find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-32 llvm-config-3.2 llvm-config DOC "llvm-config executable" PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
+++else (LLVM_INSTALL_DIR)                                                                
+++  find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-32 llvm-config-3.2 llvm-config DOC "llvm-config executable")
++ endif (LLVM_INSTALL_DIR)
++ 
++ if (LLVM_CONFIG_EXECUTABLE)
diff --cc debian/patches/missing-header
index 8b61251,0000000..adfcafe
mode 100644,000000..100644
--- a/debian/patches/missing-header
+++ b/debian/patches/missing-header
@@@ -1,14 -1,0 +1,16 @@@
 +Description: Fix missing include
 +Author: Simon Richter <sjr at debian.org>
 +Last-Update: 2013-04-03
 +
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/backend/src/sys/alloc.hpp
- +++ beignet-0.0.0+git2013.04.01+d1b234c/backend/src/sys/alloc.hpp
++Index: beignet-0.0.0+git2013.04.11+e6b503e/backend/src/sys/alloc.hpp
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/backend/src/sys/alloc.hpp	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/src/sys/alloc.hpp	2013-04-15 18:33:38.340353060 +0200
 +@@ -27,6 +27,7 @@
 + #include "sys/platform.hpp"
 + #include "sys/assert.hpp"
 + #include <algorithm>
 ++#include <limits>
 + 
 + namespace gbe
 + {
diff --cc debian/patches/respect-flags
index b985093,0000000..726c46b
mode 100644,000000..100644
--- a/debian/patches/respect-flags
+++ b/debian/patches/respect-flags
@@@ -1,54 -1,0 +1,51 @@@
- Description: Respect external CFLAGS/CXXFLAGS/LDFLAGS
++Description: Respect CFLAGS/CXXFLAGS from Debian
 +Author: Simon Richter <sjr at debian.org>
- Last-Update: 2013-04-04
++Last-Update: 2013-04-16
 +
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/Makefile.lib
- +++ beignet-0.0.0+git2013.04.01+d1b234c/Makefile.lib
- @@ -7,7 +7,7 @@ LIBS=-Wl,--no-undefined $(LIB_BACKEND) $
-  all: $(LIB) $(LIBMAJOR) $(LIBBASE)
-  
-  $(LIB): $(OBJ) $(LIB_BACKEND)
- -	$(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(LIBMAJOR) -o $@ $(OBJ) $(LIBS)
- +	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(LIBMAJOR) -o $@ $(OBJ) $(LIBS)
-  
-  $(LIBMAJOR): $(LIB)
-  	rm -f $@
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/Makefile.defs
- +++ beignet-0.0.0+git2013.04.01+d1b234c/Makefile.defs
- @@ -24,9 +24,9 @@ LOCAL_LIBS=$(DRM_LIBS) $(XEXT_LIBS)
-  
-  LOCAL_CXXFLAGS=$(LOCAL_CFLAGS) -std=c++0x -fno-rtti -Wno-invalid-offsetof
-  
- -CXXFLAGS=$(LOCAL_CXXFLAGS) $(LLVM_CXXFLAGS) $(DIR_CXXFLAGS)
- +CXXFLAGS+=$(LOCAL_CXXFLAGS) $(LLVM_CXXFLAGS) $(DIR_CXXFLAGS)
-  
- -CFLAGS=$(LLVM_CFLAGS) $(LOCAL_CFLAGS) $(DIR_CFLAGS) -std=c99
- +CFLAGS+=$(LLVM_CFLAGS) $(LOCAL_CFLAGS) $(DIR_CFLAGS) -std=c99
-  
-  INC=$(shell for i in $(SUBDIRS); do ls $$i/*.h* 2>/dev/null; done)
-  
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/backend/Makefile.lib
- +++ beignet-0.0.0+git2013.04.01+d1b234c/backend/Makefile.lib
- @@ -9,7 +9,7 @@ VERSION=0.0.1
-  all: $(LIB) $(LIBMAJOR) $(LIBBASE)
-  
-  $(LIB): $(OBJ)
- -	$(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(LIBMAJOR) -o $@ $(OBJ) $(LIBS)
- +	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(LIBMAJOR) -o $@ $(OBJ) $(LIBS)
-  
-  $(LIBMAJOR): $(LIB)
-  	rm -f $@
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/backend/Makefile.defs
- +++ beignet-0.0.0+git2013.04.01+d1b234c/backend/Makefile.defs
- @@ -4,9 +4,9 @@ LOCAL_CFLAGS=-funroll-loops -Wstrict-ali
-  
-  LOCAL_CXXFLAGS=$(LOCAL_CFLAGS) -std=c++0x -fno-rtti -Wno-invalid-offsetof
-  
- -CXXFLAGS=$(LOCAL_CXXFLAGS) $(shell llvm-config --cxxflags | sed 's/\-pedantic//g')
- +CXXFLAGS+=$(LOCAL_CXXFLAGS) $(shell llvm-config --cxxflags | sed 's/\-pedantic//g')
-  
- -CFLAGS=$(LOCAL_CFLAGS) $(shell llvm-config --cflags) -std=gnu9x
- +CFLAGS+=$(LOCAL_CFLAGS) $(shell llvm-config --cflags) -std=gnu9x
-  
-  INC=$(shell for i in $(SUBDIRS); do ls $$i/*.h* 2>/dev/null; done)
-  
++Index: beignet-0.0.0+git2013.04.11+e6b503e/CMakeLists.txt
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/CMakeLists.txt	2013-04-16 14:49:50.450369637 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/CMakeLists.txt	2013-04-16 14:50:20.298368306 +0200
++@@ -18,7 +18,6 @@
++ 
++ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ 
++-SET(CMAKE_VERBOSE_MAKEFILE "false")
++ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")
++ SET(EMULATE_IVB false CACHE BOOL "To emulate IVB")
++ SET(EMULATE_SNB false CACHE BOOL "To emulate SNB")
++@@ -55,8 +54,8 @@
++   ADD_DEFINITIONS(-DUSE_FULSIM=0)
++ ENDIF (USE_FULSIM)
++ 
++-SET(CMAKE_CXX_FLAGS "-Wall -Wno-invalid-offsetof -mfpmath=sse --no-rtti -Wcast-align -std=c++0x -msse2 -msse3 -mssse3 -msse4.1 ")
++-SET(CMAKE_C_FLAGS "-Wall -mfpmath=sse -msse2 -Wcast-align -msse2 -msse3 -mssse3 -msse4.1")
+++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-invalid-offsetof -mfpmath=sse --no-rtti -Wcast-align -std=c++0x -msse2 -msse3 -mssse3 -msse4.1 ")
+++SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -mfpmath=sse -msse2 -Wcast-align -msse2 -msse3 -mssse3 -msse4.1")
++ 
++ # Front end stuff we need
++ #INCLUDE(CMake/FindLLVM.cmake)
++Index: beignet-0.0.0+git2013.04.11+e6b503e/backend/CMakeLists.txt
++===================================================================
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/backend/CMakeLists.txt	2013-04-16 14:49:48.290369733 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/CMakeLists.txt	2013-04-16 14:50:20.298368306 +0200
++@@ -45,16 +45,16 @@
++ if (COMPILER STREQUAL "GCC")
++   set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -funroll-loops -Wstrict-aliasing=2 -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -ffast-math -fPIC -Wall")
++   set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS}  ${LLVM_CFLAGS}")
++-  set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS}  -Wno-invalid-offsetof -fno-rtti -std=c++0x")
+++  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS}  -Wno-invalid-offsetof -fno-rtti -std=c++0x")
++   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}")
++   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}")
++   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-E")
++-  set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${LLVM_LFLAGS}")
+++  set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined ${LLVM_LFLAGS}")
++   set (CMAKE_CXX_FLAGS_DEBUG          "-g -DGBE_DEBUG=1")
++   set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
++   set (CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG -DGBE_DEBUG=0")
++   set (CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG -DGBE_DEBUG=0")
++-  set (CMAKE_C_FLAGS "${CMAKE_C_CXX_FLAGS}")
+++  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_CXX_FLAGS}")
++   set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}")
++   set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}")
++   set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-E")
diff --cc debian/patches/series
index 23d5ea9,0000000..6c20ce6
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,11 -1,0 +1,11 @@@
- fix-clean
- path
- soname
 +khronos
 +verbose
 +clang-from-path
 +implement-gefa
 +missing-header
- respect-flags
- device-info-query
 +glibc-memalign
++llvm-3.2
++autogen
++ignore-missing-egl
++soname
++respect-flags
diff --cc debian/patches/soname
index 500b082,0000000..d7d84e2
mode 100644,000000..100644
--- a/debian/patches/soname
+++ b/debian/patches/soname
@@@ -1,30 -1,0 +1,33 @@@
- Description: Fix SONAMEs
++Description: Use proper SONAME
 +Author: Simon Richter <sjr at debian.org>
- Last-Update: 2013-04-01
++Last-Update: 2013-04-15
 +
- Index: beignet-0.0.0+git2013.04.01+d1b234c/Makefile.lib
++Index: beignet-0.0.0+git2013.04.11+e6b503e/backend/src/CMakeLists.txt
 +===================================================================
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/Makefile.lib	2013-03-31 04:38:20.000000000 +0200
- +++ beignet-0.0.0+git2013.04.01+d1b234c/Makefile.lib	2013-03-31 04:39:45.666886644 +0200
- @@ -7,7 +7,7 @@
-  all: $(LIB) $(LIBMAJOR) $(LIBBASE)
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/backend/src/CMakeLists.txt	2013-04-15 19:57:53.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/backend/src/CMakeLists.txt	2013-04-16 12:38:43.590720375 +0200
++@@ -114,7 +114,10 @@
++                       ${LLVM_MODULE_LIBS}
++                       ${CMAKE_THREAD_LIBS_INIT}
++                       ${CMAKE_DL_LIBS})
++-
+++set_target_properties(gbe
+++                        PROPERTIES
+++                        VERSION 2013-04-11
+++                        SOVERSION 0)
++ install (TARGETS gbe LIBRARY DESTINATION lib)
++ install (FILES backend/program.h DESTINATION include/gen)
 + 
-  $(LIB): $(OBJ) $(LIB_BACKEND)
- -	$(CXX) $(CXXFLAGS) -shared -o $@ $(OBJ) $(LIBS)
- +	$(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(LIBMAJOR) -o $@ $(OBJ) $(LIBS)
-  
-  $(LIBMAJOR): $(LIB)
-  	rm -f $@
- Index: beignet-0.0.0+git2013.04.01+d1b234c/backend/Makefile.lib
++Index: beignet-0.0.0+git2013.04.11+e6b503e/src/CMakeLists.txt
 +===================================================================
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/backend/Makefile.lib	2013-03-31 04:42:47.946878517 +0200
- +++ beignet-0.0.0+git2013.04.01+d1b234c/backend/Makefile.lib	2013-03-31 04:42:58.946878027 +0200
- @@ -9,7 +9,7 @@
-  all: $(LIB) $(LIBMAJOR) $(LIBBASE)
-  
-  $(LIB): $(OBJ)
- -	$(CXX) $(CXXFLAGS) -shared -o $@ $(OBJ) $(LIBS)
- +	$(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(LIBMAJOR) -o $@ $(OBJ) $(LIBS)
-  
-  $(LIBMAJOR): $(LIB)
-  	rm -f $@
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/src/CMakeLists.txt	2013-04-16 12:37:38.774723265 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/src/CMakeLists.txt	2013-04-16 12:39:01.422719580 +0200
++@@ -50,4 +50,8 @@
++                       ${OPENGL_LIBRARIES}
++                       ${OPTIONAL_EGL_LIBRARY}
++                       ${GBM_LIBRARY})
+++set_target_properties(cl
+++                        PROPERTIES
+++                        VERSION 2013-04-11
+++                        SOVERSION 0)
++ install (TARGETS cl LIBRARY DESTINATION lib)
diff --cc debian/patches/verbose
index e615eb7,0000000..033a2be
mode 100644,000000..100644
--- a/debian/patches/verbose
+++ b/debian/patches/verbose
@@@ -1,16 -1,0 +1,16 @@@
 +Description: More verbose errors
 +Author: Simon Richter <sjr at debian.org>
 +Last-Update: 2013-04-01
 +
- Index: beignet-0.0.0+git2013.04.01+d1b234c/src/cl_utils.h
++Index: beignet-0.0.0+git2013.04.11+e6b503e/src/cl_utils.h
 +===================================================================
- --- beignet-0.0.0+git2013.04.01+d1b234c.orig/src/cl_utils.h	2013-04-01 04:31:35.000000000 +0200
- +++ beignet-0.0.0+git2013.04.01+d1b234c/src/cl_utils.h	2013-04-01 04:35:18.299046483 +0200
++--- beignet-0.0.0+git2013.04.11+e6b503e.orig/src/cl_utils.h	2013-04-12 08:13:48.000000000 +0200
+++++ beignet-0.0.0+git2013.04.11+e6b503e/src/cl_utils.h	2013-04-15 18:28:17.640334450 +0200
 +@@ -80,6 +80,7 @@
 + 
 + #define FATAL(...)                                          \
 + do {                                                        \
 ++  fprintf(stderr, "in function %s:\n", __FUNCTION__);       \
 +   fprintf(stderr, "error: ");                               \
 +   fprintf(stderr, __VA_ARGS__);                             \
 +   fprintf(stderr, "\n");                                    \
diff --cc debian/rules
index 130e075,0000000..2511530
mode 100755,000000..100755
--- a/debian/rules
+++ b/debian/rules
@@@ -1,8 -1,0 +1,8 @@@
 +#!/usr/bin/make -f
 +# -*- makefile -*-
 +
 +# Uncomment this to turn on verbose mode.
 +#export DH_VERBOSE=1
 +
 +%:
- 	dh $@ --parallel
++	dh $@ --buildsystem cmake --parallel
diff --cc debian/source/options
index 0000000,0000000..b818bd4
new file mode 100644
--- /dev/null
+++ b/debian/source/options
@@@ -1,0 -1,0 +1,7 @@@
++extend-diff-ignore="(^|/)utests/.*\.bmp"
++extend-diff-ignore="(^|/)backend/src/ocl_stdlib_str.cpp"
++extend-diff-ignore="(^|/)backend/src/ocl_common_defines_str.cpp"
++extend-diff-ignore="(^|/)CMakeFiles/CMakeDetermineCompilerABI_C.bin"
++extend-diff-ignore="(^|/)CMakeFiles/CMakeDetermineCompilerABI_CXX.bin"
++extend-diff-ignore="(^|/)CMakeFiles/CompilerIdCXX/a.out"
++extend-diff-ignore="(^|/)CMakeFiles/CompilerIdC/a.out"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-devel mailing list