DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/1] app/mldev: fix code formatting and alignment
@ 2023-03-23 16:23 Srikanth Yalavarthi
  2023-04-23  4:58 ` [PATCH v2] app/mldev: fix code formatting and typos Srikanth Yalavarthi
  0 siblings, 1 reply; 3+ messages in thread
From: Srikanth Yalavarthi @ 2023-03-23 16:23 UTC (permalink / raw)
  To: Srikanth Yalavarthi, David Marchand, Stephen Hemminger, Anup Prabhu; +Cc: dev

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] app/mldev: fix code formatting and typos
  2023-03-23 16:23 [PATCH 1/1] app/mldev: fix code formatting and alignment Srikanth Yalavarthi
@ 2023-04-23  4:58 ` Srikanth Yalavarthi
  2023-07-06 16:42   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Srikanth Yalavarthi @ 2023-04-23  4:58 UTC (permalink / raw)
  To: Srikanth Yalavarthi, David Marchand, Anup Prabhu
  Cc: dev, sshankarnara, ptakkar

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] app/mldev: fix code formatting and typos
  2023-04-23  4:58 ` [PATCH v2] app/mldev: fix code formatting and typos Srikanth Yalavarthi
@ 2023-07-06 16:42   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2023-07-06 16:42 UTC (permalink / raw)
  To: Srikanth Yalavarthi
  Cc: David Marchand, Anup Prabhu, dev, sshankarnara, ptakkar

23/04/2023 06:58, Srikanth Yalavarthi:
> 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>

Applied, thanks.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-06 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 16:23 [PATCH 1/1] app/mldev: fix code formatting and alignment Srikanth Yalavarthi
2023-04-23  4:58 ` [PATCH v2] app/mldev: fix code formatting and typos Srikanth Yalavarthi
2023-07-06 16:42   ` Thomas Monjalon

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).