DPDK patches and discussions
 help / color / mirror / Atom feed
From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>,
	David Marchand <david.marchand@redhat.com>,
	Anup Prabhu <aprabhu@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>, <ptakkar@marvell.com>
Subject: [PATCH v2] app/mldev: fix code formatting and typos
Date: Sat, 22 Apr 2023 21:58:32 -0700	[thread overview]
Message-ID: <20230423045832.22640-1-syalavarthi@marvell.com> (raw)
In-Reply-To: <20230323162313.13295-1-syalavarthi@marvell.com>

Updated ML application source files to have uniform code formatting
style across. Remove extra blank lines. Fix typos in application help.

Fixes: 8cb22a545447 ("app/mldev: fix debug build")
Fixes: da6793390596 ("app/mldev: support inference validation")
Fixes: c0e871657d6a ("app/mldev: support queue pairs and size")

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 app/test-mldev/ml_options.c            |  4 +--
 app/test-mldev/test_inference_common.c | 36 +++++++++++++-------------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/app/test-mldev/ml_options.c b/app/test-mldev/ml_options.c
index 2efcc3532c..e2f3c4dec8 100644
--- a/app/test-mldev/ml_options.c
+++ b/app/test-mldev/ml_options.c
@@ -200,7 +200,7 @@ ml_dump_test_options(const char *testname)
 {
 	if (strcmp(testname, "device_ops") == 0) {
 		printf("\t\t--queue_pairs      : number of queue pairs to create\n"
-		       "\t\t--queue_size       : size fo queue-pair\n");
+		       "\t\t--queue_size       : size of queue-pair\n");
 		printf("\n");
 	}
 
@@ -215,7 +215,7 @@ ml_dump_test_options(const char *testname)
 		       "\t\t--repetitions      : number of inference repetitions\n"
 		       "\t\t--burst_size       : inference burst size\n"
 		       "\t\t--queue_pairs      : number of queue pairs to create\n"
-		       "\t\t--queue_size       : size fo queue-pair\n"
+		       "\t\t--queue_size       : size of queue-pair\n"
 		       "\t\t--batches          : number of batches of input\n"
 		       "\t\t--tolerance        : maximum tolerance (%%) for output validation\n"
 		       "\t\t--stats            : enable reporting performance statistics\n");
diff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c
index bf7e6bbe10..29c18bbc85 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
@@ -951,7 +951,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);
@@ -959,8 +959,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);
-- 
2.17.1


  reply	other threads:[~2023-04-23  4:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 16:23 [PATCH 1/1] app/mldev: fix code formatting and alignment Srikanth Yalavarthi
2023-04-23  4:58 ` Srikanth Yalavarthi [this message]
2023-07-06 16:42   ` [PATCH v2] app/mldev: fix code formatting and typos 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=20230423045832.22640-1-syalavarthi@marvell.com \
    --to=syalavarthi@marvell.com \
    --cc=aprabhu@marvell.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --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).