diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-01-02 13:27:37 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:42:33 +0000 |
commit | 1250a5a259962514d31bb5f8148f1d0f0a82b946 (patch) | |
tree | a9c16daffa5228926715c805d73310b4b3c2e324 /src/graph | |
parent | 7c23ad01c028f73aef0b439fc5d5d14e92e5f4e2 (diff) | |
download | ComputeLibrary-1250a5a259962514d31bb5f8148f1d0f0a82b946.tar.gz |
COMPMID-767 : Propagate hints to subgraph.
-Propagates hints to subgraph.
-Fixes dispatching of apropriate optimized DepthwiseConvolution kernel
for OpenCL backend. NEON backend is altered to default to the generic
case until COMPMID-769 is addressed.
Change-Id: I544f05cd99a9ac253f1b19aa4e4bb222b8fdd087
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114781
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/graph')
-rw-r--r-- | src/graph/SubGraph.cpp | 4 | ||||
-rw-r--r-- | src/graph/nodes/BranchLayer.cpp | 2 | ||||
-rw-r--r-- | src/graph/operations/CLSimpleOperations.cpp | 4 | ||||
-rw-r--r-- | src/graph/operations/NESimpleOperations.cpp | 18 |
4 files changed, 9 insertions, 19 deletions
diff --git a/src/graph/SubGraph.cpp b/src/graph/SubGraph.cpp index 977cd4a4ae..f62b2617c5 100644 --- a/src/graph/SubGraph.cpp +++ b/src/graph/SubGraph.cpp @@ -52,13 +52,13 @@ void SubGraph::add_tensor_object(std::unique_ptr<ITensorObject> tensor) } } -std::unique_ptr<Graph> SubGraph::construct(TargetHint hint, std::unique_ptr<ITensorObject> input, std::unique_ptr<ITensorObject> output) +std::unique_ptr<Graph> SubGraph::construct(const GraphContext &ctx, std::unique_ptr<ITensorObject> input, std::unique_ptr<ITensorObject> output) { auto graph = arm_compute::support::cpp14::make_unique<Graph>(); // Set hint // TODO(geopin01): store hints of sub-graph - graph->hints().set_target_hint(hint); + graph->hints() = ctx.hints(); // Configure input if(_input == nullptr) diff --git a/src/graph/nodes/BranchLayer.cpp b/src/graph/nodes/BranchLayer.cpp index d062e4b791..eea0540741 100644 --- a/src/graph/nodes/BranchLayer.cpp +++ b/src/graph/nodes/BranchLayer.cpp @@ -151,7 +151,7 @@ std::unique_ptr<arm_compute::IFunction> BranchLayer::instantiate_node(GraphConte } // Construct sub_graph - auto g = sg->construct(ctx.hints().target_hint(), std::move(in), std::move(out)); + auto g = sg->construct(ctx, std::move(in), std::move(out)); // Register graph to function func->register_graph(std::move(g)); diff --git a/src/graph/operations/CLSimpleOperations.cpp b/src/graph/operations/CLSimpleOperations.cpp index 8f2bf23ce3..61315e73b2 100644 --- a/src/graph/operations/CLSimpleOperations.cpp +++ b/src/graph/operations/CLSimpleOperations.cpp @@ -156,13 +156,13 @@ REGISTER_SIMPLE_OPERATION(CLDepthwiseConvolutionOperation, OPENCL, OperationType bool run_3x3_opt = opt3x3 && weights->info()->dimension(0) == 3; if(run_3x3_opt) { - auto depwthwise_conv = arm_compute::support::cpp14::make_unique<arm_compute::CLDepthwiseConvolutionLayer>(); + auto depwthwise_conv = arm_compute::support::cpp14::make_unique<arm_compute::CLDepthwiseConvolutionLayer3x3>(); depwthwise_conv->configure(in, weights, biases, out, conv_info); func = std::move(depwthwise_conv); } else { - auto depwthwise_conv = arm_compute::support::cpp14::make_unique<arm_compute::CLDepthwiseConvolutionLayer3x3>(); + auto depwthwise_conv = arm_compute::support::cpp14::make_unique<arm_compute::CLDepthwiseConvolutionLayer>(); depwthwise_conv->configure(in, weights, biases, out, conv_info); func = std::move(depwthwise_conv); } diff --git a/src/graph/operations/NESimpleOperations.cpp b/src/graph/operations/NESimpleOperations.cpp index bb99e8da4b..88bf3ec0a0 100644 --- a/src/graph/operations/NESimpleOperations.cpp +++ b/src/graph/operations/NESimpleOperations.cpp @@ -149,23 +149,13 @@ REGISTER_SIMPLE_OPERATION(NEDepthwiseConvolutionOperation, NEON, OperationType:: auto *biases = ctx.num_inputs() == 3 ? dynamic_cast<arm_compute::ITensor *>(ctx.input(2)) : nullptr; auto *out = dynamic_cast<arm_compute::ITensor *>(ctx.output(0)); const auto conv_info = ctx.parameter<PadStrideInfo>("ConvolutionInfo"); - const auto opt3x3 = ctx.parameter<bool>("Optimized3x3"); // Create and configure function std::unique_ptr<arm_compute::IFunction> func; - bool run_3x3_opt = opt3x3 && weights->info()->dimension(0) == 3; - if(run_3x3_opt) - { - auto depwthwise_conv = arm_compute::support::cpp14::make_unique<arm_compute::NEDepthwiseConvolutionLayer>(); - depwthwise_conv->configure(in, weights, biases, out, conv_info); - func = std::move(depwthwise_conv); - } - else - { - auto depwthwise_conv = arm_compute::support::cpp14::make_unique<arm_compute::NEDepthwiseConvolutionLayer3x3>(); - depwthwise_conv->configure(in, weights, biases, out, conv_info); - func = std::move(depwthwise_conv); - } + // TODO (COMPMID-769): Add support for asymmetric padding in NEDepthwiseConvolutionLayer3x3 to enable opt3x3 support + auto depwthwise_conv = arm_compute::support::cpp14::make_unique<arm_compute::NEDepthwiseConvolutionLayer>(); + depwthwise_conv->configure(in, weights, biases, out, conv_info); + func = std::move(depwthwise_conv); // Log info ARM_COMPUTE_LOG_GRAPH_INFO("Instantiating NEDepthwiseConvolutionLayer" |