From: Denys Dmytriyenko <denys@ti.com>
To: Yuan Zhao <yuanzhao@ti.com>
Cc: meta-arago@arago-project.org
Subject: Re: [thud/ti2019.01][PATCH] ocl: fix g++8.3 opencl-examples undefined behavior
Date: Mon, 24 Jun 2019 16:55:30 -0400 [thread overview]
Message-ID: <20190624205530.GU4849@beryl> (raw)
In-Reply-To: <20190624190734.44740-1-yuanzhao@ti.com>
On Mon, Jun 24, 2019 at 02:07:34PM -0500, Yuan Zhao wrote:
> Signed-off-by: Yuan Zhao <yuanzhao@ti.com>
> ---
> ...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 <yuanzhao@ti.com>
> +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 <yuanzhao@ti.com>
> +---
> + 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"
Can this be done with striplevel/pnum instead of patchdir?
Also, when using patchdir, it's preferred to use relative path, instead of
very long absolute one. I'm aware of our existing instances of passing ${S}
(which is redundant) and ${WORKDIR} to patchdir, when it can be as simple as
patchdir=..
> +
> +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
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago
next prev parent reply other threads:[~2019-06-24 20:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 19:07 [thud/ti2019.01][PATCH] ocl: fix g++8.3 opencl-examples undefined behavior Yuan Zhao
2019-06-24 20:55 ` Denys Dmytriyenko [this message]
2019-06-25 1:28 ` Zhao, Yuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190624205530.GU4849@beryl \
--to=denys@ti.com \
--cc=meta-arago@arago-project.org \
--cc=yuanzhao@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.