From e2220551b7a64b929650ba9a60529c31e70c13c5 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 20 Jul 2018 13:23:44 +0100 Subject: COMPMID-1367: Enable NHWC in graph examples Change-Id: Iabc54a3a1bdcd46a9a921cda39c7c85fef672b72 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/141449 Reviewed-by: Giorgio Arena Reviewed-by: Anthony Barbier Tested-by: Jenkins --- utils/CommonGraphOptions.cpp | 6 +++--- utils/CommonGraphOptions.h | 2 +- utils/TypePrinter.h | 29 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) (limited to 'utils') diff --git a/utils/CommonGraphOptions.cpp b/utils/CommonGraphOptions.cpp index 7ac7bbce2b..2e5d787448 100644 --- a/utils/CommonGraphOptions.cpp +++ b/utils/CommonGraphOptions.cpp @@ -84,7 +84,7 @@ namespace utils os << "Data layout : " << common_params.data_layout << std::endl; os << "Tuner enabled? : " << (common_params.enable_tuner ? true_str : false_str) << std::endl; os << "Tuner file : " << common_params.tuner_file << std::endl; - os << "Fast math enabled? : " << (common_params.fast_math_hint == FastMathHint::ENABLED ? true_str : false_str) << std::endl; + os << "Fast math enabled? : " << (common_params.fast_math_hint == FastMathHint::Enabled ? true_str : false_str) << std::endl; if(!common_params.data_path.empty()) { os << "Data path : " << common_params.data_path << std::endl; @@ -168,7 +168,7 @@ CommonGraphOptions::CommonGraphOptions(CommandLineParser &parser) CommonGraphParams consume_common_graph_parameters(CommonGraphOptions &options) { - FastMathHint fast_math_hint_value = options.fast_math_hint->value() ? FastMathHint::ENABLED : FastMathHint::DISABLED; + FastMathHint fast_math_hint_value = options.fast_math_hint->value() ? FastMathHint::Enabled : FastMathHint::Disabled; auto validation_range = parse_validation_range(options.validation_range->value()); CommonGraphParams common_params; @@ -178,7 +178,7 @@ CommonGraphParams consume_common_graph_parameters(CommonGraphOptions &options) common_params.data_type = options.data_type->value(); common_params.data_layout = options.data_layout->value(); common_params.enable_tuner = options.enable_tuner->is_set() ? options.enable_tuner->value() : false; - common_params.fast_math_hint = options.fast_math_hint->is_set() ? fast_math_hint_value : FastMathHint::DISABLED; + common_params.fast_math_hint = options.fast_math_hint->is_set() ? fast_math_hint_value : FastMathHint::Disabled; common_params.data_path = options.data_path->value(); common_params.image = options.image->value(); common_params.labels = options.labels->value(); diff --git a/utils/CommonGraphOptions.h b/utils/CommonGraphOptions.h index ce4a2c9dd1..23c3cc7c30 100644 --- a/utils/CommonGraphOptions.h +++ b/utils/CommonGraphOptions.h @@ -93,7 +93,7 @@ struct CommonGraphParams arm_compute::DataType data_type{ DataType::F32 }; arm_compute::DataLayout data_layout{ DataLayout::NCHW }; bool enable_tuner{ false }; - arm_compute::graph::FastMathHint fast_math_hint{ arm_compute::graph::FastMathHint::DISABLED }; + arm_compute::graph::FastMathHint fast_math_hint{ arm_compute::graph::FastMathHint::Disabled }; std::string data_path{}; std::string image{}; std::string labels{}; diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index eb03ff9b96..8bfdba9725 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -475,6 +475,35 @@ inline std::string to_string(const arm_compute::DataLayout &data_layout) return str.str(); } +/** Formatted output of the DataLayoutDimension type. + * + * @param[out] os Output stream. + * @param[in] data_layout_dim Data layout dimension to print. + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const DataLayoutDimension &data_layout_dim) +{ + switch(data_layout_dim) + { + case DataLayoutDimension::WIDTH: + os << "WIDTH"; + break; + case DataLayoutDimension::HEIGHT: + os << "HEIGHT"; + break; + case DataLayoutDimension::CHANNEL: + os << "CHANNEL"; + break; + case DataLayoutDimension::BATCHES: + os << "BATCHES"; + break; + default: + ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); + } + return os; +} + /** Formatted output of the DataType type. * * @param[out] os Output stream. -- cgit v1.2.1