[beignet] 03/07: Drop patches applied upstream, refresh others
Rebecca Palmer
rnpalmer-guest at moszumanska.debian.org
Tue Sep 6 21:32:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
rnpalmer-guest pushed a commit to branch master
in repository beignet.
commit 35f23ed45f7b33d388fa9498e47cd22f1d562e42
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date: Mon Sep 5 18:34:29 2016 +0100
Drop patches applied upstream, refresh others
---
debian/changelog | 7 +
.../Debian-compliant-compiler-flags-handling.patch | 25 +-
debian/patches/Enable-test-debug.patch | 70 +--
debian/patches/allow-+-in-directory.patch | 10 +-
debian/patches/docs-broken-links.patch | 10 +-
debian/patches/find-llvm37.patch | 22 -
debian/patches/find-python35.patch | 11 +-
debian/patches/gcc6-support.patch | 47 --
debian/patches/llvm38-support.patch | 676 ---------------------
debian/patches/noassert-missing-function.patch | 182 ------
debian/patches/printf-fix-90472.patch | 24 -
debian/patches/profiling-32on64.patch | 40 --
debian/patches/reduce-notfound-output.patch | 14 +-
debian/patches/series | 6 -
debian/patches/shared-llvm.patch | 9 +-
debian/patches/std-isnan-isinf.patch | 248 --------
debian/patches/support-kfreebsd.patch | 44 +-
debian/patches/update-docs.patch | 76 +--
18 files changed, 125 insertions(+), 1396 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index ab1249f..56498b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+beignet (1.2.0-1) UNRELEASED; urgency=medium
+
+ * New upstream release.
+ * Drop patches applied upstream, refresh others.
+
+ -- Rebecca N. Palmer <rebecca_palmer at zoho.com> Sun, 04 Sep 2016 20:53:34 +0100
+
beignet (1.1.2-5) unstable; urgency=medium
* Stop build-depending on LLVM 3.7 on release architectures.
diff --git a/debian/patches/Debian-compliant-compiler-flags-handling.patch b/debian/patches/Debian-compliant-compiler-flags-handling.patch
index 07d00fc..38ff960 100644
--- a/debian/patches/Debian-compliant-compiler-flags-handling.patch
+++ b/debian/patches/Debian-compliant-compiler-flags-handling.patch
@@ -6,9 +6,9 @@ Disable non-policy-compliant instruction set assumptions (slows the
OpenCL compiler by ~few%, no effect on OpenCL execution speed)
Author: Simon Richter <sjr at debian.org>,Rebecca Palmer <rebecca_palmer at zoho.com>
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -37,7 +37,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINA
+--- beignet.orig/CMakeLists.txt
++++ beignet/CMakeLists.txt
+@@ -41,7 +41,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINA
INCLUDE (FindPkgConfig)
@@ -16,7 +16,7 @@ Author: Simon Richter <sjr at debian.org>,Rebecca Palmer <rebecca_palmer at zoho.com>
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")
INCLUDE (GNUInstallDirs OPTIONAL)
# support old CMake without GNUInstallDirs
-@@ -79,14 +78,14 @@ elseif (COMPILER STREQUAL "CLANG")
+@@ -83,9 +82,9 @@ ADD_DEFINITIONS(-DGEN7_SAMPLER_CLAMP_BOR
# compiler flag setting
if (COMPILER STREQUAL "GCC")
@@ -28,15 +28,8 @@ Author: Simon Richter <sjr at debian.org>,Rebecca Palmer <rebecca_palmer at zoho.com>
elseif (COMPILER STREQUAL "ICC")
set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -wd2928 -Wall -fPIC -fstrict-aliasing -fp-model fast -msse4.1 -Wl,-E")
endif ()
--set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -std=c++0x -Wno-invalid-offsetof")
--set (CMAKE_C_FLAGS "${CMAKE_C_CXX_FLAGS}")
-+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_CXX_FLAGS} -std=c++0x -Wno-invalid-offsetof")
-+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_CXX_FLAGS}")
- set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DGBE_DEBUG=1")
- set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
- set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0")
---- beignet-1.1.2.orig/backend/src/sys/platform.hpp
-+++ beignet-1.1.2/backend/src/sys/platform.hpp
+--- beignet.orig/backend/src/sys/platform.hpp
++++ beignet/backend/src/sys/platform.hpp
@@ -41,15 +41,6 @@
#define __X86__
#endif
@@ -53,9 +46,9 @@ Author: Simon Richter <sjr at debian.org>,Rebecca Palmer <rebecca_palmer at zoho.com>
#if defined(_INCLUDED_IMM)
// #define __AVX__
---- beignet-1.1.2.orig/utests/CMakeLists.txt
-+++ beignet-1.1.2/utests/CMakeLists.txt
-@@ -260,6 +260,12 @@ add_custom_target(utest_generator
+--- beignet.orig/utests/CMakeLists.txt
++++ beignet/utests/CMakeLists.txt
+@@ -340,6 +340,12 @@ add_custom_target(utest_generator
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
diff --git a/debian/patches/Enable-test-debug.patch b/debian/patches/Enable-test-debug.patch
index 4f65c4f..bf755ee 100644
--- a/debian/patches/Enable-test-debug.patch
+++ b/debian/patches/Enable-test-debug.patch
@@ -9,8 +9,8 @@ does not need to stay compatible).
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
---- a/utests/builtin_acos_asin.cpp
-+++ b/utests/builtin_acos_asin.cpp
+--- beignet.orig/utests/builtin_acos_asin.cpp
++++ beignet/utests/builtin_acos_asin.cpp
@@ -2,12 +2,12 @@
#include <cmath>
#include <algorithm>
@@ -26,8 +26,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+ status = 1;\
}
- const float input_data[] = {-30, -1, -0.92, -0.5, -0.09, 0, 0.09, 0.5, 0.92, 1, 30};
-@@ -29,6 +29,7 @@ static void builtin_acos_asin(void)
+ namespace {
+@@ -31,6 +31,7 @@ static void builtin_acos_asin(void)
{
// Setup kernel and buffers
int k, i, index_cur;
@@ -35,7 +35,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
float gpu_data[max_function * count_input] = {0}, cpu_data[max_function * count_input] = {0};
OCL_CREATE_KERNEL("builtin_acos_asin");
-@@ -82,6 +83,7 @@ static void builtin_acos_asin(void)
+@@ -85,6 +86,7 @@ static void builtin_acos_asin(void)
#endif
}
}
@@ -43,8 +43,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
}
MAKE_UTEST_FROM_FUNCTION(builtin_acos_asin)
---- a/utests/builtin_exp.cpp
-+++ b/utests/builtin_exp.cpp
+--- beignet.orig/utests/builtin_exp.cpp
++++ beignet/utests/builtin_exp.cpp
@@ -2,7 +2,7 @@
#include <cmath>
#include <algorithm>
@@ -53,7 +53,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+#define udebug 1
#define FLT_MAX 0x1.fffffep127f
- #define FLT_MIN 0x1.0p-126f
+ #define FLT_MIN ldexpf(1.0,-126)
@@ -10,9 +10,9 @@
#define printf_c(...) \
@@ -65,8 +65,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+ status = 1;\
}
- const float input_data[] = {FLT_MAX, -FLT_MAX, FLT_MIN, -FLT_MIN, 80, -80, 3.14, -3.14, -0.5, 0.5, 1, -1, 0.0 };
-@@ -34,6 +34,7 @@ static void builtin_exp(void)
+ namespace{
+@@ -36,6 +36,7 @@ static void builtin_exp(void)
{
// Setup kernel and buffers
int k, i, index_cur;
@@ -74,7 +74,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
float gpu_data[max_function * count_input] = {0}, cpu_data[max_function * count_input] = {0};
float diff;
char log[256] = {0};
-@@ -72,19 +73,19 @@ static void builtin_exp(void)
+@@ -75,19 +76,19 @@ static void builtin_exp(void)
#if udebug
if (std::isinf(cpu_data[index_cur]) && std::isinf(gpu_data[index_cur])){
@@ -99,7 +99,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
#else
if (std::isinf(cpu_data[index_cur]))
OCL_ASSERTM(std::isinf(gpu_data[index_cur]), log);
-@@ -97,6 +98,7 @@ static void builtin_exp(void)
+@@ -100,6 +101,7 @@ static void builtin_exp(void)
#endif
}
}
@@ -107,8 +107,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
}
MAKE_UTEST_FROM_FUNCTION(builtin_exp)
---- a/utests/builtin_global_id.cpp
-+++ b/utests/builtin_global_id.cpp
+--- beignet.orig/utests/builtin_global_id.cpp
++++ beignet/utests/builtin_global_id.cpp
@@ -22,7 +22,7 @@ dimension:3
9 10 11 21 22 23 33 34 35 45 46 47 57 58 59
*/
@@ -118,8 +118,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
#include "utest_helper.hpp"
static void builtin_global_id(void)
{
---- a/utests/builtin_local_id.cpp
-+++ b/utests/builtin_local_id.cpp
+--- beignet.orig/utests/builtin_local_id.cpp
++++ beignet/utests/builtin_local_id.cpp
@@ -26,7 +26,7 @@ dimension:3
429 430 431 432 433 434 ... 571 572 573 574 575
*/
@@ -129,8 +129,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
#include "utest_helper.hpp"
static void builtin_local_id(void)
{
---- a/utests/builtin_local_size.cpp
-+++ b/utests/builtin_local_size.cpp
+--- beignet.orig/utests/builtin_local_size.cpp
++++ beignet/utests/builtin_local_size.cpp
@@ -28,7 +28,7 @@ get_local_size(4) = 1 (dimension:3)
*/
@@ -140,8 +140,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
static void builtin_local_size(void)
{
---- a/utests/builtin_num_groups.cpp
-+++ b/utests/builtin_num_groups.cpp
+--- beignet.orig/utests/builtin_num_groups.cpp
++++ beignet/utests/builtin_num_groups.cpp
@@ -25,7 +25,7 @@ get_num_groups(2) = 3 (dimension:3)
get_num_groups(3) = 1 (dimension:3)
*/
@@ -151,8 +151,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
#include "utest_helper.hpp"
static void builtin_num_groups(void)
{
---- a/utests/builtin_pow.cpp
-+++ b/utests/builtin_pow.cpp
+--- beignet.orig/utests/builtin_pow.cpp
++++ beignet/utests/builtin_pow.cpp
@@ -3,12 +3,12 @@
#include <algorithm>
#include <string.h>
@@ -167,9 +167,9 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
- printf("\033[0m");\
+ status = 1;\
}
- const float ori_data[] = {-20.5, -1, -0.9, -0.01, 0, 0.01, 0.9, 1.0, 20.5};
- const int count_input_ori = sizeof(ori_data) / sizeof(ori_data[0]);
-@@ -28,6 +28,7 @@ static void builtin_pow(void)
+
+ namespace {
+@@ -31,6 +31,7 @@ static void builtin_pow(void)
{
// Setup kernel and buffers
int k, i, index_cur;
@@ -177,7 +177,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
float ULPSIZE_NO_FAST_MATH = 16.0;
float gpu_data[max_function * count_input] = {0}, cpu_data[max_function * count_input] = {0};
-@@ -80,7 +81,7 @@ static void builtin_pow(void)
+@@ -84,7 +85,7 @@ static void builtin_pow(void)
&& (denormals_supported || gpu_data[index_cur]!=0 || std::fpclassify(cpu_data[index_cur])!=FP_SUBNORMAL) ) )
{
@@ -186,7 +186,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
}
else
printf("%d/%d: x:%f, y:%f -> gpu:%f cpu:%f\n", k, i, input_data1[k], input_data2[k], gpu_data[index_cur], cpu_data[index_cur]);
-@@ -97,6 +98,7 @@ static void builtin_pow(void)
+@@ -101,6 +102,7 @@ static void builtin_pow(void)
#endif
}
}
@@ -194,17 +194,17 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
}
MAKE_UTEST_FROM_FUNCTION(builtin_pow)
---- a/utests/setenv.sh.in
-+++ b/utests/setenv.sh.in
-@@ -8,3 +8,6 @@ export OCL_PCH_PATH=@LOCAL_OCL_PCH_OBJEC
+--- beignet.orig/utests/setenv.sh.in
++++ beignet/utests/setenv.sh.in
+@@ -8,3 +8,6 @@ export OCL_GBE_PATH=@LOCAL_GBE_OBJECT_DI
export OCL_INTERP_PATH=@LOCAL_INTERP_OBJECT_DIR@
#disable self-test so we can get something more precise than "doesn't work"
export OCL_IGNORE_SELF_TEST=1
+obj-`dpkg-architecture -qDEB_HOST_GNU_TYPE`/utests/utest_run -a
+export OCL_STRICT_CONFORMANCE=0
+obj-`dpkg-architecture -qDEB_HOST_GNU_TYPE`/utests/utest_run -a
---- a/utests/utest_generator.py
-+++ b/utests/utest_generator.py
+--- beignet.orig/utests/utest_generator.py
++++ beignet/utests/utest_generator.py
@@ -159,6 +159,7 @@ def udebug(ulpSize,returnType,function):
}
#endif
@@ -233,7 +233,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
}
'''
#########Execute class itself
-@@ -334,6 +335,7 @@ which can print more values and informat
+@@ -341,6 +342,7 @@ which can print more values and informat
static void %s_%s(void)
{
int index;
@@ -241,8 +241,8 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
%s gpu_data[count_input] = {0}, cpu_data[count_input] = {0}, diff=0.0;
char log[1024] = {0};
---- beignet-1.1.2.orig/utests/profiling_exec.cpp
-+++ beignet-1.1.2/utests/profiling_exec.cpp
+--- beignet.orig/utests/profiling_exec.cpp
++++ beignet/utests/profiling_exec.cpp
@@ -26,10 +26,10 @@ static void check_profiling_time(cl_ulon
double submit_to_start = (double)(start - submit)*1e-9;
double start_to_end = (double)(end - start)*1e-9;
diff --git a/debian/patches/allow-+-in-directory.patch b/debian/patches/allow-+-in-directory.patch
index 2422989..a911bef 100644
--- a/debian/patches/allow-+-in-directory.patch
+++ b/debian/patches/allow-+-in-directory.patch
@@ -3,9 +3,9 @@ Description: Allow + in directory name
+ is a special character in a regex, which makes the build fail in
directories such as beignet_1.0.3+dfsg
---- a/backend/src/libocl/CMakeLists.txt
-+++ b/backend/src/libocl/CMakeLists.txt
-@@ -128,11 +128,12 @@ FOREACH(M ${OCL_BASH_GENERATED_MODULES})
+--- beignet.orig/backend/src/libocl/CMakeLists.txt
++++ beignet/backend/src/libocl/CMakeLists.txt
+@@ -129,11 +129,12 @@ FOREACH(M ${OCL_BASH_GENERATED_MODULES})
GENERATE_SOURCE_BASH(${M})
ENDFOREACH(M)
@@ -19,7 +19,7 @@ directories such as beignet_1.0.3+dfsg
ADD_CUSTOM_COMMAND(OUTPUT ${output_name}
COMMAND mkdir -p ${OCL_OBJECT_DIR}/
#COMMAND echo ${LLVM_INSTALL_DIR}clang -cc1 ${CLANG_OCL_FLAGS} -I ${LIBOCL_BINARY_DIR}/include/ -emit-llvm-bc -triple spir -o ${output_name} -x cl ${_file}
-@@ -148,7 +149,7 @@ FOREACH(f ${OCL_SOURCE_FILES})
+@@ -149,7 +150,7 @@ FOREACH(f ${OCL_SOURCE_FILES})
ENDFOREACH(f)
FOREACH(f ${OCL_SOURCE_FILES})
@@ -27,4 +27,4 @@ directories such as beignet_1.0.3+dfsg
+ STRING(REGEX REPLACE "${ESCAPED_LIBOCL_BINARY_DIR}/src/\(o.*\)\\.cl" "${OCL_OBJECT_DIR}/\\1.bc" bc_name ${f})
SET(OCL_BC_FILES ${OCL_BC_FILES} ${bc_name})
ENDFOREACH(f)
-
+
diff --git a/debian/patches/docs-broken-links.patch b/debian/patches/docs-broken-links.patch
index c9821e7..d47420d 100644
--- a/debian/patches/docs-broken-links.patch
+++ b/debian/patches/docs-broken-links.patch
@@ -2,8 +2,8 @@ Description: Fix broken internal links in documentation
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
---- beignet-1.1.2.orig/docs/Beignet.mdwn
-+++ beignet-1.1.2/docs/Beignet.mdwn
+--- beignet.orig/docs/Beignet.mdwn
++++ beignet/docs/Beignet.mdwn
@@ -24,7 +24,7 @@ Attempting to run Beignet on unsupported
News
@@ -13,7 +13,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Prerequisite
------------
-@@ -303,11 +303,11 @@ Please specify your hardware when report
+@@ -276,13 +276,13 @@ Please specify your hardware when report
Documents for OpenCL application developers
-------------------------------------------
@@ -22,11 +22,15 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
-- [[Kernel Optimization Guide|Beignet/optimization-guide]]
-- [[Libva Buffer Sharing|Beignet/howto/libva-buffer-sharing-howto]]
-- [[V4l2 Buffer Sharing|Beignet/howto/v4l2-buffer-sharing-howto]]
+-- [[Video Motion Estimation|Beignet/howto/video-motion-estimation-howto]]
+-- [[Stand Alone Unit Test|Beignet/howto/stand-alone-utest-howto]]
+- [[Cross compile (yocto)|howto/cross-compiler-howto]]
+- [[Work with old system without c++11|howto/oldgcc-howto]]
+- [[Kernel Optimization Guide|optimization-guide]]
+- [[Libva Buffer Sharing|howto/libva-buffer-sharing-howto]]
+- [[V4l2 Buffer Sharing|howto/v4l2-buffer-sharing-howto]]
++- [[Video Motion Estimation|howto/video-motion-estimation-howto]]
++- [[Stand Alone Unit Test|howto/stand-alone-utest-howto]]
The wiki URL is as below:
[http://www.freedesktop.org/wiki/Software/Beignet/](http://www.freedesktop.org/wiki/Software/Beignet/)
diff --git a/debian/patches/find-llvm37.patch b/debian/patches/find-llvm37.patch
deleted file mode 100644
index a600c43..0000000
--- a/debian/patches/find-llvm37.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Description: Accept LLVM/Clang 3.7 or 3.8
-
-Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
-Forwarded: (3.7 only) https://lists.freedesktop.org/archives/beignet/2016-April/007444.html
-
---- beignet-1.1.2.orig/CMake/FindLLVM.cmake
-+++ beignet-1.1.2/CMake/FindLLVM.cmake
-@@ -8,12 +8,12 @@
- # LLVM_FOUND - True if llvm found.
- if (LLVM_INSTALL_DIR)
- find_program(LLVM_CONFIG_EXECUTABLE
-- NAMES llvm-config-35 llvm-config-3.5 llvm-config-36 llvm-config-3.6 llvm-config-33 llvm-config-3.3 llvm-config-34 llvm-config-3.4 llvm-config
-+ NAMES llvm-config-35 llvm-config-3.5 llvm-config-36 llvm-config-3.6 llvm-config-37 llvm-config-3.7 llvm-config-38 llvm-config-3.8 llvm-config-33 llvm-config-3.3 llvm-config-34 llvm-config-3.4 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-35 llvm-config-3.5 llvm-config-36 llvm-config-3.6 llvm-config-33 llvm-config-3.3 llvm-config-34 llvm-config-3.4 llvm-config
-+ NAMES llvm-config-35 llvm-config-3.5 llvm-config-36 llvm-config-3.6 llvm-config-37 llvm-config-3.7 llvm-config-38 llvm-config-3.8 llvm-config-33 llvm-config-3.3 llvm-config-34 llvm-config-3.4 llvm-config
- DOC "llvm-config executable")
- endif (LLVM_INSTALL_DIR)
-
diff --git a/debian/patches/find-python35.patch b/debian/patches/find-python35.patch
index 3e21fab..0b30fd8 100644
--- a/debian/patches/find-python35.patch
+++ b/debian/patches/find-python35.patch
@@ -6,16 +6,13 @@ https://bugs.launchpad.net/ubuntu/+source/cmake/+bug/1515419
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 2ed8429..caa27c2 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -210,6 +210,7 @@ ELSE(OCLIcd_FOUND)
+--- beignet.orig/CMakeLists.txt
++++ beignet/CMakeLists.txt
+@@ -234,6 +234,7 @@ ELSE(OCLIcd_FOUND)
MESSAGE(STATUS "Looking for OCL ICD header file - not found")
ENDIF(OCLIcd_FOUND)
+set(Python_ADDITIONAL_VERSIONS 3.5)
Find_Package(PythonInterp)
- OPTION(BUILD_EXAMPLES "Build examples" OFF)
-
+ OPTION(EXPERIMENTAL_DOUBLE "Enable experimental double support" OFF)
diff --git a/debian/patches/gcc6-support.patch b/debian/patches/gcc6-support.patch
deleted file mode 100644
index a502663..0000000
--- a/debian/patches/gcc6-support.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Description: Add support for gcc 6
-
-Origin: upstream commit 356c856479207e2514d44d28456a70766691fccc
-Author: Pan Xiuli <xiuli.pan at intel.com>
-Bug-Debian: https://bugs.debian.org/831196
-
-diff --git a/backend/src/ir/immediate.hpp b/backend/src/ir/immediate.hpp
-index 3141643..6bc60d5 100644
---- a/backend/src/ir/immediate.hpp
-+++ b/backend/src/ir/immediate.hpp
-@@ -343,7 +343,7 @@ namespace ir {
- float *f32;
- double *f64;
- half *f16;
-- const Immediate *immVec[];
-+ const Immediate **immVec;
- void *p;
- } data; //!< Value to store
- Immediate operator+ (const Immediate &) const;
-diff --git a/utests/builtin_exp.cpp b/utests/builtin_exp.cpp
-index 406d223..1eaa187 100644
---- a/utests/builtin_exp.cpp
-+++ b/utests/builtin_exp.cpp
-@@ -5,7 +5,7 @@
- #define udebug 1
-
- #define FLT_MAX 0x1.fffffep127f
--#define FLT_MIN 0x1.0p-126f
-+#define FLT_MIN ldexp(1.0,-126)
- #define FLT_ULP (1.0e-6f)
-
- #define printf_c(...) \
-diff --git a/utests/utest_generator.py b/utests/utest_generator.py
-index 84029da..38d9ea0 100644
---- a/utests/utest_generator.py
-+++ b/utests/utest_generator.py
-@@ -4,8 +4,8 @@ import os,sys,re
-
- FLT_MAX_POSI='0x1.fffffep127f'
- FLT_MIN_NEGA='-0x1.fffffep127f'
--FLT_MIN_POSI='0x1.0p-126f'
--FLT_MAX_NEGA='-0x1.0p-126f'
-+FLT_MIN_POSI='ldexp(1.0, -126)'
-+FLT_MAX_NEGA='ldexp(-1.0, -126)'
-
- paraTypeList={'float':'%e','int':'%d','double':'%lf','uint':'%d','string':'%s'}
-
diff --git a/debian/patches/llvm38-support.patch b/debian/patches/llvm38-support.patch
deleted file mode 100644
index 4db92e7..0000000
--- a/debian/patches/llvm38-support.patch
+++ /dev/null
@@ -1,676 +0,0 @@
-Description: Backend Add support for LLVM release 3.8
-
-Ubuntu mesa uses 3.8, and it is preferred to use the same LLVM for all ICDs
-to prevent crashes when they are used together:
-http://lists.alioth.debian.org/pipermail/pkg-opencl-devel/Week-of-Mon-20160418/000963.html
-
-Origin: upstream e529586d062450007acf942fc7c73269db5a0fbe
-Author: Pan Xiuli
-
-diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
-index 4577990..2ee1d32 100644
---- a/backend/src/backend/gen_program.cpp
-+++ b/backend/src/backend/gen_program.cpp
-@@ -407,7 +407,11 @@ namespace gbe {
- using namespace gbe;
- char* errMsg;
- if(((GenProgram*)dst_program)->module == NULL){
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ ((GenProgram*)dst_program)->module = llvm::CloneModule((llvm::Module*)((GenProgram*)src_program)->module).release();
-+#else
- ((GenProgram*)dst_program)->module = llvm::CloneModule((llvm::Module*)((GenProgram*)src_program)->module);
-+#endif
- errSize = 0;
- }else{
- llvm::Module* src = (llvm::Module*)((GenProgram*)src_program)->module;
-diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
-index 145eb0f..e0ba6b4 100644
---- a/backend/src/backend/program.cpp
-+++ b/backend/src/backend/program.cpp
-@@ -119,7 +119,11 @@ namespace gbe {
- ir::Unit *unit = new ir::Unit();
- llvm::Module * cloned_module = NULL;
- if(module){
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ cloned_module = llvm::CloneModule((llvm::Module*)module).release();
-+#else
- cloned_module = llvm::CloneModule((llvm::Module*)module);
-+#endif
- }
- if (llvmToGen(*unit, fileName, module, optLevel, OCL_STRICT_CONFORMANCE) == false) {
- if (fileName)
-diff --git a/backend/src/llvm/ExpandConstantExpr.cpp b/backend/src/llvm/ExpandConstantExpr.cpp
-index c6f57b8..e9ec3ab 100644
---- a/backend/src/llvm/ExpandConstantExpr.cpp
-+++ b/backend/src/llvm/ExpandConstantExpr.cpp
-@@ -115,7 +115,7 @@ static Value *expandConstantVector(Instruction *InsertPt, ConstantVector *CV) {
- Type *IntTy = IntegerType::get(CV->getContext(), 32);
-
- BasicBlock::iterator InsertPos(InsertPt);
-- IRBuilder<> IRB(InsertPos);
-+ IRBuilder<> IRB(&*InsertPos);
- Value *vec = UndefValue::get(CV->getType());
- for (int i = 0; i < elemNum; i++) {
- Value *idx = ConstantInt::get(IntTy, i);
-@@ -177,7 +177,7 @@ bool ExpandConstantExpr::runOnFunction(Function &Func) {
- for (BasicBlock::InstListType::iterator Inst = BB->begin(), E = BB->end();
- Inst != E;
- ++Inst) {
-- Modified |= expandInstruction(Inst);
-+ Modified |= expandInstruction(&*Inst);
- }
- }
- return Modified;
-diff --git a/backend/src/llvm/ExpandLargeIntegers.cpp b/backend/src/llvm/ExpandLargeIntegers.cpp
-index 20fdda9..00987cb 100644
---- a/backend/src/llvm/ExpandLargeIntegers.cpp
-+++ b/backend/src/llvm/ExpandLargeIntegers.cpp
-@@ -388,7 +388,7 @@ static void convertInstruction(Instruction *Inst, ConversionState &State,
- // Set the insert point *after* Inst, so that any instructions inserted here
- // will be visited again. That allows iterative expansion of types > i128.
- BasicBlock::iterator InsertPos(Inst);
-- IRBuilder<> IRB(++InsertPos);
-+ IRBuilder<> IRB(&*++InsertPos);
- StringRef Name = Inst->getName();
-
- if (PHINode *Phi = dyn_cast<PHINode>(Inst)) {
-diff --git a/backend/src/llvm/ExpandUtils.cpp b/backend/src/llvm/ExpandUtils.cpp
-index 801f969..a09d990 100644
---- a/backend/src/llvm/ExpandUtils.cpp
-+++ b/backend/src/llvm/ExpandUtils.cpp
-@@ -101,7 +101,7 @@ namespace llvm {
- Function *RecreateFunction(Function *Func, FunctionType *NewType) {
- Function *NewFunc = Function::Create(NewType, Func->getLinkage());
- NewFunc->copyAttributesFrom(Func);
-- Func->getParent()->getFunctionList().insert(Func, NewFunc);
-+ Func->getParent()->getFunctionList().insert(ilist_iterator<Function>(Func), NewFunc);
- NewFunc->takeName(Func);
- NewFunc->getBasicBlockList().splice(NewFunc->begin(),
- Func->getBasicBlockList());
-diff --git a/backend/src/llvm/PromoteIntegers.cpp b/backend/src/llvm/PromoteIntegers.cpp
-index b65440f..8759287 100644
---- a/backend/src/llvm/PromoteIntegers.cpp
-+++ b/backend/src/llvm/PromoteIntegers.cpp
-@@ -615,7 +615,7 @@ bool PromoteIntegers::runOnFunction(Function &F) {
- // Don't support changing the function arguments. This should not be
- // generated by clang.
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) {
-- Value *Arg = I;
-+ Value *Arg = &*I;
- if (shouldConvert(Arg)) {
- errs() << "Function " << F.getName() << ": " << *Arg << "\n";
- llvm_unreachable("Function has illegal integer/pointer argument");
-@@ -626,7 +626,7 @@ bool PromoteIntegers::runOnFunction(Function &F) {
- bool Modified = false;
- for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) {
- for (BasicBlock::iterator BBI = FI->begin(), BBE = FI->end(); BBI != BBE;) {
-- Instruction *Inst = BBI++;
-+ Instruction *Inst = &*BBI++;
- // Only attempt to convert an instruction if its result or any of its
- // operands are illegal.
- bool ShouldConvert = shouldConvert(Inst);
-diff --git a/backend/src/llvm/StripAttributes.cpp b/backend/src/llvm/StripAttributes.cpp
-index e6df312..3bf3853 100644
---- a/backend/src/llvm/StripAttributes.cpp
-+++ b/backend/src/llvm/StripAttributes.cpp
-@@ -98,7 +98,7 @@ bool StripAttributes::runOnFunction(Function &Func) {
- BB != E; ++BB) {
- for (BasicBlock::iterator Inst = BB->begin(), E = BB->end();
- Inst != E; ++Inst) {
-- CallSite Call(Inst);
-+ CallSite Call(&*Inst);
- if (Call)
- Call.setCallingConv(CallingConv::C);
- }
-diff --git a/backend/src/llvm/llvm_bitcode_link.cpp b/backend/src/llvm/llvm_bitcode_link.cpp
-index 56205bb..10fccf6 100644
---- a/backend/src/llvm/llvm_bitcode_link.cpp
-+++ b/backend/src/llvm/llvm_bitcode_link.cpp
-@@ -68,8 +68,9 @@ namespace gbe
- return oclLib;
- }
-
-- static bool materializedFuncCall(Module& src, Module& lib, llvm::Function &KF, std::set<std::string>& MFS)
-- {
-+ static bool materializedFuncCall(Module& src, Module& lib, llvm::Function& KF,
-+ std::set<std::string>& MFS,
-+ std::vector<GlobalValue *>&Gvs) {
- bool fromSrc = false;
- for (llvm::Function::iterator B = KF.begin(), BE = KF.end(); B != BE; B++) {
- for (BasicBlock::iterator instI = B->begin(),
-@@ -112,9 +113,10 @@ namespace gbe
- printf("Can not materialize the function: %s, because %s\n", fnName.c_str(), EC.message().c_str());
- return false;
- }
-+ Gvs.push_back((GlobalValue *)newMF);
- #endif
- }
-- if (!materializedFuncCall(src, lib, *newMF, MFS))
-+ if (!materializedFuncCall(src, lib, *newMF, MFS, Gvs))
- return false;
-
- }
-@@ -128,6 +130,7 @@ namespace gbe
- {
- LLVMContext& ctx = mod->getContext();
- std::set<std::string> materializedFuncs;
-+ std::vector<GlobalValue *> Gvs;
- Module* clonedLib = createOclBitCodeModule(ctx, strictMath);
- assert(clonedLib && "Can not create the beignet bitcode\n");
-
-@@ -173,10 +176,11 @@ namespace gbe
- if (!isKernelFunction(*SF)) continue;
- kernels.push_back(SF->getName().data());
-
-- if (!materializedFuncCall(*mod, *clonedLib, *SF, materializedFuncs)) {
-+ if (!materializedFuncCall(*mod, *clonedLib, *SF, materializedFuncs, Gvs)) {
- delete clonedLib;
- return NULL;
- }
-+ Gvs.push_back((GlobalValue *)&*SF);
- }
-
- if (kernels.empty()) {
-@@ -215,14 +219,43 @@ namespace gbe
- }
- #endif
-
-- if (!materializedFuncCall(*mod, *clonedLib, *newMF, materializedFuncs)) {
-+ if (!materializedFuncCall(*mod, *clonedLib, *newMF, materializedFuncs, Gvs)) {
- delete clonedLib;
- return NULL;
- }
-
-+ Gvs.push_back((GlobalValue *)newMF);
- kernels.push_back(f);
- }
-
-+ /* The llvm 3.8 now has a strict materialized check for all value by checking
-+ * module is materialized. If we want to use library as old style that just
-+ * materialize what we need, we need to remove what we did not need before
-+ * materialize all of the module. To do this, we need all of the builtin
-+ * funcitons and what are needed from the kernel functions, these functions
-+ * are materalized and are recorded in Gvs, the GlobalValue like PI are also
-+ * needed and are added. Now we could not use use_empty to check if the GVs
-+ * are needed before the module is marked as all materialized, so we just
-+ * materialize all of them as there are only 7 GVs. Then we use GVExtraction
-+ * pass to extract the functions and values in Gvs from the library module.
-+ * After extract what we need and remove what we do not need, we use
-+ * materializeAll to mark the module as materialized. */
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >=8
-+ /* Get all GlobalValue from module. */
-+ Module::GlobalListType &GVlist = clonedLib->getGlobalList();
-+ for(Module::global_iterator GVitr = GVlist.begin();GVitr != GVlist.end();++GVitr) {
-+ GlobalValue * GV = &*GVitr;
-+ clonedLib->materialize(GV);
-+ Gvs.push_back(GV);
-+ }
-+ llvm::legacy::PassManager Extract;
-+ /* Extract all values we need using GVExtractionPass. */
-+ Extract.add(createGVExtractionPass(Gvs, false));
-+ Extract.run(*clonedLib);
-+ /* Mark the library module as materialized for later use. */
-+ clonedLib->materializeAll();
-+#endif
-+
- /* the SPIR binary datalayout maybe different with beignet's bitcode */
- if(clonedLib->getDataLayout() != mod->getDataLayout())
- mod->setDataLayout(clonedLib->getDataLayout());
-diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
-index 17b65a1..c85133d 100644
---- a/backend/src/llvm/llvm_gen_backend.cpp
-+++ b/backend/src/llvm/llvm_gen_backend.cpp
-@@ -1120,7 +1120,7 @@ namespace gbe
- llvmInfo.typeName= (cast<MDString>(typeNameNode->getOperand(1 + argID)))->getString();
- bool isImage = llvmInfo.isImageType();
- if (I->getType()->isPointerTy() || isImage) {
-- BtiMap.insert(std::make_pair(I, getNewBti(I, isImage)));
-+ BtiMap.insert(std::make_pair(&*I, getNewBti(&*I, isImage)));
- }
- }
-
-@@ -1234,7 +1234,7 @@ namespace gbe
- // function argument
- for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) {
- if (I->getType()->isPointerTy()) {
-- findPointerEscape(I, mixedPtr, true, revisit);
-+ findPointerEscape(&*I, mixedPtr, true, revisit);
- }
- }
- // alloca
-@@ -1283,7 +1283,7 @@ namespace gbe
- while (isa<AllocaInst>(bbIter)) ++bbIter;
-
- IRBuilder<> Builder(&entry);
-- Builder.SetInsertPoint(bbIter);
-+ Builder.SetInsertPoint(&*bbIter);
-
- PointerType * AITy = cast<AllocaInst>(base)->getType();
- Value * btiArray = Builder.CreateAlloca(AITy->getElementType(), ArraySize, base->getName() + ".bti");
-@@ -1708,7 +1708,7 @@ namespace gbe
- }
-
- void GenWriter::simplifyTerminator(BasicBlock *bb) {
-- Value *value = --bb->end();
-+ Value *value = bb->getTerminator();
- BranchInst *I = NULL;
- if ((I = dyn_cast<BranchInst>(value)) != NULL) {
- if (I->isConditional() == false)
-@@ -1938,12 +1938,12 @@ namespace gbe
- }
-
- // function arguments are uniform values.
-- this->newRegister(I, NULL, true);
-+ this->newRegister(&*I, NULL, true);
-
- // add support for vector argument.
- if(type->isVectorTy()) {
- VectorType *vectorType = cast<VectorType>(type);
-- ir::Register reg = getRegister(I, 0);
-+ ir::Register reg = getRegister(&*I, 0);
- Type *elemType = vectorType->getElementType();
- const uint32_t elemSize = getTypeByteSize(unit, elemType);
- const uint32_t elemNum = vectorType->getNumElements();
-@@ -1953,7 +1953,7 @@ namespace gbe
- ir::Function& fn = ctx.getFunction();
- for(uint32_t i=1; i < elemNum; i++) {
- ir::PushLocation argLocation(fn, argID, elemSize*i);
-- reg = getRegister(I, i);
-+ reg = getRegister(&*I, i);
- ctx.appendPushedConstant(reg, argLocation); //add to push map for reg alloc
- }
- continue;
-@@ -1961,10 +1961,10 @@ namespace gbe
-
- GBE_ASSERTM(isScalarType(type) == true,
- "vector type in the function argument is not supported yet");
-- const ir::Register reg = getRegister(I);
-+ const ir::Register reg = getRegister(&*I);
- if (llvmInfo.isImageType()) {
- ctx.input(argName, ir::FunctionArgument::IMAGE, reg, llvmInfo, 4, 4, 0);
-- ctx.getFunction().getImageSet()->append(reg, &ctx, BtiMap.find(I)->second);
-+ ctx.getFunction().getImageSet()->append(reg, &ctx, BtiMap.find(&*I)->second);
- collectImageArgs(llvmInfo.accessQual, imageArgsInfo);
- continue;
- }
-@@ -1997,7 +1997,7 @@ namespace gbe
- const uint32_t align = getAlignmentByte(unit, pointed);
- switch (addrSpace) {
- case ir::MEM_GLOBAL:
-- ctx.input(argName, ir::FunctionArgument::GLOBAL_POINTER, reg, llvmInfo, ptrSize, align, BtiMap.find(I)->second);
-+ ctx.input(argName, ir::FunctionArgument::GLOBAL_POINTER, reg, llvmInfo, ptrSize, align, BtiMap.find(&*I)->second);
- break;
- case ir::MEM_LOCAL:
- ctx.input(argName, ir::FunctionArgument::LOCAL_POINTER, reg, llvmInfo, ptrSize, align, BTI_LOCAL);
-@@ -2665,12 +2665,12 @@ namespace gbe
-
- // First create all the labels (one per block) ...
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-- this->newLabelIndex(BB);
-+ this->newLabelIndex(&*BB);
-
- // Then, for all branch instructions that have conditions, see if we can
- // simplify the code by inverting condition code
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-- this->simplifyTerminator(BB);
-+ this->simplifyTerminator(&*BB);
-
- // gather loop info, which is useful for liveness analysis
- gatherLoopInfo(fn);
-@@ -2678,7 +2678,7 @@ namespace gbe
- // ... then, emit the instructions for all basic blocks
- pass = PASS_EMIT_INSTRUCTIONS;
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-- emitBasicBlock(BB);
-+ emitBasicBlock(&*BB);
- ctx.endFunction();
-
- // Liveness can be shared when we optimized the immediates and the MOVs
-@@ -3204,7 +3204,7 @@ namespace gbe
- Value *Callee = I.getCalledValue();
- GBE_ASSERT(ctx.getFunction().getProfile() == ir::PROFILE_OCL);
- GBE_ASSERT(isa<InlineAsm>(I.getCalledValue()) == false);
-- GBE_ASSERT(I.hasStructRetAttr() == false);
-+ if(I.getNumArgOperands()) GBE_ASSERT(I.hasStructRetAttr() == false);
-
- // We only support a small number of intrinsics right now
- if (Function *F = I.getCalledFunction()) {
-diff --git a/backend/src/llvm/llvm_includes.hpp b/backend/src/llvm/llvm_includes.hpp
-index fed3a18..d2deb90 100644
---- a/backend/src/llvm/llvm_includes.hpp
-+++ b/backend/src/llvm/llvm_includes.hpp
-@@ -122,4 +122,9 @@
-
- #include <clang/CodeGen/CodeGenAction.h>
-
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >=8
-+#include "llvm/Analysis/BasicAliasAnalysis.h"
-+#include "llvm/Analysis/TypeBasedAliasAnalysis.h"
-+#endif
-+
- #endif /* __GBE_IR_LLVM_INCLUDES_HPP__ */
-diff --git a/backend/src/llvm/llvm_intrinsic_lowering.cpp b/backend/src/llvm/llvm_intrinsic_lowering.cpp
-index b35d1e6..c26e96a 100644
---- a/backend/src/llvm/llvm_intrinsic_lowering.cpp
-+++ b/backend/src/llvm/llvm_intrinsic_lowering.cpp
-@@ -73,7 +73,7 @@ namespace gbe {
- Constant* FCache = M->getOrInsertFunction(NewFn,
- FunctionType::get(RetTy, ParamTys, false));
-
-- IRBuilder<> Builder(CI->getParent(), CI);
-+ IRBuilder<> Builder(CI->getParent(), BasicBlock::iterator(CI));
- SmallVector<Value *, 8> Args(ArgBegin, ArgEnd);
- CallInst *NewCI = Builder.CreateCall(FCache, Args);
- NewCI->setName(CI->getName());
-@@ -90,12 +90,12 @@ namespace gbe {
- DataLayout TD(M);
- LLVMContext &Context = BB.getContext();
- for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) {
-- Instruction *Inst = DI++;
-+ Instruction *Inst = &*DI++;
- CallInst* CI = dyn_cast<CallInst>(Inst);
- if(CI == NULL)
- continue;
-
-- IRBuilder<> Builder(&BB, CI);
-+ IRBuilder<> Builder(&BB, BasicBlock::iterator(CI));
- // only support memcpy and memset
- if (Function *F = CI->getCalledFunction()) {
- const Intrinsic::ID intrinsicID = (Intrinsic::ID) F->getIntrinsicID();
-diff --git a/backend/src/llvm/llvm_loadstore_optimization.cpp b/backend/src/llvm/llvm_loadstore_optimization.cpp
-index 698fdc2..121f53d 100644
---- a/backend/src/llvm/llvm_loadstore_optimization.cpp
-+++ b/backend/src/llvm/llvm_loadstore_optimization.cpp
-@@ -35,13 +35,22 @@ namespace gbe {
- GenLoadStoreOptimization() : BasicBlockPass(ID) {}
-
- void getAnalysisUsage(AnalysisUsage &AU) const {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ AU.addRequired<ScalarEvolutionWrapperPass>();
-+ AU.addPreserved<ScalarEvolutionWrapperPass>();
-+#else
- AU.addRequired<ScalarEvolution>();
- AU.addPreserved<ScalarEvolution>();
-+#endif
- AU.setPreservesCFG();
- }
-
- virtual bool runOnBasicBlock(BasicBlock &BB) {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
-+#else
- SE = &getAnalysis<ScalarEvolution>();
-+#endif
- #if LLVM_VERSION_MINOR >= 7
- TD = &BB.getModule()->getDataLayout();
- #elif LLVM_VERSION_MINOR >= 5
-@@ -159,9 +168,9 @@ namespace gbe {
- bool isLoad) {
-
- BasicBlock::iterator stepForward = start;
-- if(!isSimpleLoadStore(start)) return stepForward;
-+ if(!isSimpleLoadStore(&*start)) return stepForward;
-
-- merged.push_back(start);
-+ merged.push_back(&*start);
-
- BasicBlock::iterator E = BB.end();
- BasicBlock::iterator J = ++start;
-@@ -170,8 +179,8 @@ namespace gbe {
-
- for(unsigned ss = 0; J != E && ss <= maxLimit; ++ss, ++J) {
- if((isLoad && isa<LoadInst>(*J)) || (!isLoad && isa<StoreInst>(*J))) {
-- if(isLoadStoreCompatible(merged[merged.size()-1], J)) {
-- merged.push_back(J);
-+ if(isLoadStoreCompatible(merged[merged.size()-1], &*J)) {
-+ merged.push_back(&*J);
- stepForward = ++J;
- }
- } else if((isLoad && isa<StoreInst>(*J)) || (!isLoad && isa<LoadInst>(*J))) {
-@@ -217,7 +226,7 @@ namespace gbe {
- for (BasicBlock::iterator BBI = BB.begin(), E = BB.end(); BBI != E;++BBI) {
- if(isa<LoadInst>(*BBI) || isa<StoreInst>(*BBI)) {
- bool isLoad = isa<LoadInst>(*BBI) ? true: false;
-- Type *ty = getValueType(BBI);
-+ Type *ty = getValueType(&*BBI);
- if(ty->isVectorTy()) continue;
- // TODO Support DWORD/WORD/BYTE LOAD for store support DWORD only now.
- if (!(ty->isFloatTy() || ty->isIntegerTy(32) ||
-diff --git a/backend/src/llvm/llvm_printf_parser.cpp b/backend/src/llvm/llvm_printf_parser.cpp
-index 47688f7..4ae9eb0 100644
---- a/backend/src/llvm/llvm_printf_parser.cpp
-+++ b/backend/src/llvm/llvm_printf_parser.cpp
-@@ -635,7 +635,7 @@ error:
- Value* op0 = NULL;
- Value* val = NULL;
-
-- builder->SetInsertPoint(F.begin()->begin());// Insert the common var in the begin.
-+ builder->SetInsertPoint(&*(F.begin()->begin()));// Insert the common var in the begin.
-
- /* FIXME: Because the OpenCL language do not support va macro, and we do not want
- to introduce the va_list, va_start and va_end into our code, we just simulate
-diff --git a/backend/src/llvm/llvm_scalarize.cpp b/backend/src/llvm/llvm_scalarize.cpp
-index 7ee5259..dbc3544 100644
---- a/backend/src/llvm/llvm_scalarize.cpp
-+++ b/backend/src/llvm/llvm_scalarize.cpp
-@@ -197,7 +197,7 @@ namespace gbe {
- /* set to insert new instructions after the specified instruction.*/
- void setAppendPoint(Instruction *insn) {
- BasicBlock::iterator next(insn);
-- builder->SetInsertPoint(++next);
-+ builder->SetInsertPoint(&*++next);
- }
-
- DenseMap<Value*, VectorValues> vectorVals;
-@@ -759,7 +759,7 @@ namespace gbe {
- return;
- ReversePostOrderTraversal<Function*> rpot(&F);
- BasicBlock::iterator instI = (*rpot.begin())->begin();
-- builder->SetInsertPoint(instI);
-+ builder->SetInsertPoint(&*instI);
-
- Function::arg_iterator I = F.arg_begin(), E = F.arg_end();
-
-@@ -767,7 +767,7 @@ namespace gbe {
- Type *type = I->getType();
-
- if(type->isVectorTy())
-- extractFromVector(I);
-+ extractFromVector(&*I);
- }
- return;
- }
-@@ -804,11 +804,11 @@ namespace gbe {
- RPOTType rpot(&F);
- for (RPOTType::rpo_iterator bbI = rpot.begin(), bbE = rpot.end(); bbI != bbE; ++bbI) {
- for (BasicBlock::iterator instI = (*bbI)->begin(), instE = (*bbI)->end(); instI != instE; ++instI) {
-- bool scalarized = scalarize(instI);
-+ bool scalarized = scalarize(&*instI);
- if (scalarized) {
- changed = true;
- // TODO: uncomment when done
-- deadList.push_back(instI);
-+ deadList.push_back(&*instI);
- }
- }
- }
-diff --git a/backend/src/llvm/llvm_to_gen.cpp b/backend/src/llvm/llvm_to_gen.cpp
-index 24d4be7..b8d6a02 100644
---- a/backend/src/llvm/llvm_to_gen.cpp
-+++ b/backend/src/llvm/llvm_to_gen.cpp
-@@ -45,7 +45,6 @@ namespace gbe
- using namespace llvm;
-
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-- using namespace llvm::legacy;
- #define TARGETLIBRARY TargetLibraryInfoImpl
- #else
- #define TARGETLIBRARY TargetLibraryInfo
-@@ -53,7 +52,11 @@ namespace gbe
-
- void runFuntionPass(Module &mod, TARGETLIBRARY *libraryInfo, const DataLayout &DL)
- {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-+ legacy::FunctionPassManager FPM(&mod);
-+#else
- FunctionPassManager FPM(&mod);
-+#endif
-
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
- #elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6
-@@ -74,8 +77,13 @@ namespace gbe
- #else
- FPM.add(new TargetLibraryInfo(*libraryInfo));
- #endif
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ FPM.add(createTypeBasedAAWrapperPass());
-+ FPM.add(createBasicAAWrapperPass());
-+#else
- FPM.add(createTypeBasedAliasAnalysisPass());
- FPM.add(createBasicAliasAnalysisPass());
-+#endif
- FPM.add(createCFGSimplificationPass());
- FPM.add(createSROAPass());
- FPM.add(createEarlyCSEPass());
-@@ -91,7 +99,11 @@ namespace gbe
-
- void runModulePass(Module &mod, TARGETLIBRARY *libraryInfo, const DataLayout &DL, int optLevel, bool strictMath)
- {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-+ legacy::PassManager MPM;
-+#else
- PassManager MPM;
-+#endif
-
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
- #elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6
-@@ -107,8 +119,13 @@ namespace gbe
- #else
- MPM.add(new TargetLibraryInfo(*libraryInfo));
- #endif
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createTypeBasedAAWrapperPass());
-+ MPM.add(createBasicAAWrapperPass());
-+#else
- MPM.add(createTypeBasedAliasAnalysisPass());
- MPM.add(createBasicAliasAnalysisPass());
-+#endif
- MPM.add(createIntrinsicLoweringPass());
- MPM.add(createStripAttributesPass()); // Strip unsupported attributes and calling conventions.
- MPM.add(createSamplerFixPass());
-@@ -123,11 +140,19 @@ namespace gbe
- MPM.add(createBarrierNodupPass(false)); // remove noduplicate fnAttr before inlining.
- MPM.add(createFunctionInliningPass(20000));
- MPM.add(createBarrierNodupPass(true)); // restore noduplicate fnAttr after inlining.
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createPostOrderFunctionAttrsPass()); // Set readonly/readnone attrs
-+#else
- MPM.add(createFunctionAttrsPass()); // Set readonly/readnone attrs
-+#endif
-
- //MPM.add(createScalarReplAggregatesPass(64, true, -1, -1, 64))
- if(optLevel > 0)
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createSROAPass());
-+#else
- MPM.add(createSROAPass(/*RequiresDomTree*/ false));
-+#endif
- MPM.add(createEarlyCSEPass()); // Catch trivial redundancies
- MPM.add(createJumpThreadingPass()); // Thread jumps.
- MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals
-@@ -146,7 +171,11 @@ namespace gbe
- MPM.add(createLoopDeletionPass()); // Delete dead loops
- MPM.add(createLoopUnrollPass(1024)); //1024, 32, 1024, 512)); //Unroll loops
- if(optLevel > 0) {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createSROAPass());
-+#else
- MPM.add(createSROAPass(/*RequiresDomTree*/ false));
-+#endif
- MPM.add(createGVNPass()); // Remove redundancies
- }
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
-@@ -157,7 +186,11 @@ namespace gbe
- MPM.add(createCustomLoopUnrollPass()); //1024, 32, 1024, 512)); //Unroll loops
- MPM.add(createLoopUnrollPass()); //1024, 32, 1024, 512)); //Unroll loops
- if(optLevel > 0) {
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ MPM.add(createSROAPass());
-+#else
- MPM.add(createSROAPass(/*RequiresDomTree*/ false));
-+#endif
- MPM.add(createGVNPass()); // Remove redundancies
- }
- }
-@@ -184,7 +217,15 @@ namespace gbe
- }
-
-
--#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-+#define OUTPUT_BITCODE(STAGE, MOD) do { \
-+ legacy::PassManager passes__; \
-+ if (OCL_OUTPUT_LLVM_##STAGE) { \
-+ passes__.add(createPrintModulePass(*o)); \
-+ passes__.run(MOD); \
-+ } \
-+ }while(0)
-+#elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
- #define OUTPUT_BITCODE(STAGE, MOD) do { \
- PassManager passes__; \
- if (OCL_OUTPUT_LLVM_##STAGE) { \
-@@ -255,7 +296,11 @@ namespace gbe
-
- runFuntionPass(mod, libraryInfo, DL);
- runModulePass(mod, libraryInfo, DL, optLevel, strictMath);
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
-+ legacy::PassManager passes;
-+#else
- PassManager passes;
-+#endif
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
- #elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6
- passes.add(new DataLayoutPass());
-diff --git a/backend/src/llvm/llvm_unroll.cpp b/backend/src/llvm/llvm_unroll.cpp
-index 6990e39..0f62bdc 100644
---- a/backend/src/llvm/llvm_unroll.cpp
-+++ b/backend/src/llvm/llvm_unroll.cpp
-@@ -47,8 +47,13 @@ namespace gbe {
- AU.addPreservedID(LoopSimplifyID);
- AU.addRequiredID(LCSSAID);
- AU.addPreservedID(LCSSAID);
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ AU.addRequired<ScalarEvolutionWrapperPass>();
-+ AU.addPreserved<ScalarEvolutionWrapperPass>();
-+#else
- AU.addRequired<ScalarEvolution>();
- AU.addPreserved<ScalarEvolution>();
-+#endif
- // FIXME: Loop unroll requires LCSSA. And LCSSA requires dom info.
- // If loop unroll does not preserve dom info then LCSSA pass on next
- // loop will receive invalid dom info.
-@@ -156,7 +161,12 @@ namespace gbe {
- // be unrolled.
- bool handleParentLoops(Loop *L, LPPassManager &LPM) {
- Loop *currL = L;
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ ScalarEvolution *SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
-+ LoopInfo &loopInfo = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
-+#else
- ScalarEvolution *SE = &getAnalysis<ScalarEvolution>();
-+#endif
- BasicBlock *ExitBlock = currL->getLoopLatch();
- if (!ExitBlock || !L->isLoopExiting(ExitBlock))
- ExitBlock = currL->getExitingBlock();
-@@ -183,7 +193,11 @@ namespace gbe {
- shouldUnroll = false;
- setUnrollID(currL, false);
- if (currL != L)
-+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8
-+ loopInfo.markAsRemoved(currL);
-+#else
- LPM.deleteLoopFromQueue(currL);
-+#endif
- }
- currL = parentL;
- currTripCount = parentTripCount;
diff --git a/debian/patches/noassert-missing-function.patch b/debian/patches/noassert-missing-function.patch
deleted file mode 100644
index 6393d9c..0000000
--- a/debian/patches/noassert-missing-function.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-Description: Return error, don't assert-fail, on bad input
-
-As Beignet inlines all functions and does not otherwise support
-function calls, attempting to call a non-existent function is a
-codegen-time (not link-time) error, which currently print a message to
-stderr (which might not be visible in a graphical application) then
-assert-fail. This replaces this with an error in the build log.
-
-This is mostly for the benefit of jessie-backports (llvm 3.5), as
-sid (llvm 3.7) rejects these before getting this far.
-
-Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
-Forwarded: https://lists.freedesktop.org/archives/beignet/2016-June/007626.html
-
---- beignet-1.1.2.orig/backend/src/backend/program.cpp
-+++ beignet-1.1.2/backend/src/backend/program.cpp
-@@ -125,7 +125,7 @@ namespace gbe {
- cloned_module = llvm::CloneModule((llvm::Module*)module);
- #endif
- }
-- if (llvmToGen(*unit, fileName, module, optLevel, OCL_STRICT_CONFORMANCE) == false) {
-+ if (llvmToGen(*unit, fileName, module, optLevel, OCL_STRICT_CONFORMANCE, error) == false) {
- if (fileName)
- error = std::string(fileName) + " not found";
- delete unit;
-@@ -138,19 +138,24 @@ namespace gbe {
- unit = new ir::Unit();
- if(cloned_module){
- //suppose file exists and llvmToGen will not return false.
-- llvmToGen(*unit, fileName, cloned_module, 0, OCL_STRICT_CONFORMANCE);
-+ llvmToGen(*unit, fileName, cloned_module, 0, OCL_STRICT_CONFORMANCE, error);
- }else{
- //suppose file exists and llvmToGen will not return false.
-- llvmToGen(*unit, fileName, module, 0, OCL_STRICT_CONFORMANCE);
-+ llvmToGen(*unit, fileName, module, 0, OCL_STRICT_CONFORMANCE, error);
- }
- }
-- assert(unit->getValid());
-- this->buildFromUnit(*unit, error);
-+ bool ret = false;
-+ if(unit->getValid()){
-+ std::string error2;
-+ this->buildFromUnit(*unit, error2);
-+ error = error + error2;
-+ ret = true;
-+ }
- delete unit;
- if(cloned_module){
- delete (llvm::Module*) cloned_module;
- }
-- return true;
-+ return ret;
- }
-
- bool Program::buildFromUnit(const ir::Unit &unit, std::string &error) {
---- beignet-1.1.2.orig/backend/src/llvm/llvm_gen_backend.cpp
-+++ beignet-1.1.2/backend/src/llvm/llvm_gen_backend.cpp
-@@ -437,6 +437,7 @@ namespace gbe
- Function *Func;
- const Module *TheModule;
- int btiBase;
-+ bool has_errors;
- public:
- static char ID;
- explicit GenWriter(ir::Unit &unit)
-@@ -446,7 +447,8 @@ namespace gbe
- regTranslator(ctx),
- LI(0),
- TheModule(0),
-- btiBase(BTI_RESERVED_NUM)
-+ btiBase(BTI_RESERVED_NUM),
-+ has_errors(false)
- {
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >=7
- initializeLoopInfoWrapperPassPass(*PassRegistry::getPassRegistry());
-@@ -2662,6 +2664,9 @@ namespace gbe
- pass = PASS_EMIT_REGISTERS;
- for (inst_iterator I = inst_begin(&F), E = inst_end(&F); I != E; ++I)
- visit(*I);
-+
-+ // Abort if this found an error (otherwise emitBasicBlock will assert)
-+ if(has_errors){return;}
-
- // First create all the labels (one per block) ...
- for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-@@ -3440,11 +3445,8 @@ namespace gbe
- break;
- case GEN_OCL_NOT_FOUND:
- default:
-- std::cerr << "Caller instruction: " << std::endl;
-- I.dump();
-- std::cerr << "Callee function: " << std::endl;
-- Callee->dump();
-- GBE_ASSERT(0);
-+ has_errors = true;
-+ Func->getContext().emitError(&I,"function '" + fnName + "' not found or cannot be inlined");
- };
- }
-
---- beignet-1.1.2.orig/backend/src/llvm/llvm_to_gen.cpp
-+++ beignet-1.1.2/backend/src/llvm/llvm_to_gen.cpp
-@@ -26,6 +26,8 @@
-
- #include "llvm/llvm_gen_backend.hpp"
- #include "llvm/llvm_to_gen.hpp"
-+#include <llvm/IR/DiagnosticInfo.h>
-+#include <llvm/IR/DiagnosticPrinter.h>
- #include "sys/cvar.hpp"
- #include "sys/platform.hpp"
- #include "ir/unit.hpp"
-@@ -246,8 +248,36 @@ namespace gbe
- BVAR(OCL_OUTPUT_LLVM_BEFORE_LINK, false);
- BVAR(OCL_OUTPUT_LLVM_AFTER_LINK, false);
- BVAR(OCL_OUTPUT_LLVM_AFTER_GEN, false);
-+
-+ class gbeDiagnosticContext
-+ {
-+ public:
-+ gbeDiagnosticContext() : _str(""), messages(_str), printer(messages), _has_errors(false) {}
-+ void process(const llvm::DiagnosticInfo &diagnostic)
-+ {
-+ if (diagnostic.getSeverity() != DS_Remark) { // avoid noise from function inlining remarks
-+ diagnostic.print(printer);
-+ }
-+ if (diagnostic.getSeverity() == DS_Error) {
-+ _has_errors = true;
-+ }
-+ }
-+ std::string str(){return messages.str();}
-+ bool has_errors(){return _has_errors;}
-+ private:
-+ std::string _str;
-+ llvm::raw_string_ostream messages;
-+ llvm::DiagnosticPrinterRawOStream printer;
-+ bool _has_errors;
-+ };
-+
-+ void gbeDiagnosticHandler(const llvm::DiagnosticInfo &diagnostic, void *context)
-+ {
-+ gbeDiagnosticContext *dc = reinterpret_cast<gbeDiagnosticContext*>(context);
-+ dc->process(diagnostic);
-+ }
-
-- bool llvmToGen(ir::Unit &unit, const char *fileName,const void* module, int optLevel, bool strictMath)
-+ bool llvmToGen(ir::Unit &unit, const char *fileName,const void* module, int optLevel, bool strictMath, std::string &errors)
- {
- std::string errInfo;
- std::unique_ptr<llvm::raw_fd_ostream> o = NULL;
-@@ -284,6 +314,9 @@ namespace gbe
-
- Module &mod = *M.get();
- DataLayout DL(&mod);
-+
-+ gbeDiagnosticContext dc;
-+ mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler,&dc);
-
- #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
- mod.setDataLayout(DL);
-@@ -339,6 +372,12 @@ namespace gbe
- passes.add(createCFGOnlyPrinterPass());
- passes.add(createGenPass(unit));
- passes.run(mod);
-+ errors = dc.str();
-+ if(dc.has_errors()){
-+ unit.setValid(false);
-+ delete libraryInfo;
-+ return true;
-+ }
-
- // Print the code extra optimization passes
- OUTPUT_BITCODE(AFTER_GEN, mod);
---- beignet-1.1.2.orig/backend/src/llvm/llvm_to_gen.hpp
-+++ beignet-1.1.2/backend/src/llvm/llvm_to_gen.hpp
-@@ -32,7 +32,7 @@ namespace gbe {
-
- /*! Convert the LLVM IR code to a GEN IR code,
- optLevel 0 equal to clang -O1 and 1 equal to clang -O2*/
-- bool llvmToGen(ir::Unit &unit, const char *fileName, const void* module, int optLevel, bool strictMath);
-+ bool llvmToGen(ir::Unit &unit, const char *fileName, const void* module, int optLevel, bool strictMath, std::string &errors);
-
- } /* namespace gbe */
-
diff --git a/debian/patches/printf-fix-90472.patch b/debian/patches/printf-fix-90472.patch
deleted file mode 100644
index 63d09a3..0000000
--- a/debian/patches/printf-fix-90472.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Description: reset the variables in printf_parser to NULL.
-
-the PrintfParser variables g1Xg2Xg3 and wg_offset should be reinit
-after the builder is deleted, or else the variables will be freed and
-caused memory leak or crash
-
-Author: Luo Xionghu <xionghu.luo at intel.com>
-Origin: upstream http://cgit.freedesktop.org/beignet/commit/?id=dcc189bed5b395d6fbcdffa29e60e68cf1071310
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90472
-
-diff --git a/backend/src/llvm/llvm_printf_parser.cpp b/backend/src/llvm/llvm_printf_parser.cpp
-index 1e8427c..bdaed8a 100644
---- a/backend/src/llvm/llvm_printf_parser.cpp
-+++ b/backend/src/llvm/llvm_printf_parser.cpp
-@@ -723,6 +723,8 @@ error:
-
- deadprintfs.clear();
- delete builder;
-+ g1Xg2Xg3 = NULL;
-+ wg_offset = NULL;
-
- return changed;
- }
-
diff --git a/debian/patches/profiling-32on64.patch b/debian/patches/profiling-32on64.patch
deleted file mode 100644
index 0aed9ae..0000000
--- a/debian/patches/profiling-32on64.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Description: Fix profiling in i386 applications on amd64 kernel
-
-The profiling timestamp format depends on the kernel's architecture,
-which may not be the same as the application's.
-
-Origin: upstream
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95245
-Author: Yang Rong <rong.r.yang at intel.com>
----
- src/intel/intel_gpgpu.c | 14 +++++++++-----
- 1 file changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/src/intel/intel_gpgpu.c b/src/intel/intel_gpgpu.c
-index 39b7e4d..db967e8 100644
---- a/src/intel/intel_gpgpu.c
-+++ b/src/intel/intel_gpgpu.c
-@@ -2243,11 +2243,15 @@ intel_gpgpu_read_ts_reg_gen7(drm_intel_bufmgr *bufmgr)
- i386 system. It seems the kernel readq bug. So shift 32 bit in x86_64, and only remain
- 32 bits data in i386.
- */
--#ifdef __i386__
-- return result & 0x0ffffffff;
--#else
-- return result >> 32;
--#endif /* __i386__ */
-+ struct utsname buf;
-+ uname(&buf);
-+ /* In some systems, the user space is 32 bit, but kernel is 64 bit, so can't use the
-+ * compiler's flag to determine the kernel'a architecture, use uname to get it. */
-+ /* x86_64 in linux, amd64 in bsd */
-+ if(strcmp(buf.machine, "x86_64") == 0 || strcmp(buf.machine, "amd64") == 0)
-+ return result >> 32;
-+ else
-+ return result & 0x0ffffffff;
- }
-
- /* baytrail's result should clear high 4 bits */
---
-2.1.4
-
diff --git a/debian/patches/reduce-notfound-output.patch b/debian/patches/reduce-notfound-output.patch
index 722cbd2..47285c8 100644
--- a/debian/patches/reduce-notfound-output.patch
+++ b/debian/patches/reduce-notfound-output.patch
@@ -6,9 +6,9 @@ Replace these with one message that explicitly says what to do.
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
---- beignet-1.0.1.orig/src/cl_device_id.c
-+++ beignet-1.0.1/src/cl_device_id.c
-@@ -527,10 +527,10 @@ brw_gt3_break:
+--- beignet.orig/src/cl_device_id.c
++++ beignet/src/cl_device_id.c
+@@ -743,10 +743,10 @@ kbl_gt4_break:
case PCI_CHIP_SANDYBRIDGE_BRIDGE_S:
case PCI_CHIP_SANDYBRIDGE_S_GT:
// Intel(R) HD Graphics SandyBridge not supported yet
@@ -21,9 +21,9 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
}
if (ret == NULL)
---- beignet-1.0.1.orig/src/intel/intel_driver.c
-+++ beignet-1.0.1/src/intel/intel_driver.c
-@@ -242,7 +242,6 @@ intel_driver_open(intel_driver_t *intel,
+--- beignet.orig/src/intel/intel_driver.c
++++ beignet/src/intel/intel_driver.c
+@@ -240,7 +240,6 @@ intel_driver_open(intel_driver_t *intel,
}
if(!intel_driver_is_active(intel)) {
@@ -31,7 +31,7 @@ Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
return CL_DEVICE_NOT_FOUND;
}
-@@ -299,7 +298,6 @@ intel_driver_init_master(intel_driver_t
+@@ -301,7 +300,6 @@ intel_driver_init_master(intel_driver_t
// usually dev_name = "/dev/dri/card%d"
dev_fd = open(dev_name, O_RDWR);
if (dev_fd == -1) {
diff --git a/debian/patches/series b/debian/patches/series
index 89b1332..ae6269c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,12 +4,6 @@ reduce-notfound-output.patch
shared-llvm.patch
update-docs.patch
allow-+-in-directory.patch
-printf-fix-90472.patch
-std-isnan-isinf.patch
Enable-test-debug.patch
-llvm38-support.patch
find-python35.patch
-profiling-32on64.patch
-noassert-missing-function.patch
-gcc6-support.patch
docs-broken-links.patch
diff --git a/debian/patches/shared-llvm.patch b/debian/patches/shared-llvm.patch
index 2a68f15..d2bc0fa 100644
--- a/debian/patches/shared-llvm.patch
+++ b/debian/patches/shared-llvm.patch
@@ -5,9 +5,9 @@ probably due to #698247
Author: Rebecca Palmer <rebecca_palmer at zoho.com>
---- beignet-1.0.2.orig/CMake/FindLLVM.cmake
-+++ beignet-1.0.2/CMake/FindLLVM.cmake
-@@ -87,20 +87,7 @@ execute_process(
+--- beignet.orig/CMake/FindLLVM.cmake
++++ beignet/CMake/FindLLVM.cmake
+@@ -87,22 +87,7 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
@@ -23,10 +23,11 @@ Author: Rebecca Palmer <rebecca_palmer at zoho.com>
- OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_ORIG
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
+-if (LLVM_SYSTEM_LIBS_ORIG)
-string(REGEX REPLACE " *\n" "" LLVM_SYSTEM_LIBS ${LLVM_SYSTEM_LIBS_ORIG})
+-endif (LLVM_SYSTEM_LIBS_ORIG)
-endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
+set(LLVM_MODULE_LIBS "-lLLVM-${LLVM_VERSION}")
macro(add_one_lib name)
FIND_LIBRARY(CLANG_LIB
-
diff --git a/debian/patches/std-isnan-isinf.patch b/debian/patches/std-isnan-isinf.patch
deleted file mode 100644
index bc4bea6..0000000
--- a/debian/patches/std-isnan-isinf.patch
+++ /dev/null
@@ -1,248 +0,0 @@
-Description: Prepend std namespace to isnan and isinf calls.
-
-Needed in Ubuntu to avoid FTBFS.
-
-Origin: upstream 14bd8855dddcf683df8138c1062bc65b05d46f94
-Author: Sean Lynch
-diff --git a/utests/builtin_acos_asin.cpp b/utests/builtin_acos_asin.cpp
-index 0187226..395460b 100644
---- a/utests/builtin_acos_asin.cpp
-+++ b/utests/builtin_acos_asin.cpp
-@@ -59,10 +59,10 @@ static void builtin_acos_asin(void)
- {
- index_cur = k * max_function + i;
- #if udebug
-- if (isinf(cpu_data[index_cur]) && !isinf(gpu_data[index_cur])){
-+ if (std::isinf(cpu_data[index_cur]) && !std::isinf(gpu_data[index_cur])){
- printf_c("%d/%d: %f -> gpu:%f cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);
- }
-- else if (isnan(cpu_data[index_cur]) && !isnan(gpu_data[index_cur])){
-+ else if (std::isnan(cpu_data[index_cur]) && !std::isnan(gpu_data[index_cur])){
- printf_c("%d/%d: %f -> gpu:%f cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);
- }
- else if(fabs(gpu_data[index_cur] - cpu_data[index_cur]) > 1e-3f){
-@@ -71,10 +71,10 @@ static void builtin_acos_asin(void)
- else
- printf("%d/%d: %f -> gpu:%f cpu:%f\n", k, i, input_data[k], gpu_data[index_cur], cpu_data[index_cur]);
- #else
-- if (isinf(cpu_data[index_cur]))
-- OCL_ASSERT(isinf(gpu_data[index_cur]));
-- else if (isnan(cpu_data[index_cur]))
-- OCL_ASSERT(isnan(gpu_data[index_cur]));
-+ if (std::isinf(cpu_data[index_cur]))
-+ OCL_ASSERT(std::isinf(gpu_data[index_cur]));
-+ else if (std::isnan(cpu_data[index_cur]))
-+ OCL_ASSERT(std::isnan(gpu_data[index_cur]));
- else
- {
- OCL_ASSERT(fabs(gpu_data[index_cur] - cpu_data[index_cur]) < 1e-3f);
-diff --git a/utests/builtin_exp.cpp b/utests/builtin_exp.cpp
-index d5288c8..406d223 100644
---- a/utests/builtin_exp.cpp
-+++ b/utests/builtin_exp.cpp
-@@ -71,10 +71,10 @@ static void builtin_exp(void)
- diff/gpu_data[index_cur], 3 * FLT_ULP);
-
- #if udebug
-- if (isinf(cpu_data[index_cur]) && isinf(gpu_data[index_cur])){
-+ if (std::isinf(cpu_data[index_cur]) && std::isinf(gpu_data[index_cur])){
- printf(log);
- }
-- else if (isnan(cpu_data[index_cur]) && isnan(gpu_data[index_cur])){
-+ else if (std::isnan(cpu_data[index_cur]) && std::isnan(gpu_data[index_cur])){
- printf(log);
- }
- else if( diff / cpu_data[index_cur] < 3 * FLT_ULP \
-@@ -86,10 +86,10 @@ static void builtin_exp(void)
- else
- printf_c(log);
- #else
-- if (isinf(cpu_data[index_cur]))
-- OCL_ASSERTM(isinf(gpu_data[index_cur]), log);
-- else if (isnan(cpu_data[index_cur]))
-- OCL_ASSERTM(isnan(gpu_data[index_cur]), log);
-+ if (std::isinf(cpu_data[index_cur]))
-+ OCL_ASSERTM(std::isinf(gpu_data[index_cur]), log);
-+ else if (std::isnan(cpu_data[index_cur]))
-+ OCL_ASSERTM(std::isnan(gpu_data[index_cur]), log);
- else if ( gpu_data[index_cur] > FLT_ULP || cpu_data[index_cur] > FLT_ULP)
- OCL_ASSERTM(fabs( diff / cpu_data[index_cur]) < 3 * FLT_ULP, log);
- else
-diff --git a/utests/builtin_pow.cpp b/utests/builtin_pow.cpp
-index f586448..21fa895 100644
---- a/utests/builtin_pow.cpp
-+++ b/utests/builtin_pow.cpp
-@@ -74,8 +74,8 @@ static void builtin_pow(void)
- {
- index_cur = k * max_function + i;
- #if udebug
-- if ( (isinf(cpu_data[index_cur]) && !isinf(gpu_data[index_cur])) ||
-- (isnan(cpu_data[index_cur]) && !isnan(gpu_data[index_cur])) ||
-+ if ( (std::isinf(cpu_data[index_cur]) && !std::isinf(gpu_data[index_cur])) ||
-+ (std::isnan(cpu_data[index_cur]) && !std::isnan(gpu_data[index_cur])) ||
- (fabs(gpu_data[index_cur] - cpu_data[index_cur]) > cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR
- && (denormals_supported || gpu_data[index_cur]!=0 || std::fpclassify(cpu_data[index_cur])!=FP_SUBNORMAL) ) )
-
-@@ -85,10 +85,10 @@ static void builtin_pow(void)
- else
- printf("%d/%d: x:%f, y:%f -> gpu:%f cpu:%f\n", k, i, input_data1[k], input_data2[k], gpu_data[index_cur], cpu_data[index_cur]);
- #else
-- if (isinf(cpu_data[index_cur]))
-- OCL_ASSERT(isinf(gpu_data[index_cur]));
-- else if (isnan(cpu_data[index_cur]))
-- OCL_ASSERT(isnan(gpu_data[index_cur]));
-+ if (std::isinf(cpu_data[index_cur]))
-+ OCL_ASSERT(std::isinf(gpu_data[index_cur]));
-+ else if (std::isnan(cpu_data[index_cur]))
-+ OCL_ASSERT(std::isnan(gpu_data[index_cur]));
- else
- {
- OCL_ASSERT((fabs(gpu_data[index_cur] - cpu_data[index_cur]) < cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR) ||
-diff --git a/utests/builtin_tgamma.cpp b/utests/builtin_tgamma.cpp
-index db9ab3c..204f49e 100644
---- a/utests/builtin_tgamma.cpp
-+++ b/utests/builtin_tgamma.cpp
-@@ -43,8 +43,8 @@ void builtin_tgamma(void)
- max_ulp = fabsf(cpu - dst[i]) / cl_FLT_ULP(cpu);
- max_ulp_at = src[i];
- }
-- if (isinf(cpu)) {
-- OCL_ASSERT(isinf(dst[i]));
-+ if (std::isinf(cpu)) {
-+ OCL_ASSERT(std::isinf(dst[i]));
- } else if (fabsf(cpu - dst[i]) >= cl_FLT_ULP(cpu) * ULPSIZE_FACTOR) {
- printf("%f %f %f\n", src[i], cpu, dst[i]);
- OCL_ASSERT(0);
-diff --git a/utests/compiler_half.cpp b/utests/compiler_half.cpp
-index d486193..3af1925 100644
---- a/utests/compiler_half.cpp
-+++ b/utests/compiler_half.cpp
-@@ -229,7 +229,7 @@ static float half_test_src[half_n] = {
- OCL_ASSERT(((fabs(fdst[i]) < 6e-8f) && (fabs(f) < 6e-8f)) || \
- (fabs(f - fdst[i]) <= 0.03 * fabs(fdst[i])) || \
- (isInf && ((infSign && fdst[i] > 65504.0f) || (!infSign && fdst[i] < -65504.0f))) || \
-- (isnan(f) && isnan(fdst[i]))); \
-+ (std::isnan(f) && std::isnan(fdst[i]))); \
- } \
- OCL_UNMAP_BUFFER(1); \
- } \
-@@ -303,7 +303,7 @@ HALF_MATH_TEST_1ARG(ceil, ceilf);
- OCL_ASSERT(((fabs(fdst[i]) < 6e-8f) && (fabs(f) < 6e-8f)) || \
- (fabs(f - fdst[i]) <= 0.03 * fabs(fdst[i])) || \
- (isInf && ((infSign && fdst[i] > 65504.0f) || (!infSign && fdst[i] < -65504.0f))) || \
-- (isnan(f) && isnan(fdst[i]))); \
-+ (std::isnan(f) && std::isnan(fdst[i]))); \
- } \
- OCL_UNMAP_BUFFER(2); \
- } \
-diff --git a/utests/compiler_math.cpp b/utests/compiler_math.cpp
-index e0c4487..0c238c9 100644
---- a/utests/compiler_math.cpp
-+++ b/utests/compiler_math.cpp
-@@ -72,10 +72,10 @@ static void compiler_math(void)
- for (int i = 0; i < 16; ++i) {
- const float cpu = cpu_dst[i];
- const float gpu = ((float*)buf_data[0])[i];
-- if (isinf(cpu))
-- OCL_ASSERT(isinf(gpu));
-- else if (isnan(cpu))
-- OCL_ASSERT(isnan(gpu));
-+ if (std::isinf(cpu))
-+ OCL_ASSERT(std::isinf(gpu));
-+ else if (std::isnan(cpu))
-+ OCL_ASSERT(std::isnan(gpu));
- else
- OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);
- }
-diff --git a/utests/compiler_math_2op.cpp b/utests/compiler_math_2op.cpp
-index 454967d..d771dba 100644
---- a/utests/compiler_math_2op.cpp
-+++ b/utests/compiler_math_2op.cpp
-@@ -65,10 +65,10 @@ static void compiler_math_2op(void)
- for (int i = 0; i < 16; ++i) {
- const float cpu = cpu_dst[i];
- const float gpu = ((float*)buf_data[0])[i];
-- if (isinf(cpu))
-- OCL_ASSERT(isinf(gpu));
-- else if (isnan(cpu))
-- OCL_ASSERT(isnan(gpu));
-+ if (std::isinf(cpu))
-+ OCL_ASSERT(std::isinf(gpu));
-+ else if (std::isnan(cpu))
-+ OCL_ASSERT(std::isnan(gpu));
- else {
- OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);
- }
-diff --git a/utests/compiler_math_3op.cpp b/utests/compiler_math_3op.cpp
-index a382b0a..f90f9d6 100644
---- a/utests/compiler_math_3op.cpp
-+++ b/utests/compiler_math_3op.cpp
-@@ -50,10 +50,10 @@ static void compiler_math_3op(void)
- for (int i = 0; i < 16; ++i) {
- const float cpu = cpu_dst[i];
- const float gpu = ((float*)buf_data[0])[i];
-- if (isinf(cpu))
-- OCL_ASSERT(isinf(gpu));
-- else if (isnan(cpu))
-- OCL_ASSERT(isnan(gpu));
-+ if (std::isinf(cpu))
-+ OCL_ASSERT(std::isinf(gpu));
-+ else if (std::isnan(cpu))
-+ OCL_ASSERT(std::isnan(gpu));
- else
- OCL_ASSERT(fabs(gpu-cpu) < 1e-3f);
- }
-diff --git a/utests/utest_generator.py b/utests/utest_generator.py
-index 91cc938..25f18c7 100644
---- a/utests/utest_generator.py
-+++ b/utests/utest_generator.py
-@@ -112,10 +112,10 @@ def udebug(ulpSize,returnType,function):
- ULPSIZE_FACTOR = select_ulpsize(ULPSIZE_FAST_MATH,ULPSIZE_NO_FAST_MATH);
- bool fast_math = ULPSIZE_FACTOR == ULPSIZE_FAST_MATH;
-
-- if (isinf(cpu_data[index])){
-+ if (std::isinf(cpu_data[index])){
- INFORNAN="INF";
- }
-- else if (isnan(cpu_data[index])){
-+ else if (std::isnan(cpu_data[index])){
- INFORNAN="NAN";
- }
- else{
-@@ -124,14 +124,14 @@ def udebug(ulpSize,returnType,function):
- }
-
- #if udebug
-- if (isinf(cpu_data[index])){
-- if (isinf(gpu_data[index]))
-+ if (std::isinf(cpu_data[index])){
-+ if (std::isinf(gpu_data[index]))
- printf("%s expect:%s\\n", log, INFORNAN);
- else
- printf_c("%s expect:%s\\n", log, INFORNAN);
- }
-- else if (isnan(cpu_data[index])){
-- if (isnan(gpu_data[index]))
-+ else if (std::isnan(cpu_data[index])){
-+ if (std::isnan(gpu_data[index]))
- printf("%s expect:%s\\n", log, INFORNAN);
- else
- printf_c("%s expect:%s\\n", log, INFORNAN);
-@@ -142,13 +142,13 @@ def udebug(ulpSize,returnType,function):
- else
- printf_c("%s expect:%s\\n", log, ULPSIZE);
- #else
-- if (isinf(cpu_data[index])){
-+ if (std::isinf(cpu_data[index])){
- sprintf(log, "%s expect:%s\\n", log, INFORNAN);
-- OCL_ASSERTM(isinf(gpu_data[index]) || fast_math,log);
-+ OCL_ASSERTM(std::isinf(gpu_data[index]) || fast_math,log);
- }
-- else if (isnan(cpu_data[index])){
-+ else if (std::isnan(cpu_data[index])){
- sprintf(log, "%s expect:%s\\n", log, INFORNAN);
-- OCL_ASSERTM(isnan(gpu_data[index]) || fast_math,log);
-+ OCL_ASSERTM(std::isnan(gpu_data[index]) || fast_math,log);
- }
- else{
- sprintf(log, "%s expect:%s\\n", log, ULPSIZE);
diff --git a/debian/patches/support-kfreebsd.patch b/debian/patches/support-kfreebsd.patch
index 7e1661c..712bb20 100644
--- a/debian/patches/support-kfreebsd.patch
+++ b/debian/patches/support-kfreebsd.patch
@@ -7,9 +7,9 @@ https://buildd.debian.org/status/fetch.php?pkg=beignet&arch=kfreebsd-amd64&ver=1
Origin: https://github.com/freebsd/freebsd-ports-graphics/blob/opencl/lang/beignet/files/patch-src_cl__device__id.c https://github.com/freebsd/freebsd-ports-graphics/blob/master/lang/beignet/files/patch-src_cl__event.c
Author: Koop Mast, Rebecca Palmer
---- a/src/cl_device_id.c
-+++ b/src/cl_device_id.c
-@@ -34,7 +34,12 @@
+--- beignet.orig/src/cl_device_id.c
++++ beignet/src/cl_device_id.c
+@@ -35,7 +35,12 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -22,19 +22,18 @@ Author: Koop Mast, Rebecca Palmer
#ifndef CL_VERSION_1_2
#define CL_DEVICE_BUILT_IN_KERNELS 0x103F
-@@ -568,6 +573,7 @@ skl_gt4_break:
- /* Apply any driver-dependent updates to the device info */
- cl_driver_update_device_info(ret);
-
+@@ -760,11 +765,24 @@ kbl_gt4_break:
+ #define toMB(size) (size)&(0xfffffffffffffff<<20)
+ /* Get the global_mem_size and max_mem_alloc size from
+ * driver, system ram and hardware*/
+#if defined(linux) || defined(__linux__) || defined(__LINUX__)
struct sysinfo info;
if (sysinfo(&info) == 0) {
- uint64_t two_gb = 2 * 1024 * 1024 * 1024ul;
-@@ -576,6 +581,22 @@ skl_gt4_break:
- two_gb : info.totalram;
- ret->max_mem_alloc_size = ret->global_mem_size / 2;
- }
+ uint64_t totalgpumem = ret->global_mem_size;
+ uint64_t maxallocmem = ret->max_mem_alloc_size;
+ uint64_t totalram = info.totalram * info.mem_unit;
+#else
++ {
+ int mib[2];
+
+ mib[0] = CTL_HW;
@@ -44,17 +43,12 @@ Author: Koop Mast, Rebecca Palmer
+ size_t len;
+ len = sizeof(totalram);
+ sysctl(mib, 2, &totalram, &len, NULL, 0);
-+
-+ uint64_t two_gb = 2 * 1024 * 1024 * 1024ul;
-+ ret->global_mem_size = (totalram > two_gb) ?
-+ two_gb : totalram;
-+ ret->max_mem_alloc_size = ret->global_mem_size / 2;
+#endif
-
- return ret;
- }
---- a/src/cl_event.c
-+++ b/src/cl_event.c
+ /* In case to keep system stable we just use half
+ * of the raw as global mem */
+ ret->global_mem_size = toMB((totalram / 2 > totalgpumem) ?
+--- beignet.orig/src/cl_event.c
++++ beignet/src/cl_event.c
@@ -27,6 +27,7 @@
#include <assert.h>
@@ -63,17 +57,15 @@ Author: Koop Mast, Rebecca Palmer
void cl_event_update_last_events(cl_command_queue queue, int wait)
{
-@@ -649,7 +650,11 @@ cl_ulong cl_event_get_cpu_timestamp(cl_u
+@@ -657,7 +658,11 @@ cl_ulong cl_event_get_cpu_timestamp(cl_u
{
struct timespec ts;
-- if(clock_gettime(CLOCK_MONOTONIC_RAW,&ts) != 0){
+#if defined(linux) || defined(__linux__) || defined(__LINUX__)
-+ if(clock_gettime(CLOCK_MONOTONIC_RAW,&ts) != 0){
+ if(clock_gettime(CLOCK_MONOTONIC_RAW,&ts) != 0){
+#else
+ if(clock_gettime(CLOCK_MONOTONIC,&ts) != 0){
+#endif
printf("CPU Timmer error\n");
return CL_FALSE;
}
-
diff --git a/debian/patches/update-docs.patch b/debian/patches/update-docs.patch
index 7490b07..171ad18 100644
--- a/debian/patches/update-docs.patch
+++ b/debian/patches/update-docs.patch
@@ -6,11 +6,9 @@ Add Debian specific information.
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
-diff --git a/src/cl_device_id.c b/src/cl_device_id.c
-index e9e2c16..3227340 100644
---- a/src/cl_device_id.c
-+++ b/src/cl_device_id.c
-@@ -610,7 +610,7 @@ cl_self_test(cl_device_id device, cl_self_test_res atomic_in_l3_flag)
+--- beignet.orig/src/cl_device_id.c
++++ beignet/src/cl_device_id.c
+@@ -852,7 +852,7 @@ cl_self_test(cl_device_id device, cl_sel
} else {
ret = SELF_TEST_SLM_FAIL;
printf("Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (%i, %i, %i)\n"
@@ -19,11 +17,9 @@ index e9e2c16..3227340 100644
test_data[0], test_data[1], test_data[2]);
}
-diff --git a/docs/Beignet/Backend.mdwn b/docs/Beignet/Backend.mdwn
-index 583e5d2..e0de7bf 100644
---- a/docs/Beignet/Backend.mdwn
-+++ b/docs/Beignet/Backend.mdwn
-@@ -37,9 +37,7 @@ Environment variables are used all over the code. Most important ones are:
+--- beignet.orig/docs/Beignet/Backend.mdwn
++++ beignet/docs/Beignet/Backend.mdwn
+@@ -37,9 +37,7 @@ Environment variables are used all over
precision math instructions compliant with OpenCL Spec. So we provide a
software version to meet the high precision requirement. Obviously the
software version's performance is not as good as native version supported by
@@ -35,11 +31,11 @@ index 583e5d2..e0de7bf 100644
- `OCL_SIMD_WIDTH` `(8 or 16)`. Select the number of lanes per hardware thread,
Normally, you don't need to set it, we will select suitable simd width for
--- /dev/null
-+++ beignet-1.1.2/docs/index.mdwn
++++ beignet/docs/index.mdwn
@@ -0,0 +1 @@
+[[!map pages="* and !ikiwiki/*" show=title]]
---- beignet-1.1.2.orig/docs/Beignet.mdwn
-+++ beignet-1.1.2/docs/Beignet.mdwn
+--- beignet.orig/docs/Beignet.mdwn
++++ beignet/docs/Beignet.mdwn
@@ -9,6 +9,19 @@ the programs and run them on the GPU. Th
part of the stack which is included in `backend/`. For more specific information
about the compiler, please refer to `backend/README.md`
@@ -51,7 +47,7 @@ index 583e5d2..e0de7bf 100644
+ * Ivy Bridge (ix-3xxx) and later Intel Core processors
+ * Bay Trail and later Intel Atom processors with Intel HD (not PowerVR) graphics
+
-+As these GPUs are not necessarily backwards compatible, Beignet will not attempt to use processors it does not recognise. Hence, processors introduced after this release of Beignet (even within the Skylake family) may require a newer version of beignet-opencl-icd (and possibly the kernel, linux-image-amd64 or linux-image-i686-pae): for Debian stable, this [may be available](https://packages.debian.org/search?keywords=beignet-opencl-icd&searchon=names&exact=1&suite=all§ion=all) in [ [...]
++As these GPUs are not necessarily backwards compatible, Beignet will not attempt to use processors it does not recognise. Hence, processors introduced after this release of Beignet (even within the Kabylake family) may require a newer version of beignet-opencl-icd (and possibly the kernel, linux-image-amd64 or linux-image-i686-pae): for Debian stable, this [may be available](https://packages.debian.org/search?keywords=beignet-opencl-icd&searchon=names&exact=1&suite=all§ion=all) in [...]
+
+Not all processor models have an integrated GPU, and systems that also have a discrete GPU may disable the integrated GPU: check _xrandr --listproviders_ or see [here](https://nouveau.freedesktop.org/wiki/Optimus/).
+
@@ -69,22 +65,25 @@ index 583e5d2..e0de7bf 100644
The project depends on the following external libaries:
- libdrm libraries (libdrm and libdrm\_intel)
-@@ -137,14 +152,6 @@ beignet provides two alternative to run:
+@@ -147,17 +162,6 @@ beignet provides two alternative to run:
* Run as root without X.
* Enable the drm render nodes by passing drm.rnodes=1 to the kernel boot args, then you can run beignet with non-root and without X.
-Supported Targets
------------------
-
-- * 3rd Generation Intel Core Processors
-- * Intel “Bay Trail” platforms with Intel HD Graphics
-- * 4th Generation Intel Core Processors "Haswell", need kernel patch currently, see the "Known Issues" section.
+- * 3rd Generation Intel Core Processors "Ivybridge".
+- * 3rd Generation Intel Atom Processors "BayTrail".
+- * 4th Generation Intel Core Processors "Haswell", need kernel patch if your linux kernel older than 4.2, see the "Known Issues" section.
- * 5th Generation Intel Core Processors "Broadwell".
+- * 5th Generation Intel Atom Processors "Braswell".
+- * 6th Generation Intel Core Processors "Skylake" and "Kabylake".
+- * 5th Generation Intel Atom Processors "Broxten" or "Apollolake".
-
Known Issues
------------
-@@ -164,7 +171,7 @@ Known Issues
+@@ -177,7 +181,7 @@ Known Issues
forever until a reboot.
* "Beignet: self-test failed" and almost all unit tests fail.
@@ -93,52 +92,34 @@ index 583e5d2..e0de7bf 100644
to [c9224fa](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c9224faa59c3071ecfa2d4b24592f4eb61e57069))
enable the register whitelist by default but miss some registers needed
for Beignet.
-@@ -175,7 +182,7 @@ Known Issues
-
- On Haswell hardware, Beignet 1.0.1 to 1.0.3 also required the
- above workaround on later Linux versions, but this _should not_ be
-- required in current (after [83f8739](http://cgit.freedesktop.org/beignet/commit/?id=83f8739b6fc4893fac60145326052ccb5cf653dc))
-+ required in Beignet 1.1 or current (after [83f8739](http://cgit.freedesktop.org/beignet/commit/?id=83f8739b6fc4893fac60145326052ccb5cf653dc))
- git master.
-
- * "Beignet: self-test failed" and 15-30 unit tests fail on 4th Generation (Haswell) hardware.
-@@ -183,10 +190,11 @@ Known Issues
+@@ -191,10 +195,11 @@ Known Issues
Linux <= 4.0, and requires the i915.enable_ppgtt=2 [boot parameter](https://wiki.ubuntu.com/Kernel/KernelBootParameters)
on Linux 4.1.
-- This will be fixed in Linux 4.2; older versions can be fixed with
+- This is fixed in Linux 4.2; older versions can be fixed with
- [this patch](https://01.org/zh/beignet/downloads/linux-kernel-patch-hsw-support).
+ This is fixed in Linux >= 4.2, which is the default in sid/stretch, and available from -backports in jessie:
-+
-+ `sudo apt-get install -t jessie-backports linux-image-amd64`
- If you do not need \_\_local, you can override the self-test with
++ `sudo apt-get install -t jessie-backports linux-image-amd64`
++
+ (or -i686-pae). If you do not need \_\_local, you can override the self-test with
`export OCL_IGNORE_SELF_TEST=1`
-@@ -208,16 +215,10 @@ Known Issues
+@@ -215,6 +220,11 @@ Known Issues
extension. This feature used to work with a previous mesa git version. But now, it's
simply broken.
--* Illegal pointer issue.
-- If you met the following error message:
--
-- `Illegal pointer which is not from a valid memory space.`
-- `Aborting...`
--
-- That means the computing kernel is running into an unsupported feature which is to
-- store/load pointers to/from memory. As we know, this feature has been used in Luxmark
-- 3.0 and maybe the latest BOINC. Beignet could support them currently. We plan to fix
-- it in next major release 1.1.0.
+* clCreateBuffer with CL_MEM_ALLOC_HOST_PTR doesn't work.
+
+ This feature is unreliable on older versions of Linux, including jessie's 3.16.
+ Upgrading to Linux 3.18+ (e.g. from jessie-backports) should fix this problem.
-
- TODO
- ----
-@@ -296,9 +297,9 @@ The official mail list is as below:
++
+ Project repository
+ ------------------
+ Right now, we host our project on fdo at:
+@@ -260,9 +270,9 @@ The official mail list is as below:
[http://lists.freedesktop.org/mailman/listinfo/beignet](http://lists.freedesktop.org/mailman/listinfo/beignet)
The official bugzilla is at:
[https://bugs.freedesktop.org/enter_bug.cgi?product=Beignet](https://bugs.freedesktop.org/enter_bug.cgi?product=Beignet)
@@ -151,4 +132,3 @@ index 583e5d2..e0de7bf 100644
Documents for OpenCL application developers
-------------------------------------------
-
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git
More information about the Pkg-opencl-commits
mailing list