From: Ruifeng Wang <Ruifeng.Wang@arm.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"sshankarnara@marvell.com" <sshankarnara@marvell.com>,
"jerinj@marvell.com" <jerinj@marvell.com>,
"aprabhu@marvell.com" <aprabhu@marvell.com>, nd <nd@arm.com>
Subject: RE: [PATCH v1 4/4] common/ml: add Arm NEON type conversion routines
Date: Mon, 12 Dec 2022 07:16:03 +0000 [thread overview]
Message-ID: <AS8PR08MB70800D37F1C225985032651E9EE29@AS8PR08MB7080.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20221208193532.16718-5-syalavarthi@marvell.com>
> -----Original Message-----
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Sent: Friday, December 9, 2022 3:36 AM
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>; Ruifeng Wang <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org; sshankarnara@marvell.com; jerinj@marvell.com; aprabhu@marvell.com
> Subject: [PATCH v1 4/4] common/ml: add Arm NEON type conversion routines
>
> Added ARM NEON intrinsic based implementations to support conversion of data types.
> Support is enabled to handle int8, uint8, int16, uint16, float16, float32 and bfloat16
> types.
>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---
> drivers/common/ml/meson.build | 5 +
> drivers/common/ml/ml_utils.c | 48 ++
> drivers/common/ml/ml_utils_neon.c | 950 ++++++++++++++++++++++++++++++
> drivers/common/ml/ml_utils_neon.h | 23 +
> 4 files changed, 1026 insertions(+)
> create mode 100644 drivers/common/ml/ml_utils_neon.c create mode 100644
> drivers/common/ml/ml_utils_neon.h
>
> diff --git a/drivers/common/ml/meson.build b/drivers/common/ml/meson.build index
> 84ae84ee4e..f7ce19b4b4 100644
> --- a/drivers/common/ml/meson.build
> +++ b/drivers/common/ml/meson.build
> @@ -17,6 +17,11 @@ sources = files(
> 'ml_utils_generic.c',
> )
>
> +if arch_subdir == 'arm'
> + headers += files('ml_utils_neon.h')
> + sources += files('ml_utils_neon.c') endif
> +
> deps += ['mldev']
>
> pmd_supports_disable_iova_as_pa = true
> diff --git a/drivers/common/ml/ml_utils.c b/drivers/common/ml/ml_utils.c index
> e2edef0904..3edcf09fde 100644
> --- a/drivers/common/ml/ml_utils.c
> +++ b/drivers/common/ml/ml_utils.c
> @@ -120,71 +120,119 @@ ml_io_format_to_str(enum rte_ml_io_format format, char *str, int
> len) int ml_float32_to_int8(float scale, uint64_t nb_elements, void *input, void *output)
> {
> +#if defined(__ARM_NEON__)
> + return ml_float32_to_int8_neon(scale, nb_elements, input, output);
> +#else
> return ml_float32_to_int8_generic(scale, nb_elements, input, output);
> +#endif
> }
>
Maybe __rte_weak can be used to remove the ifdef clutter.
Something like:
ml_utils.c
__rte_weak int ml_float32_to_int8(float scale, uint64_t nb_elements, void *input, void *output)
{
return ml_float32_to_int8_generic(scale, nb_elements, input, output);
}
ml_utis_neon.c
int ml_float32_to_int8(float scale, uint64_t nb_elements, void *input, void *output)
{
return ml_float32_to_int8_neon(scale, nb_elements, input, output);
}
<snip>
> diff --git a/drivers/common/ml/ml_utils_neon.c b/drivers/common/ml/ml_utils_neon.c
> new file mode 100644
> index 0000000000..b660de07ec
> --- /dev/null
> +++ b/drivers/common/ml/ml_utils_neon.c
> @@ -0,0 +1,950 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright (c) 2022 Marvell.
> + */
> +
> +#include <errno.h>
> +#include <math.h>
> +#include <stdint.h>
> +
> +#include <rte_common.h>
> +#include <rte_vect.h>
> +
> +#include "ml_utils.h"
> +#include "ml_utils_neon.h"
> +
> +#include <arm_neon.h>
This line can be removed. It is included rte_vect.h.
Thanks.
<snip>
next prev parent reply other threads:[~2022-12-12 7:16 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-08 19:35 [PATCH v1 0/4] implementation of ML common code Srikanth Yalavarthi
2022-12-08 19:35 ` [PATCH v1 1/4] common/ml: add initial files for " Srikanth Yalavarthi
2022-12-08 19:35 ` [PATCH v1 2/4] common/ml: add data type conversion routines Srikanth Yalavarthi
2022-12-08 19:35 ` [PATCH v1 3/4] common/ml: add generic type conversion functions Srikanth Yalavarthi
2022-12-08 19:35 ` [PATCH v1 4/4] common/ml: add Arm NEON type conversion routines Srikanth Yalavarthi
2022-12-12 7:16 ` Ruifeng Wang [this message]
2022-12-12 17:25 ` Srikanth Yalavarthi
2022-12-12 17:21 ` [PATCH v1 0/4] implementation of ML common code Srikanth Yalavarthi
2022-12-12 17:21 ` [PATCH v2 1/4] common/ml: add initial files for " Srikanth Yalavarthi
2022-12-12 17:21 ` [PATCH v2 2/4] common/ml: add common utility functions Srikanth Yalavarthi
2022-12-12 17:21 ` [PATCH v2 3/4] common/ml: add scalar type conversion functions Srikanth Yalavarthi
2022-12-12 17:21 ` [PATCH v2 4/4] common/ml: add Arm NEON type conversion routines Srikanth Yalavarthi
2022-12-13 9:04 ` Ruifeng Wang
2022-12-20 17:52 ` [PATCH v3 0/4] implementation of ML common code Srikanth Yalavarthi
2022-12-20 17:52 ` [PATCH v3 1/4] common/ml: add initial files for " Srikanth Yalavarthi
2022-12-20 19:04 ` Stephen Hemminger
2022-12-20 19:19 ` [EXT] " Srikanth Yalavarthi
2022-12-20 17:52 ` [PATCH v3 2/4] common/ml: add common utility functions Srikanth Yalavarthi
2022-12-20 17:52 ` [PATCH v3 3/4] common/ml: add scalar type conversion functions Srikanth Yalavarthi
2022-12-20 17:52 ` [PATCH v3 4/4] common/ml: add Arm NEON type conversion routines Srikanth Yalavarthi
2022-12-21 3:08 ` Ruifeng Wang
2022-12-20 19:06 ` [PATCH v3 0/4] implementation of ML common code Stephen Hemminger
2022-12-20 19:17 ` [EXT] " Srikanth Yalavarthi
2023-01-25 13:18 ` Thomas Monjalon
2023-01-25 13:25 ` [EXT] " Srikanth Yalavarthi
2023-01-25 13:55 ` Thomas Monjalon
2023-01-25 14:59 ` Srikanth Yalavarthi
2023-01-26 10:57 ` Thomas Monjalon
2023-01-27 6:40 ` Jerin Jacob
2023-01-27 8:50 ` Thomas Monjalon
2023-01-27 9:02 ` Jerin Jacob
2023-01-27 9:26 ` Thomas Monjalon
2023-01-27 10:28 ` Jerin Jacob
2023-01-31 13:44 ` Srikanth Yalavarthi
2023-02-01 9:15 ` Srikanth Yalavarthi
2023-02-01 9:04 ` [PATCH v4 0/4] Implementation " Srikanth Yalavarthi
2023-02-01 9:04 ` [PATCH v4 1/4] mldev: add headers for internal ML functions Srikanth Yalavarthi
2023-02-01 13:54 ` Anup Prabhu
2023-02-01 15:28 ` Thomas Monjalon
2023-02-01 9:04 ` [PATCH v4 2/4] mldev: implement ML IO type handling functions Srikanth Yalavarthi
2023-02-01 13:53 ` Anup Prabhu
2023-02-01 14:01 ` Anup Prabhu
2023-02-01 14:15 ` Anup Prabhu
2023-02-01 14:26 ` Anup Prabhu
2023-02-01 9:04 ` [PATCH v4 3/4] mldev: add scalar type conversion functions Srikanth Yalavarthi
2023-02-01 9:04 ` [PATCH v4 4/4] mldev: add Arm NEON type conversion routines Srikanth Yalavarthi
2023-02-01 9:12 ` [PATCH v5 0/4] Implementation of ML common code Srikanth Yalavarthi
2023-02-01 9:12 ` [PATCH v5 1/4] mldev: add headers for internal ML functions Srikanth Yalavarthi
2023-02-01 9:12 ` [PATCH v5 2/4] mldev: implement ML IO type handling functions Srikanth Yalavarthi
2023-02-02 4:20 ` Anup Prabhu
2023-02-01 9:12 ` [PATCH v5 3/4] mldev: add scalar type conversion functions Srikanth Yalavarthi
2023-02-01 9:12 ` [PATCH v5 4/4] mldev: add Arm NEON type conversion routines Srikanth Yalavarthi
2023-02-07 16:00 ` [PATCH v6 0/4] Implementation of ML common code Srikanth Yalavarthi
2023-02-07 16:00 ` [PATCH v6 1/4] mldev: add headers for internal ML functions Srikanth Yalavarthi
2023-03-09 20:44 ` Thomas Monjalon
2023-02-07 16:00 ` [PATCH v6 2/4] mldev: implement ML IO type handling functions Srikanth Yalavarthi
2023-02-07 16:00 ` [PATCH v6 3/4] mldev: add scalar type conversion functions Srikanth Yalavarthi
2023-02-07 16:00 ` [PATCH v6 4/4] mldev: add Arm NEON type conversion routines Srikanth Yalavarthi
2023-03-09 21:37 ` [PATCH v6 0/4] Implementation of ML common code Thomas Monjalon
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=AS8PR08MB70800D37F1C225985032651E9EE29@AS8PR08MB7080.eurprd08.prod.outlook.com \
--to=ruifeng.wang@arm.com \
--cc=aprabhu@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=nd@arm.com \
--cc=sshankarnara@marvell.com \
--cc=syalavarthi@marvell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).