From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D24A2429BA; Sun, 23 Apr 2023 06:58:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1DDE4021D; Sun, 23 Apr 2023 06:58:38 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 9757C40156 for ; Sun, 23 Apr 2023 06:58:37 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33N4reHt023337; Sat, 22 Apr 2023 21:58:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=8UVXB+CFZRfPH85rGCnmk11oeH/jc1gASl1E+zZJ8CQ=; b=ANLlXgqmU6kdJU0x/1Ze1CFz7l9HdlK/PN5jHc/vpQskVqqFOoZQp6FVIhiMDATPwy8d pNEk/Y/o17tvKnz0mUsu1Tz4kEKxRzAW6x/nxJg4ZLxT4HCayodrfUc4AD37ox4sHOze ZPO7IZ3UlD5FW6nlSXoYUPt6/DsSWXzxPTaxgpzxtVAPJvELv3waV72VctbKHytnZVml r5sORwRXtTk5zEtFKT+HSpc6qFHYcyBUgtF4pPM0vwGAyKgBXSS0D3Ht3pcyb47RwA2N rC+gPnsaXzM22n7IbBW/68qZ/GlFnirFmPN1uUTAcRpWazUDIGu9hB0ksUt9OFaTaz6h pw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q4f3p21b5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 22 Apr 2023 21:58:36 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 22 Apr 2023 21:58:34 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Sat, 22 Apr 2023 21:58:34 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 9C8B93F704C; Sat, 22 Apr 2023 21:58:34 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , David Marchand , Anup Prabhu CC: , , Subject: [PATCH v2] app/mldev: fix code formatting and typos Date: Sat, 22 Apr 2023 21:58:32 -0700 Message-ID: <20230423045832.22640-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230323162313.13295-1-syalavarthi@marvell.com> References: <20230323162313.13295-1-syalavarthi@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-ORIG-GUID: nSeblrFY4QXStOEh-eHyoGwyfDHwQgo- X-Proofpoint-GUID: nSeblrFY4QXStOEh-eHyoGwyfDHwQgo- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-23_02,2023-04-21_01,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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