diff options
author | 윤지영/On-Device Lab(SR)/Staff Engineer/삼성전자 <jy910.yun@samsung.com> | 2019-03-29 13:21:56 +0900 |
---|---|---|
committer | 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com> | 2019-03-29 13:21:56 +0900 |
commit | 042510f77f5c066aa7ab97b8d93649b50c2c5626 (patch) | |
tree | 84d49ae51d5cc6b7edb5119358d5b0d422db8357 /runtimes | |
parent | c399cef4edb9619eb971cd271de93f5946939f80 (diff) | |
download | nnfw-042510f77f5c066aa7ab97b8d93649b50c2c5626.tar.gz nnfw-042510f77f5c066aa7ab97b8d93649b50c2c5626.tar.bz2 nnfw-042510f77f5c066aa7ab97b8d93649b50c2c5626.zip |
Revert "[PACL] Apply DepthwiseConvolutionLayer3x3 to DepthwiseConv operation (#4354)" (#4840)
This reverts commit 34f49de36ae41f10735fd570e006981671e13a68.
The same changes were merged in acl v19.02.
Related PR : https://review.mlplatform.org/#/c/ml/ComputeLibrary/+/511/
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
Diffstat (limited to 'runtimes')
-rw-r--r-- | runtimes/pure_arm_compute/src/compilation.cc | 74 | ||||
-rw-r--r-- | runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc | 14 | ||||
-rw-r--r-- | runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h | 18 |
3 files changed, 22 insertions, 84 deletions
diff --git a/runtimes/pure_arm_compute/src/compilation.cc b/runtimes/pure_arm_compute/src/compilation.cc index dcf7a30ea..d028e01dc 100644 --- a/runtimes/pure_arm_compute/src/compilation.cc +++ b/runtimes/pure_arm_compute/src/compilation.cc @@ -1324,35 +1324,20 @@ void Planner::visit(const ::internal::tflite::op::DepthwiseConv2D::Implicit::Nod if (::internal::arm_compute::isGpuMode()) { - if (getHeight(ker_alloc) == 3 && getWidth(ker_alloc) == 3) - { - auto fn = nnfw::cpp14::make_unique<::arm_compute::CLDepthwiseConvolutionLayer3x3>(); - fn->configure(CAST_CL(ifm_alloc), CAST_CL(ker_alloc), CAST_CL(bias_alloc), - CAST_CL(ofm_alloc), conv_info, param.multipler); - builder.append("DepthwiseConv2D", std::move(fn)); - } - else - { - auto fn = nnfw::cpp14::make_unique<::arm_compute::CLDepthwiseConvolutionLayer>(); - fn->configure(CAST_CL(ifm_alloc), CAST_CL(ker_alloc), CAST_CL(bias_alloc), - CAST_CL(ofm_alloc), conv_info, param.multipler); - builder.append("DepthwiseConv2D", std::move(fn)); - } + auto fn = nnfw::cpp14::make_unique<::arm_compute::CLDepthwiseConvolutionLayer>(); + + fn->configure(CAST_CL(ifm_alloc), CAST_CL(ker_alloc), CAST_CL(bias_alloc), CAST_CL(ofm_alloc), + conv_info, param.multipler); + + builder.append("DepthwiseConv2D", std::move(fn)); } else { - if (getHeight(ker_alloc) == 3 && getWidth(ker_alloc) == 3) - { - auto fn = nnfw::cpp14::make_unique<::arm_compute::NEDepthwiseConvolutionLayer3x3>(); - fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler); - builder.append("DepthwiseConv2D", std::move(fn)); - } - else - { - auto fn = nnfw::cpp14::make_unique<::arm_compute::NEDepthwiseConvolutionLayer>(); - fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler); - builder.append("DepthwiseConv2D", std::move(fn)); - } + auto fn = nnfw::cpp14::make_unique<::arm_compute::NEDepthwiseConvolutionLayer>(); + + fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler); + + builder.append("DepthwiseConv2D", std::move(fn)); } ActivationBuilder{builder}.append(param.activation, ofm_alloc); @@ -1482,35 +1467,20 @@ void Planner::visit(const ::internal::tflite::op::DepthwiseConv2D::Explicit::Nod if (::internal::arm_compute::isGpuMode()) { - if (getHeight(ker_alloc) == 3 && getWidth(ker_alloc) == 3) - { - auto fn = nnfw::cpp14::make_unique<::arm_compute::CLDepthwiseConvolutionLayer3x3>(); - fn->configure(CAST_CL(ifm_alloc), CAST_CL(ker_alloc), CAST_CL(bias_alloc), - CAST_CL(ofm_alloc), conv_info, param.multipler); - builder.append("DepthwiseConv2D", std::move(fn)); - } - else - { - auto fn = nnfw::cpp14::make_unique<::arm_compute::CLDepthwiseConvolutionLayer>(); - fn->configure(CAST_CL(ifm_alloc), CAST_CL(ker_alloc), CAST_CL(bias_alloc), - CAST_CL(ofm_alloc), conv_info, param.multipler); - builder.append("DepthwiseConv2D", std::move(fn)); - } + auto fn = nnfw::cpp14::make_unique<::arm_compute::CLDepthwiseConvolutionLayer>(); + + fn->configure(CAST_CL(ifm_alloc), CAST_CL(ker_alloc), CAST_CL(bias_alloc), CAST_CL(ofm_alloc), + conv_info, param.multipler); + + builder.append("DepthwiseConv2D", std::move(fn)); } else { - if (getHeight(ker_alloc) == 3 && getWidth(ker_alloc) == 3) - { - auto fn = nnfw::cpp14::make_unique<::arm_compute::NEDepthwiseConvolutionLayer3x3>(); - fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler); - builder.append("DepthwiseConv2D", std::move(fn)); - } - else - { - auto fn = nnfw::cpp14::make_unique<::arm_compute::NEDepthwiseConvolutionLayer>(); - fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler); - builder.append("DepthwiseConv2D", std::move(fn)); - } + auto fn = nnfw::cpp14::make_unique<::arm_compute::NEDepthwiseConvolutionLayer>(); + + fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler); + + builder.append("DepthwiseConv2D", std::move(fn)); } ActivationBuilder{builder}.append(param.activation, ofm_alloc); diff --git a/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc b/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc index eabae097f..1a5c735ee 100644 --- a/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc +++ b/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.cc @@ -150,17 +150,3 @@ { return ::arm_compute::TensorInfo(shape, 1, type, asQuantizationInfo(scale, zeroPoint)); } - -size_t getHeight(const ::arm_compute::ITensor *tensor) -{ - assert(tensor != nullptr); - return tensor->info()->dimension(::arm_compute::get_data_layout_dimension_index( - tensor->info()->data_layout(), ::arm_compute::DataLayoutDimension::HEIGHT)); -} - -size_t getWidth(const ::arm_compute::ITensor *tensor) -{ - assert(tensor != nullptr); - return tensor->info()->dimension(::arm_compute::get_data_layout_dimension_index( - tensor->info()->data_layout(), ::arm_compute::DataLayoutDimension::WIDTH)); -} diff --git a/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h b/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h index c8d94e8c3..211a6ac87 100644 --- a/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h +++ b/runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h @@ -153,22 +153,4 @@ void copyCast(const FromT value, ::arm_compute::ITensor *to, const ::arm_compute } } -/** - * @brief Get the value of the height dimension for a given tensor - * @param[in] tensor Target tensor of arm compute - * @return The height value - */ -// TODO It seems that this helper function is not for casting, but we couldn't find proper source -// location. -size_t getHeight(const ::arm_compute::ITensor *tensor); - -/** - * @brief Get the value of the width dimension for a given tensor - * @param[in] tensor Target tensor of arm compute - * @return The width value - */ -// TODO It seems that this helper function is not for casting, but we couldn't find proper source -// location. -size_t getWidth(const ::arm_compute::ITensor *tensor); - #endif // __ARM_COMPUTE_CAST_H__ |