From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>,
David Marchand <david.marchand@redhat.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Anup Prabhu <aprabhu@marvell.com>
Cc: <dev@dpdk.org>
Subject: [PATCH 1/1] app/mldev: fix code formatting and alignment
Date: Thu, 23 Mar 2023 09:23:13 -0700 [thread overview]
Message-ID: <20230323162313.13295-1-syalavarthi@marvell.com> (raw)
Updated ML application source files to have uniform code
formatting style across. Remove extra blank lines.
Fixes: 8cb22a545447 ("app/mldev: fix debug build")
Fixes: c9f073cdca95 ("mldev: remove unnecessary null checks")
Fixes: da6793390596 ("app/mldev: support inference validation")
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
app/test-mldev/test_inference_common.c | 38 ++++++++++++--------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c
index 410e63bca4..f8960ae726 100644
--- a/app/test-mldev/test_inference_common.c
+++ b/app/test-mldev/test_inference_common.c
@@ -20,23 +20,23 @@
#define ML_TEST_READ_TYPE(buffer, type) (*((type *)buffer))
-#define ML_TEST_CHECK_OUTPUT(output, reference, tolerance) \
+#define ML_TEST_CHECK_OUTPUT(output, reference, tolerance) \
(((float)output - (float)reference) <= (((float)reference * tolerance) / 100.0))
-#define ML_OPEN_WRITE_GET_ERR(name, buffer, size, err) \
- do { \
- FILE *fp = fopen(name, "w+"); \
- if (fp == NULL) { \
- ml_err("Unable to create file: %s, error: %s", name, strerror(errno)); \
- err = true; \
- } else { \
- if (fwrite(buffer, 1, size, fp) != size) { \
- ml_err("Error writing output, file: %s, error: %s", name, \
- strerror(errno)); \
- err = true; \
- } \
- fclose(fp); \
- } \
+#define ML_OPEN_WRITE_GET_ERR(name, buffer, size, err) \
+ do { \
+ FILE *fp = fopen(name, "w+"); \
+ if (fp == NULL) { \
+ ml_err("Unable to create file: %s, error: %s", name, strerror(errno)); \
+ err = true; \
+ } else { \
+ if (fwrite(buffer, 1, size, fp) != size) { \
+ ml_err("Error writing output, file: %s, error: %s", name, \
+ strerror(errno)); \
+ err = true; \
+ } \
+ fclose(fp); \
+ } \
} while (0)
static void
@@ -937,7 +937,7 @@ ml_request_finish(struct rte_mempool *mp, void *opaque, void *obj, unsigned int
if (t->cmn.opt->debug) {
/* dump quantized output buffer */
if (asprintf(&dump_path, "%s.q.%u", t->cmn.opt->filelist[req->fid].output,
- obj_idx) == -1)
+ obj_idx) == -1)
return;
ML_OPEN_WRITE_GET_ERR(dump_path, req->output, model->out_qsize, error);
free(dump_path);
@@ -945,8 +945,8 @@ ml_request_finish(struct rte_mempool *mp, void *opaque, void *obj, unsigned int
return;
/* dump dequantized output buffer */
- if (asprintf(&dump_path, "%s.%u", t->cmn.opt->filelist[req->fid].output,
- obj_idx) == -1)
+ if (asprintf(&dump_path, "%s.%u", t->cmn.opt->filelist[req->fid].output, obj_idx) ==
+ -1)
return;
ML_OPEN_WRITE_GET_ERR(dump_path, model->output, model->out_dsize, error);
free(dump_path);
@@ -1077,7 +1077,6 @@ ml_inference_stats_get(struct ml_test *test, struct ml_options *opt)
/* release buffers */
rte_free(t->xstats_map);
-
rte_free(t->xstats_values);
/* print end-to-end stats */
@@ -1116,7 +1115,6 @@ ml_inference_stats_get(struct ml_test *test, struct ml_options *opt)
error:
rte_free(t->xstats_map);
-
rte_free(t->xstats_values);
return ret;
--
2.17.1
next reply other threads:[~2023-03-23 16:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 16:23 Srikanth Yalavarthi [this message]
2023-04-23 4:58 ` [PATCH v2] app/mldev: fix code formatting and typos Srikanth Yalavarthi
2023-07-06 16:42 ` 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=20230323162313.13295-1-syalavarthi@marvell.com \
--to=syalavarthi@marvell.com \
--cc=aprabhu@marvell.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/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).