From ed99f411d52949720a4d64d91664cd71e46b79d5 Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Wed, 21 Mar 2018 17:45:31 +0000 Subject: COMPMID-1018 - Add Winograd support in VGG16 and Alexnet examples Change-Id: I4a2deee9e4b2c54ea79d2895cfeca44190133b24 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/125453 Reviewed-by: Pablo Tello Tested-by: Jenkins --- src/graph/nodes/ConvolutionLayer.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/graph/nodes/ConvolutionLayer.cpp') diff --git a/src/graph/nodes/ConvolutionLayer.cpp b/src/graph/nodes/ConvolutionLayer.cpp index d8089d804d..5b3a84a4ad 100644 --- a/src/graph/nodes/ConvolutionLayer.cpp +++ b/src/graph/nodes/ConvolutionLayer.cpp @@ -26,6 +26,7 @@ #include "arm_compute/graph/Error.h" #include "arm_compute/runtime/CL/functions/CLConvolutionLayer.h" #include "arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h" +#include "arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h" #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/NEON/functions/NEConvolutionLayer.h" #include "arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h" @@ -107,8 +108,14 @@ std::unique_ptr instantiate(arm_comp const WeightsInfo &weights_info, ConvolutionMethodHint conv_method) { - if((conv_method == ConvolutionMethodHint::DIRECT) - && arm_compute::CLDirectConvolutionLayer::validate(input->info(), weights->info(), biases != nullptr ? biases->info() : nullptr, output->info(), conv_info)) // NOLINT + if((conv_method == ConvolutionMethodHint::WINOGRAD) + && arm_compute::CLWinogradConvolutionLayer::validate(input->info(), weights->info(), biases != nullptr ? biases->info() : nullptr, output->info(), conv_info)) // NOLINT + { + ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLWinogradConvolutionLayer"); + return instantiate_direct_function(input, weights, biases, output, conv_info); + } + else if((conv_method == ConvolutionMethodHint::DIRECT) + && arm_compute::CLDirectConvolutionLayer::validate(input->info(), weights->info(), biases != nullptr ? biases->info() : nullptr, output->info(), conv_info)) // NOLINT { ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating CLDirectConvolutionLayer"); return instantiate_direct_function(input, weights, biases, output, conv_info); @@ -159,10 +166,7 @@ class GroupedConvolutionFunction final : public arm_compute::IFunction { public: /** Default Constructor */ - GroupedConvolutionFunction() - : _convolutions() - { - } + GroupedConvolutionFunction() = default; /** Default Destructor */ ~GroupedConvolutionFunction() final = default; /** Prevent instances from being copy constructed */ @@ -177,12 +181,12 @@ public: * * @param convolution Convolution function to add */ - void add_convolution_function(std::unique_ptr convolution) + void add_convolution_function(std::unique_ptr convolution) // NOLINT { _convolutions.emplace_back(std::move(convolution)); } - // Inherited methods overriden: + // Inherited methods overridden: void run() override { for(auto &c : _convolutions) @@ -192,7 +196,7 @@ public: } private: - std::vector> _convolutions; + std::vector> _convolutions{}; }; std::unique_ptr ConvolutionLayer::instantiate_node(GraphContext &ctx, ITensorObject *input, ITensorObject *output) -- cgit v1.2.1