diff options
-rw-r--r-- | examples/graph_mobilenet.cpp | 10 | ||||
-rw-r--r-- | utils/CommonGraphOptions.h | 10 |
2 files changed, 15 insertions, 5 deletions
diff --git a/examples/graph_mobilenet.cpp b/examples/graph_mobilenet.cpp index 9304b2b380..2b662d9055 100644 --- a/examples/graph_mobilenet.cpp +++ b/examples/graph_mobilenet.cpp @@ -37,20 +37,24 @@ using namespace arm_compute::graph_utils; * @param[in] argc Number of arguments * @param[in] argv Arguments */ -class GraphMobilenetExample : public Example // NOLINT +class GraphMobilenetExample : public Example { public: GraphMobilenetExample() : cmd_parser(), common_opts(cmd_parser), common_params(), graph(0, "MobileNetV1") { + // Sets default layout to NHWC + common_opts.data_layout->parse("NHWC"); + // Add model id option model_id_opt = cmd_parser.add_option<SimpleOption<int>>("model-id", 0); model_id_opt->set_help("Mobilenet model id (0: 1.0_224, else: 0.75_160"); } - /** Prevent instances of this class from being copy constructed */ GraphMobilenetExample(const GraphMobilenetExample &) = delete; - /** Prevent instances of this class from being copied */ GraphMobilenetExample &operator=(const GraphMobilenetExample &) = delete; + GraphMobilenetExample(GraphMobilenetExample &&) = default; // NOLINT + GraphMobilenetExample &operator=(GraphMobilenetExample &&) = default; // NOLINT + ~GraphMobilenetExample() override = default; bool do_setup(int argc, char **argv) override { // Parse arguments diff --git a/utils/CommonGraphOptions.h b/utils/CommonGraphOptions.h index ef2e4fb946..b429a18069 100644 --- a/utils/CommonGraphOptions.h +++ b/utils/CommonGraphOptions.h @@ -79,10 +79,16 @@ public: * @param[in,out] parser A parser on which "parse()" hasn't been called yet. */ CommonGraphOptions(CommandLineParser &parser); - /** Prevent instances of this class from being copy constructed */ + /** Prevent instances of this class from being copied (As this class contains pointers) */ CommonGraphOptions(const CommonGraphOptions &) = delete; - /** Prevent instances of this class from being copied */ + /** Prevent instances of this class from being copied (As this class contains pointers) */ CommonGraphOptions &operator=(const CommonGraphOptions &) = delete; + /** Allow instances of this class to be moved */ + CommonGraphOptions(CommonGraphOptions &&) = default; + /** Allow instances of this class to be moved */ + CommonGraphOptions &operator=(CommonGraphOptions &&) = default; + /** Default destructor */ + ~CommonGraphOptions() = default; ToggleOption *help; /**< Show help option */ SimpleOption<int> *threads; /**< Number of threads option */ |