From 7d3d1b923b7793f1cf5e29c78bfda2582522cf25 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 12 Oct 2017 17:34:20 +0100 Subject: COMPMID-619: Logging interface Change-Id: I73d1433ee7a682aeabb7540aa2ea1f6564f90aae Reviewed-on: http://mpd-gerrit.cambridge.arm.com/91775 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- src/core/Logger.cpp | 56 ---------- src/core/utils/io/FileHandler.cpp | 66 ++++++++++++ src/core/utils/logging/FilePrinter.cpp | 37 +++++++ src/core/utils/logging/Helpers.cpp | 42 ++++++++ src/core/utils/logging/Logger.cpp | 154 ++++++++++++++++++++++++++++ src/core/utils/logging/LoggerRegistry.cpp | 79 ++++++++++++++ src/graph/nodes/ActivationLayer.cpp | 17 +-- src/graph/nodes/BatchNormalizationLayer.cpp | 13 ++- src/graph/nodes/ConvolutionLayer.cpp | 23 ++--- src/graph/nodes/FloorLayer.cpp | 13 ++- src/graph/nodes/FullyConnectedLayer.cpp | 15 +-- src/graph/nodes/L2NormalizeLayer.cpp | 13 ++- src/graph/nodes/NormalizationLayer.cpp | 13 +-- src/graph/nodes/PoolingLayer.cpp | 11 +- src/graph/nodes/SoftmaxLayer.cpp | 11 +- 15 files changed, 443 insertions(+), 120 deletions(-) delete mode 100644 src/core/Logger.cpp create mode 100644 src/core/utils/io/FileHandler.cpp create mode 100644 src/core/utils/logging/FilePrinter.cpp create mode 100644 src/core/utils/logging/Helpers.cpp create mode 100644 src/core/utils/logging/Logger.cpp create mode 100644 src/core/utils/logging/LoggerRegistry.cpp (limited to 'src') diff --git a/src/core/Logger.cpp b/src/core/Logger.cpp deleted file mode 100644 index 9c3bf263a6..0000000000 --- a/src/core/Logger.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2017 ARM Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "arm_compute/core/Logger.h" - -using namespace arm_compute; - -Logger::Logger() - : _ostream(&std::cout), _nullstream(nullptr), _verbosity(LoggerVerbosity::NONE) -{ -} - -Logger &Logger::get() -{ - static Logger _instance; - return _instance; -} - -void Logger::set_logger(std::ostream &ostream, LoggerVerbosity verbosity) -{ - _ostream = &ostream; - _verbosity = verbosity; -} - -std::ostream &Logger::log_info() -{ - if(_verbosity == LoggerVerbosity::INFO) - { - return *_ostream; - } - else - { - return _nullstream; - } -} \ No newline at end of file diff --git a/src/core/utils/io/FileHandler.cpp b/src/core/utils/io/FileHandler.cpp new file mode 100644 index 0000000000..70bce42b0b --- /dev/null +++ b/src/core/utils/io/FileHandler.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include + +#include "arm_compute/core/utils/io/FileHandler.h" + +#include "arm_compute/core/Error.h" +#include "support/ToolchainSupport.h" + +using namespace arm_compute::io; + +FileHandler::FileHandler() + : _filestream(), _filename(" "), _mode() +{ +} + +FileHandler::~FileHandler() +{ + close(); +} + +void FileHandler::open(const std::string &filename, std::ios_base::openmode mode) +{ + close(); + ; + _filestream.open(filename, mode); + ARM_COMPUTE_ERROR_ON(!_filestream.good()); + _filename = filename; + _mode = mode; +} + +void FileHandler::close() +{ + _filestream.close(); +} + +std::fstream &FileHandler::stream() +{ + return _filestream; +} + +std::string FileHandler::filename() const +{ + return _filename; +} diff --git a/src/core/utils/logging/FilePrinter.cpp b/src/core/utils/logging/FilePrinter.cpp new file mode 100644 index 0000000000..b699afc22a --- /dev/null +++ b/src/core/utils/logging/FilePrinter.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/core/utils/logging/FilePrinter.h" + +using namespace arm_compute::logging; + +FilePrinter::FilePrinter(const std::string &filename) + : _handler() +{ + _handler.open(filename, std::fstream::out | std::fstream::trunc); +} + +void FilePrinter::print_internal(const std::string &msg) +{ + _handler.stream() << msg << std::endl; +} \ No newline at end of file diff --git a/src/core/utils/logging/Helpers.cpp b/src/core/utils/logging/Helpers.cpp new file mode 100644 index 0000000000..f5ab608c3a --- /dev/null +++ b/src/core/utils/logging/Helpers.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/core/utils/logging/Helpers.h" + +#include +#include + +using namespace arm_compute::logging; + +const std::string &arm_compute::logging::string_from_log_level(LogLevel log_level) +{ + static std::map log_level_map = + { + { LogLevel::VERBOSE, "VERBOSE" }, + { LogLevel::INFO, "INFO" }, + { LogLevel::WARN, "WARN" }, + { LogLevel::OFF, "OFF" }, + }; + + return log_level_map[log_level]; +} \ No newline at end of file diff --git a/src/core/utils/logging/Logger.cpp b/src/core/utils/logging/Logger.cpp new file mode 100644 index 0000000000..b025ca8097 --- /dev/null +++ b/src/core/utils/logging/Logger.cpp @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/core/utils/logging/Logger.h" + +#include "arm_compute/core/Error.h" +#include "support/ToolchainSupport.h" + +using namespace arm_compute::logging; + +Logger::Logger(std::string name, LogLevel log_level, std::shared_ptr printer) + : _name(std::move(name)), _log_level(log_level), _printers( +{ + std::move(printer) +}), _decorators() +{ + // Check printer + ARM_COMPUTE_ERROR_ON(printer == nullptr); + + // Set default message decorators + set_default_decorators(); +} + +Logger::Logger(std::string name, LogLevel log_level, std::vector> printers) + : _name(std::move(name)), _log_level(log_level), _printers(std::move(printers)), _decorators() +{ + // Check printers + for(const auto &p : _printers) + { + ARM_COMPUTE_UNUSED(p); + ARM_COMPUTE_ERROR_ON(p == nullptr); + } + // Set default message decorators + set_default_decorators(); +} + +Logger::Logger(std::string name, + LogLevel log_level, + std::vector> printers, + std::vector> decorators) + : _name(std::move(name)), _log_level(log_level), _printers(std::move(printers)), _decorators(std::move(decorators)) +{ + // Check printers + for(const auto &p : _printers) + { + ARM_COMPUTE_UNUSED(p); + ARM_COMPUTE_ERROR_ON(p == nullptr); + } + // Check decorators + for(const auto &d : _decorators) + { + ARM_COMPUTE_UNUSED(d); + ARM_COMPUTE_ERROR_ON(d == nullptr); + } +} + +void Logger::log(LogLevel log_level, const std::string &msg) +{ + // Return if message shouldn't be logged + // i.e. if log level does not match the logger's + if(!is_loggable(log_level)) + { + return; + } + + // Print message to all printers + print_all(create_log_msg(msg, log_level)); +} + +void Logger::set_log_level(LogLevel log_level) +{ + _log_level = log_level; +} + +LogLevel Logger::log_level() const +{ + return _log_level; +} + +std::string Logger::name() const +{ + return _name; +} + +void Logger::add_printer(std::shared_ptr printer) +{ + ARM_COMPUTE_ERROR_ON(printer == nullptr); + _printers.push_back(std::move(printer)); +} + +void Logger::add_decorator(std::unique_ptr decorator) +{ + ARM_COMPUTE_ERROR_ON(decorator == nullptr); + _decorators.push_back(std::move(decorator)); +} + +void Logger::set_default_decorators() +{ + _decorators.emplace_back(support::cpp14::make_unique(_name)); + _decorators.emplace_back(support::cpp14::make_unique()); + _decorators.emplace_back(support::cpp14::make_unique()); +} + +bool Logger::is_loggable(LogLevel log_level) +{ + return (log_level >= _log_level); +} + +void Logger::decorate_log_msg(LogMsg &msg) +{ + for(const auto &d : _decorators) + { + d->decorate(msg); + } + msg.raw_ += std::string(" "); +} + +std::string Logger::create_log_msg(const std::string &str, LogLevel log_level) +{ + // Adding space string to avoid Android failures + LogMsg log_msg(" ", log_level); + decorate_log_msg(log_msg); + std::ostringstream ss; + ss << log_msg.raw_ << " " << str; + return ss.str(); +} + +void Logger::print_all(const std::string &msg) +{ + for(auto &p : _printers) + { + p->print(msg); + } +} \ No newline at end of file diff --git a/src/core/utils/logging/LoggerRegistry.cpp b/src/core/utils/logging/LoggerRegistry.cpp new file mode 100644 index 0000000000..99236d25c3 --- /dev/null +++ b/src/core/utils/logging/LoggerRegistry.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/core/utils/logging/LoggerRegistry.h" + +#include "arm_compute/core/Error.h" +#include "support/ToolchainSupport.h" + +using namespace arm_compute::logging; + +/** Reserved logger used by the library */ +std::set LoggerRegistry::_reserved_loggers = { "CORE", "RUNTIME", "GRAPH" }; + +LoggerRegistry::LoggerRegistry() + : _mtx(), _loggers() +{ +} + +LoggerRegistry &LoggerRegistry::get() +{ + static LoggerRegistry _instance; + return _instance; +} + +void LoggerRegistry::create_logger(const std::string &name, LogLevel log_level, std::vector> printers) +{ + std::lock_guard lock(_mtx); + if((_loggers.find(name) == _loggers.end()) && (_reserved_loggers.find(name) == _reserved_loggers.end())) + { + _loggers[name] = std::make_shared(name, log_level, std::move(printers)); + } +} + +void LoggerRegistry::remove_logger(const std::string &name) +{ + std::lock_guard lock(_mtx); + if(_loggers.find(name) != _loggers.end()) + { + _loggers.erase(name); + } +} + +std::shared_ptr LoggerRegistry::logger(const std::string &name) +{ + std::lock_guard lock(_mtx); + return (_loggers.find(name) != _loggers.end()) ? _loggers[name] : nullptr; +} + +void LoggerRegistry::create_reserved_loggers(LogLevel log_level, std::vector> printers) +{ + std::lock_guard lock(_mtx); + for(const auto &r : _reserved_loggers) + { + if(_loggers.find(r) == _loggers.end()) + { + _loggers[r] = std::make_shared(r, log_level, printers); + } + } +} diff --git a/src/graph/nodes/ActivationLayer.cpp b/src/graph/nodes/ActivationLayer.cpp index 5e75c28bc7..df73ba7078 100644 --- a/src/graph/nodes/ActivationLayer.cpp +++ b/src/graph/nodes/ActivationLayer.cpp @@ -23,7 +23,6 @@ */ #include "arm_compute/graph/nodes/ActivationLayer.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLActivationLayer.h" #include "arm_compute/runtime/NEON/functions/NEActivationLayer.h" @@ -82,18 +81,20 @@ std::unique_ptr ActivationLayer::instantiate_node(GraphC if(_target_hint == TargetHint::OPENCL) { func = instantiate(in, out, _activation_info); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLActivationLayer"); } else { func = instantiate(in, out, _activation_info); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NEActivationLayer"); } - ARM_COMPUTE_LOG(" Data Type: " << in->info()->data_type() - << " Input shape: " << in->info()->tensor_shape() - << " Output shape: " << out->info()->tensor_shape() - << " Activation function: " << _activation_info.activation() - << " a: " << _activation_info.a() - << " b: " << _activation_info.b() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Data Type: " << in->info()->data_type() + << " Input shape: " << in->info()->tensor_shape() + << " Output shape: " << out->info()->tensor_shape() + << " Activation function: " << _activation_info.activation() + << " a: " << _activation_info.a() + << " b: " << _activation_info.b() + << std::endl); return func; } diff --git a/src/graph/nodes/BatchNormalizationLayer.cpp b/src/graph/nodes/BatchNormalizationLayer.cpp index 25e9e9bffb..db809f4ee4 100644 --- a/src/graph/nodes/BatchNormalizationLayer.cpp +++ b/src/graph/nodes/BatchNormalizationLayer.cpp @@ -23,7 +23,6 @@ */ #include "arm_compute/graph/nodes/BatchNormalizationLayer.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLBatchNormalizationLayer.h" #include "arm_compute/runtime/NEON/functions/NEBatchNormalizationLayer.h" @@ -100,18 +99,18 @@ std::unique_ptr BatchNormalizationLayer::instantiate_nod if(_target_hint == TargetHint::OPENCL) { func = instantiate(in, out, _mean, _var, _beta, _gamma, _epsilon); - ARM_COMPUTE_LOG("Instantiating CLBatchNormalizationLayer"); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLBatchNormalizationLayer"); } else { func = instantiate(in, out, _mean, _var, _beta, _gamma, _epsilon); - ARM_COMPUTE_LOG("Instantiating NEBatchNormalizationLayer"); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NEBatchNormalizationLayer"); } - ARM_COMPUTE_LOG(" Data Type: " << in->info()->data_type() - << " Input shape: " << in->info()->tensor_shape() - << " Output shape: " << out->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Data Type: " << in->info()->data_type() + << " Input shape: " << in->info()->tensor_shape() + << " Output shape: " << out->info()->tensor_shape() + << std::endl); return func; } \ No newline at end of file diff --git a/src/graph/nodes/ConvolutionLayer.cpp b/src/graph/nodes/ConvolutionLayer.cpp index 303780ff35..07d42617e2 100644 --- a/src/graph/nodes/ConvolutionLayer.cpp +++ b/src/graph/nodes/ConvolutionLayer.cpp @@ -23,7 +23,6 @@ */ #include "arm_compute/graph/nodes/ConvolutionLayer.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/functions/CLConvolutionLayer.h" #include "arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h" #include "arm_compute/runtime/IFunction.h" @@ -217,12 +216,12 @@ std::unique_ptr ConvolutionLayer::instantiate_node(Graph if(_num_groups == 1) { func = instantiate_convolution(in, out, conv_method_hint); - ARM_COMPUTE_LOG("Instantiating CLConvolutionLayer"); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLConvolutionLayer"); } else { func = instantiate_grouped_convolution(in, out, conv_method_hint); - ARM_COMPUTE_LOG("Instantiating NEConvolutionLayer"); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NEConvolutionLayer"); } // Fill weights @@ -236,15 +235,15 @@ std::unique_ptr ConvolutionLayer::instantiate_node(Graph _biases.allocate_and_fill_if_needed(); } - ARM_COMPUTE_LOG(" Data Type: " << in->info()->data_type() - << " Input Shape: " << in->info()->tensor_shape() - << " Weights shape: " << _weights.info().tensor_shape() - << " Biases Shape: " << _biases.info().tensor_shape() - << " Output Shape: " << out->info()->tensor_shape() - << " PadStrideInfo: " << _conv_info - << " Groups: " << _num_groups - << " WeightsInfo: " << _weights_info - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Data Type: " << in->info()->data_type() + << " Input Shape: " << in->info()->tensor_shape() + << " Weights shape: " << _weights.info().tensor_shape() + << " Biases Shape: " << _biases.info().tensor_shape() + << " Output Shape: " << out->info()->tensor_shape() + << " PadStrideInfo: " << _conv_info + << " Groups: " << _num_groups + << " WeightsInfo: " << _weights_info + << std::endl); return func; } diff --git a/src/graph/nodes/FloorLayer.cpp b/src/graph/nodes/FloorLayer.cpp index 3224799e3e..45e2c3ee41 100644 --- a/src/graph/nodes/FloorLayer.cpp +++ b/src/graph/nodes/FloorLayer.cpp @@ -23,7 +23,6 @@ */ #include "arm_compute/graph/nodes/FloorLayer.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLFloor.h" #include "arm_compute/runtime/NEON/functions/NEFloor.h" @@ -76,18 +75,18 @@ std::unique_ptr FloorLayer::instantiate_node(GraphContex if(_target_hint == TargetHint::OPENCL) { func = instantiate(in, out); - ARM_COMPUTE_LOG("Instantiating CLFloorLayer"); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLFloorLayer"); } else { func = instantiate(in, out); - ARM_COMPUTE_LOG("Instantiating NEFloorLayer"); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NEFloorLayer"); } - ARM_COMPUTE_LOG(" Data Type: " << in->info()->data_type() - << " Input shape: " << in->info()->tensor_shape() - << " Output shape: " << out->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Data Type: " << in->info()->data_type() + << " Input shape: " << in->info()->tensor_shape() + << " Output shape: " << out->info()->tensor_shape() + << std::endl); return func; } diff --git a/src/graph/nodes/FullyConnectedLayer.cpp b/src/graph/nodes/FullyConnectedLayer.cpp index fa5ead8bdd..5f4807ad48 100644 --- a/src/graph/nodes/FullyConnectedLayer.cpp +++ b/src/graph/nodes/FullyConnectedLayer.cpp @@ -24,7 +24,6 @@ #include "arm_compute/graph/nodes/FullyConnectedLayer.h" #include "arm_compute/core/Helpers.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h" #include "arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h" #include "support/ToolchainSupport.h" @@ -123,18 +122,20 @@ std::unique_ptr FullyConnectedLayer::instantiate_node(Gr if(_target_hint == TargetHint::OPENCL) { func = instantiate(in, _weights, _biases, out); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLFullyConnectedLayer"); } else { func = instantiate(in, _weights, _biases, out); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NEFullyConnectedLayer"); } - ARM_COMPUTE_LOG(" Type: " << in->info()->data_type() - << " Input Shape: " << in->info()->tensor_shape() - << " Weights shape: " << _weights.info().tensor_shape() - << " Biases Shape: " << _biases.info().tensor_shape() - << " Output Shape: " << out->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Type: " << in->info()->data_type() + << " Input Shape: " << in->info()->tensor_shape() + << " Weights shape: " << _weights.info().tensor_shape() + << " Biases Shape: " << _biases.info().tensor_shape() + << " Output Shape: " << out->info()->tensor_shape() + << std::endl); return func; } diff --git a/src/graph/nodes/L2NormalizeLayer.cpp b/src/graph/nodes/L2NormalizeLayer.cpp index 7abc69c13a..c5689e159a 100644 --- a/src/graph/nodes/L2NormalizeLayer.cpp +++ b/src/graph/nodes/L2NormalizeLayer.cpp @@ -23,7 +23,6 @@ */ #include "arm_compute/graph/nodes/L2NormalizeLayer.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLL2Normalize.h" #include "arm_compute/runtime/NEON/functions/NEL2Normalize.h" @@ -78,18 +77,18 @@ std::unique_ptr L2NormalizeLayer::instantiate_node(Graph if(_target_hint == TargetHint::OPENCL) { func = instantiate(in, out, _axis, _epsilon); - ARM_COMPUTE_LOG("Instantiating CLL2NormalizeLayer"); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLL2NormalizeLayer"); } else { func = instantiate(in, out, _axis, _epsilon); - ARM_COMPUTE_LOG("Instantiating NEL2NormalizeLayer"); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NEL2NormalizeLayer"); } - ARM_COMPUTE_LOG(" Data Type: " << in->info()->data_type() - << " Input shape: " << in->info()->tensor_shape() - << " Output shape: " << out->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Data Type: " << in->info()->data_type() + << " Input shape: " << in->info()->tensor_shape() + << " Output shape: " << out->info()->tensor_shape() + << std::endl); return func; } diff --git a/src/graph/nodes/NormalizationLayer.cpp b/src/graph/nodes/NormalizationLayer.cpp index 319a4252b6..680925a2b9 100644 --- a/src/graph/nodes/NormalizationLayer.cpp +++ b/src/graph/nodes/NormalizationLayer.cpp @@ -23,7 +23,6 @@ */ #include "arm_compute/graph/nodes/NormalizationLayer.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLNormalizationLayer.h" #include "arm_compute/runtime/NEON/functions/NENormalizationLayer.h" @@ -82,17 +81,19 @@ std::unique_ptr NormalizationLayer::instantiate_node(Gra if(_target_hint == TargetHint::OPENCL) { func = instantiate(in, out, _norm_info); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLNormalizationLayer"); } else { func = instantiate(in, out, _norm_info); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NENormalizationLayer"); } - ARM_COMPUTE_LOG(" Data Type: " << in->info()->data_type() - << " Input shape: " << in->info()->tensor_shape() - << " Output shape: " << out->info()->tensor_shape() - << " Normalization info: " << _norm_info - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Data Type: " << in->info()->data_type() + << " Input shape: " << in->info()->tensor_shape() + << " Output shape: " << out->info()->tensor_shape() + << " Normalization info: " << _norm_info + << std::endl); return func; } diff --git a/src/graph/nodes/PoolingLayer.cpp b/src/graph/nodes/PoolingLayer.cpp index 904ba18169..63579155cb 100644 --- a/src/graph/nodes/PoolingLayer.cpp +++ b/src/graph/nodes/PoolingLayer.cpp @@ -23,7 +23,6 @@ */ #include "arm_compute/graph/nodes/PoolingLayer.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLPoolingLayer.h" #include "arm_compute/runtime/NEON/functions/NEPoolingLayer.h" @@ -82,16 +81,18 @@ std::unique_ptr PoolingLayer::instantiate_node(GraphCont if(_target_hint == TargetHint::OPENCL) { func = instantiate(in, out, _pool_info); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLPoolingLayer"); } else { func = instantiate(in, out, _pool_info); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NEPoolingLayer"); } - ARM_COMPUTE_LOG(" Data Type: " << in->info()->data_type() - << " Input shape: " << in->info()->tensor_shape() - << " Output shape: " << out->info()->tensor_shape() - << " Pooling info: " << _pool_info << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Data Type: " << in->info()->data_type() + << " Input shape: " << in->info()->tensor_shape() + << " Output shape: " << out->info()->tensor_shape() + << " Pooling info: " << _pool_info << std::endl); return func; } diff --git a/src/graph/nodes/SoftmaxLayer.cpp b/src/graph/nodes/SoftmaxLayer.cpp index e3345f1400..3cdbc9c96a 100644 --- a/src/graph/nodes/SoftmaxLayer.cpp +++ b/src/graph/nodes/SoftmaxLayer.cpp @@ -23,7 +23,6 @@ */ #include "arm_compute/graph/nodes/SoftmaxLayer.h" -#include "arm_compute/core/Logger.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLSoftmaxLayer.h" #include "arm_compute/runtime/NEON/functions/NESoftmaxLayer.h" @@ -76,16 +75,18 @@ std::unique_ptr SoftmaxLayer::instantiate_node(GraphCont if(_target_hint == TargetHint::OPENCL) { func = instantiate(in, out); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLSoftmaxLayer"); } else { func = instantiate(in, out); + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NESoftmaxLayer"); } - ARM_COMPUTE_LOG(" Data Type: " << in->info()->data_type() - << " Input shape: " << in->info()->tensor_shape() - << " Output shape: " << out->info()->tensor_shape() - << std::endl); + ARM_COMPUTE_LOG_GRAPH_INFO(" Data Type: " << in->info()->data_type() + << " Input shape: " << in->info()->tensor_shape() + << " Output shape: " << out->info()->tensor_shape() + << std::endl); return func; } -- cgit v1.2.1