From 11a7e32230121e457252084f8b93357814fe57e5 Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Thu, 5 Jul 2018 15:42:02 +0100 Subject: COMPMID-1246 - Enabled NHWC on graph_mobilenet by default Change-Id: I195d4a0e6fee4cd4ca42403256a9fe639b83fa3d Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/138925 Tested-by: Jenkins Reviewed-by: Giorgio Arena --- examples/graph_mobilenet.cpp | 10 +++++++--- 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>("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 *threads; /**< Number of threads option */ -- cgit v1.2.1