MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / do_setup

Method do_setup

examples/neon_sgemm.cpp:54–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52{
53public:
54 bool do_setup(int argc, char **argv) override
55 {
56 NPYLoader npy0;
57 NPYLoader npy1;
58 NPYLoader npy2;
59 alpha = 1.0f;
60 beta = 0.0f;
61 is_dynamic = false;
62 is_constant_b_c = false;
63 is_bias_present = false;
64
65 utils::CommandLineParser parser;
66
67 auto help_opt = parser.add_option<utils::ToggleOption>("help");
68 help_opt->set_help("Print help message and exit");
69
70 auto src0_opt = parser.add_option<utils::SimpleOption<std::string>>("src0");
71 src0_opt->set_help("File name with NPY data for src0");
72
73 auto src1_opt = parser.add_option<utils::SimpleOption<std::string>>("src1");
74 src1_opt->set_help("File name with NPY data for src1");
75
76 auto src2_opt = parser.add_option<utils::SimpleOption<std::string>>("src2");
77 src2_opt->set_help("File name with NPY data for src2");
78
79 auto m_opt = parser.add_option<utils::SimpleOption<int>>("m");
80 m_opt->set_help("M shape. This cannot be set together with src0/src1/src2");
81 auto n_opt = parser.add_option<utils::SimpleOption<int>>("n");
82 n_opt->set_help("N shape. This cannot be set together with src0/src1/src2");
83 auto k_opt = parser.add_option<utils::SimpleOption<int>>("k");
84 k_opt->set_help("K shape. This cannot be set together with src0/src1/src2");
85
86 auto alpha_opt = parser.add_option<utils::SimpleOption<float>>("alpha", 1.0f);
87 alpha_opt->set_help("Alpha value. Default = 1.0");
88
89 auto beta_opt = parser.add_option<utils::SimpleOption<float>>("beta", 0.0f);
90 beta_opt->set_help("Beta value. Default = 0.0");
91
92 auto constant_b_c_opt = parser.add_option<utils::ToggleOption>("constant_b_c", false);
93 constant_b_c_opt->set_help("Whether B and C should be treated as constant data. Default = false");
94
95 auto mode_opt = parser.add_option<utils::SimpleOption<std::string>>("mode", "static");
96 mode_opt->set_help("GEMM mode. Allowed values: static, dynamic. Default value: static");
97
98 auto threads_ops = parser.add_option<utils::SimpleOption<int>>("threads", 0);
99 threads_ops->set_help(
100 "Number of threads to use. When 0 or not present - one thread per CPU core will be used.");
101
102 parser.parse(argc, argv);
103
104 if (help_opt->is_set() && help_opt->value())
105 {
106 parser.print_help(argv[0]);
107 return false;
108 }
109 const bool shapes_set = m_opt->is_set() && n_opt->is_set() && k_opt->is_set();
110 const bool files_set = src0_opt->is_set() && src1_opt->is_set() && src2_opt->is_set();
111

Callers

nothing calls this directly

Calls 15

equal_floatFunction · 0.85
init_sgemm_outputFunction · 0.85
fill_random_tensorFunction · 0.85
set_helpMethod · 0.80
is_setMethod · 0.80
print_helpMethod · 0.80
is_fortranMethod · 0.80
file_existsFunction · 0.70
TensorInfoClass · 0.50
TensorShapeClass · 0.50
parseMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected