1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (c) 2022 Marvell. 3 */ 4 5 #ifndef ML_OPTIONS_H 6 #define ML_OPTIONS_H 7 8 #include <stdbool.h> 9 #include <stdint.h> 10 11 #define ML_TEST_NAME_MAX_LEN 32 12 #define ML_TEST_MAX_MODELS 8 13 14 /* Options names */ 15 #define ML_TEST ("test") 16 #define ML_DEVICE_ID ("dev_id") 17 #define ML_SOCKET_ID ("socket_id") 18 #define ML_MODELS ("models") 19 #define ML_FILELIST ("filelist") 20 #define ML_QUANTIZED_IO ("quantized_io") 21 #define ML_REPETITIONS ("repetitions") 22 #define ML_BURST_SIZE ("burst_size") 23 #define ML_QUEUE_PAIRS ("queue_pairs") 24 #define ML_QUEUE_SIZE ("queue_size") 25 #define ML_TOLERANCE ("tolerance") 26 #define ML_STATS ("stats") 27 #define ML_DEBUG ("debug") 28 #define ML_HELP ("help") 29 30 struct ml_filelist { 31 char model[PATH_MAX]; 32 char input[PATH_MAX]; 33 char output[PATH_MAX]; 34 char reference[PATH_MAX]; 35 }; 36 37 struct ml_options { 38 char test_name[ML_TEST_NAME_MAX_LEN]; 39 int16_t dev_id; 40 int socket_id; 41 struct ml_filelist filelist[ML_TEST_MAX_MODELS]; 42 uint8_t nb_filelist; 43 uint64_t repetitions; 44 uint16_t burst_size; 45 uint16_t queue_pairs; 46 uint16_t queue_size; 47 float tolerance; 48 bool stats; 49 bool debug; 50 bool quantized_io; 51 }; 52 53 void ml_options_default(struct ml_options *opt); 54 int ml_options_parse(struct ml_options *opt, int argc, char **argv); 55 void ml_options_dump(struct ml_options *opt); 56 57 #endif /* ML_OPTIONS_H */ 58