HEBench
hebench_dataset_loader_functional_test.h
Go to the documentation of this file.
1 // Copyright (C) 2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #ifndef __HEBENCH_DATASET_LOADER_FUNCTIONAL_TEST__H__
5 #define __HEBENCH_DATASET_LOADER_FUNCTIONAL_TEST__H__
6 
8 #include <cstdlib>
9 #include <cstring>
10 #include <filesystem>
11 #include <iostream>
12 #include <map>
13 #include <stdexcept>
14 
16 {
17  i32,
18  i64,
19  f32,
20  f64,
21  data_fail
22 };
23 
24 constexpr std::uint8_t help_arg = 1;
25 constexpr const char *help_msg = "NAME\n\tdata_loader - launches the data loader module.\n\n"
26  "SYNOPSYS\n\tdata_loader [OPTION] [FILE] [DATA_TYPE] [MAX_LOAD]\n\n"
27  "DESCRIPTION\n\tIs a launcher app to test the data loader module.\n"
28  "\tWith no MAX_LOAD, it will be set to 0.\n\n"
29  "\t-h, --help displays help mesage and exits";
30 constexpr const char *check_usage = "Please check the correct usage by typing \"data_loader -h\" or"
31  " \"data_loader --help\".";
32 constexpr const char *help_cstr_short = "-h";
33 constexpr const char *help_cstr_long = "--help";
34 
35 constexpr std::uint8_t file_path_arg = 1;
36 constexpr std::uint8_t type_arg = 2;
37 constexpr std::uint8_t max_loaded_size_arg = 3;
38 
39 constexpr std::uint8_t max_args_allowed = 4;
40 constexpr std::uint8_t min_args_allowed = 2;
41 
42 void signal_error(const char *msg, bool usage = false);
43 std::uint8_t get_type_from_data(std::string);
44 void load_from_csv(std::string data, std::filesystem::path file_path, std::uint64_t max_loaded_size);
45 
46 #endif
void signal_error(const char *msg, bool usage=false)
constexpr const char * check_usage
constexpr const char * help_msg
void load_from_csv(std::string data, std::filesystem::path file_path, std::uint64_t max_loaded_size)
constexpr const char * help_cstr_long
constexpr std::uint8_t type_arg
constexpr std::uint8_t help_arg
constexpr std::uint8_t file_path_arg
constexpr std::uint8_t min_args_allowed
constexpr const char * help_cstr_short
std::uint8_t get_type_from_data(std::string)
constexpr std::uint8_t max_loaded_size_arg
constexpr std::uint8_t max_args_allowed