DPDK patches and discussions
 help / color / mirror / Atom feed
From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>, <aprabhu@marvell.com>,
	<ptakkar@marvell.com>, <pshukla@marvell.com>,
	<david.marchand@redhat.com>
Subject: [PATCH v2 1/1] mldev: remove weak symbols use in type conversions
Date: Mon, 13 Mar 2023 04:36:58 -0700	[thread overview]
Message-ID: <20230313113658.11170-1-syalavarthi@marvell.com> (raw)
In-Reply-To: <20230311145056.16386-1-syalavarthi@marvell.com>

Drop use of weak symbols to select the type conversion
functions. Select NEON implementation only on Aarch64
builds. Enable windows build.

Fixes: 9637de38a2e3 ("mldev: add scalar type conversion")

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---

v2:
* Updated Fixes reference

 lib/mldev/meson.build          |  9 ++-------
 lib/mldev/mldev_utils_scalar.c | 24 ++++++++++++------------
 2 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build
index 51ba809465..c9db42257b 100644
--- a/lib/mldev/meson.build
+++ b/lib/mldev/meson.build
@@ -1,21 +1,16 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2022 Marvell.

-if is_windows
-    build = false
-    reason = 'not supported on Windows'
-    subdir_done()
-endif
-
 sources = files(
         'rte_mldev_pmd.c',
         'rte_mldev.c',
         'mldev_utils.c',
-        'mldev_utils_scalar.c',
 )

 if dpdk_conf.has('RTE_ARCH_ARM64')
     sources += files('mldev_utils_neon.c')
+else
+    sources += files('mldev_utils_scalar.c')
 endif

 headers = files(
diff --git a/lib/mldev/mldev_utils_scalar.c b/lib/mldev/mldev_utils_scalar.c
index 40320ed3ef..322b009f5d 100644
--- a/lib/mldev/mldev_utils_scalar.c
+++ b/lib/mldev/mldev_utils_scalar.c
@@ -84,7 +84,7 @@ union float32 {
 	uint32_t u;
 };

-__rte_weak int
+int
 rte_ml_io_float32_to_int8(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -116,7 +116,7 @@ rte_ml_io_float32_to_int8(float scale, uint64_t nb_elements, void *input, void *
 	return 0;
 }

-__rte_weak int
+int
 rte_ml_io_int8_to_float32(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	int8_t *input_buffer;
@@ -139,7 +139,7 @@ rte_ml_io_int8_to_float32(float scale, uint64_t nb_elements, void *input, void *
 	return 0;
 }

-__rte_weak int
+int
 rte_ml_io_float32_to_uint8(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -171,7 +171,7 @@ rte_ml_io_float32_to_uint8(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }

-__rte_weak int
+int
 rte_ml_io_uint8_to_float32(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	uint8_t *input_buffer;
@@ -194,7 +194,7 @@ rte_ml_io_uint8_to_float32(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }

-__rte_weak int
+int
 rte_ml_io_float32_to_int16(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -226,7 +226,7 @@ rte_ml_io_float32_to_int16(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }

-__rte_weak int
+int
 rte_ml_io_int16_to_float32(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	int16_t *input_buffer;
@@ -249,7 +249,7 @@ rte_ml_io_int16_to_float32(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }

-__rte_weak int
+int
 rte_ml_io_float32_to_uint16(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -281,7 +281,7 @@ rte_ml_io_float32_to_uint16(float scale, uint64_t nb_elements, void *input, void
 	return 0;
 }

-__rte_weak int
+int
 rte_ml_io_uint16_to_float32(float scale, uint64_t nb_elements, void *input, void *output)
 {
 	uint16_t *input_buffer;
@@ -429,7 +429,7 @@ __float32_to_float16_scalar_rtn(float x)
 	return u16;
 }

-__rte_weak int
+int
 rte_ml_io_float32_to_float16(uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -513,7 +513,7 @@ __float16_to_float32_scalar_rtx(uint16_t f16)
 	return f32.f;
 }

-__rte_weak int
+int
 rte_ml_io_float16_to_float32(uint64_t nb_elements, void *input, void *output)
 {
 	uint16_t *input_buffer;
@@ -614,7 +614,7 @@ __float32_to_bfloat16_scalar_rtn(float x)
 	return u16;
 }

-__rte_weak int
+int
 rte_ml_io_float32_to_bfloat16(uint64_t nb_elements, void *input, void *output)
 {
 	float *input_buffer;
@@ -696,7 +696,7 @@ __bfloat16_to_float32_scalar_rtx(uint16_t f16)
 	return f32.f;
 }

-__rte_weak int
+int
 rte_ml_io_bfloat16_to_float32(uint64_t nb_elements, void *input, void *output)
 {
 	uint16_t *input_buffer;
--
2.17.1


  parent reply	other threads:[~2023-03-13 11:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11 14:50 [PATCH] " Srikanth Yalavarthi
2023-03-13 10:52 ` David Marchand
2023-03-13 11:37   ` [EXT] " Srikanth Yalavarthi
2023-03-13 11:36 ` Srikanth Yalavarthi [this message]
2023-03-15  9:49   ` [PATCH v2 1/1] " David Marchand

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=20230313113658.11170-1-syalavarthi@marvell.com \
    --to=syalavarthi@marvell.com \
    --cc=aprabhu@marvell.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=pshukla@marvell.com \
    --cc=ptakkar@marvell.com \
    --cc=sshankarnara@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).