Signed-off-by: Yuan Zhao <[email protected]>
---
 ...g-8.3.0-OpenCL-example-undefined-behavior.patch | 68 ++++++++++++++++++++++
 .../recipes-ti/ocl/opencl-examples_git.bb          |  6 +-
 2 files changed, 72 insertions(+), 2 deletions(-)
 create mode 100644 
meta-arago-extras/recipes-ti/ocl/files/0003-Fix-g-8.3.0-OpenCL-example-undefined-behavior.patch

diff --git 
a/meta-arago-extras/recipes-ti/ocl/files/0003-Fix-g-8.3.0-OpenCL-example-undefined-behavior.patch
 
b/meta-arago-extras/recipes-ti/ocl/files/0003-Fix-g-8.3.0-OpenCL-example-undefined-behavior.patch
new file mode 100644
index 00000000..b2c40c84
--- /dev/null
+++ 
b/meta-arago-extras/recipes-ti/ocl/files/0003-Fix-g-8.3.0-OpenCL-example-undefined-behavior.patch
@@ -0,0 +1,68 @@
+From 7cf77b704544b6012105f7ed19807b798b6cb242 Mon Sep 17 00:00:00 2001
+From: Yuan Zhao <[email protected]>
+Date: Mon, 24 Jun 2019 13:24:11 -0500
+Subject: [PATCH] Fix g++ 8.3.0 OpenCL example undefined behavior
+
+- Fix undefined behavior of non-void functions with no return statements,
+  when using g++ 8.3.0.  Change them to void functions.
+
+Upstream-Status: Submitted [Remove this patch when next release is out]
+
+Signed-off-by: Yuan Zhao <[email protected]>
+---
+ examples/persistent_common/host_assist.cpp | 2 +-
+ examples/persistent_common/host_assist.h   | 2 +-
+ examples/sgemm/main.cpp                    | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/examples/persistent_common/host_assist.cpp 
b/examples/persistent_common/host_assist.cpp
+index f1640bc..fd8bb18 100644
+--- a/examples/persistent_common/host_assist.cpp
++++ b/examples/persistent_common/host_assist.cpp
+@@ -34,7 +34,7 @@ void print_completion_code(uint32_t completion_code)
+ 
/******************************************************************************
+ * Given an OpenCL Device, Abort if the device is not part of the AM57x 
platform
+ 
******************************************************************************/
+-int assert_am57x(cl::Device &device)
++void assert_am57x(cl::Device &device)
+ {
+     cl::Platform platform;
+     std::string  platform_name;
+diff --git a/examples/persistent_common/host_assist.h 
b/examples/persistent_common/host_assist.h
+index dec381e..4abf837 100644
+--- a/examples/persistent_common/host_assist.h
++++ b/examples/persistent_common/host_assist.h
+@@ -7,7 +7,7 @@
+ 
/*-----------------------------------------------------------------------------
+ * Prototypes
+ 
*----------------------------------------------------------------------------*/
+-int  assert_am57x         (cl::Device &device);
++void assert_am57x         (cl::Device &device);
+ void print_completion_code(uint32_t completion_code);
+ 
+ #endif // _HOST_ASSIST_H_
+diff --git a/examples/sgemm/main.cpp b/examples/sgemm/main.cpp
+index 85f19ac..dfac651 100644
+--- a/examples/sgemm/main.cpp
++++ b/examples/sgemm/main.cpp
+@@ -96,7 +96,7 @@ int NUMCOMPUNITS                    = 0;
+ /* ======================================================================== */
+ void PrintUsageAndExit();
+ void HandleOptions(int argc, char* argv[]);
+-bool SetSgemmParams(Device& device);
++void SetSgemmParams(Device& device);
+ 
+ /* ======================================================================== */
+ /*  MAIN                                                                    */
+@@ -428,7 +428,7 @@ static cl_ulong roundDownPower2(cl_ulong value)
+ 
/*-----------------------------------------------------------------------------
+ * Check platform name, set sgemm blocking/tiling parameters accordingly
+ 
*----------------------------------------------------------------------------*/
+-bool SetSgemmParams(Device& device)
++void SetSgemmParams(Device& device)
+ {
+    int APanelSz        = 8  << 10;
+    int BPanelSz        = 16 << 10;
+-- 
+2.17.1
+
diff --git a/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb 
b/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb
index cbc35ce5..d0925db1 100644
--- a/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb
+++ b/meta-arago-extras/recipes-ti/ocl/opencl-examples_git.bb
@@ -5,7 +5,9 @@ LICENSE = "BSD"
 include ocl.inc
 require recipes-ti/includes/ti-paths.inc
 
-PR = "${INC_PR}.0"
+SRC_URI += 
"file://0003-Fix-g-8.3.0-OpenCL-example-undefined-behavior.patch;patchdir=${WORKDIR}/git"
+
+PR = "${INC_PR}.1"
 
 COMPATIBLE_MACHINE = "dra7xx|keystone"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -64,7 +66,7 @@ OCL_MPAX_EXAMPLE_LIST = " vecadd_mpax \
 
 OCL_EXAMPLE_LIST_append_k2hk = " ${OCL_MPAX_EXAMPLE_LIST}"
 
-python do_unpack_append() {
+python do_patch_append() {
     import shutil
 
     git_dir = d.expand("${WORKDIR}/git/examples")
-- 
2.14.1

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to