#include <arm_compute/runtime/CL/functions/CLArgMinMax.h>
#include <arm_compute/runtime/CL/functions/CLCast.h>
#include <arm_compute/runtime/CL/functions/CLConvolutionLayer.h>
+#include <arm_compute/runtime/CL/functions/CLDeconvolutionLayerEx.h>
#include <arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h>
#include <arm_compute/runtime/CL/functions/CLDequantizationLayer.h>
#include <arm_compute/runtime/CL/functions/CLDepthToSpace.h>
auto ifm_alloc = ctx.at(::internal::tflite::operand::Index{param.ifm_index});
auto ker_alloc = ctx.at(::internal::tflite::operand::Index{param.ker_index});
- auto fn = nnfw::cpp14::make_unique<SimpleTransposeConv>();
-
// Only rank 4 is supported
const int rank = 4;
- auto tconv_info = asPadStrideInfo(param.padding, param.stride);
+ if (from_env<bool>(std::getenv("USE_SIMPLE_TRANSPOSECONV")))
+ {
+ auto fn = nnfw::cpp14::make_unique<SimpleTransposeConv>();
+
+ auto tconv_info = asPadStrideInfo(param.padding, param.stride);
+ fn->configure(ifm_alloc, ker_alloc, ofm_alloc, tconv_info, getARMComputeAxises(rank));
+
+ builder.append("TransposeConv", std::move(fn));
+ }
+ else if (::internal::arm_compute::isGpuMode())
+ {
+ auto fn = nnfw::cpp14::make_unique<::arm_compute::CLDeconvolutionLayerEx>();
- fn->configure(ifm_alloc, ker_alloc, ofm_alloc, tconv_info, getARMComputeAxises(rank));
+ auto padding = param.padding;
+ auto inner_border_right = padding.right - padding.left;
+ auto inner_border_top = padding.bottom - padding.top;
- builder.append("TransposeConv", std::move(fn));
+ padding.left = padding.right;
+ padding.top = padding.bottom;
+ auto symmetric_tconv_info = asPadStrideInfo(padding, param.stride);
+
+ // TODO Support WeightInfo in some cases in order to performance improvement
+ fn->configure(CAST_CL(ifm_alloc), CAST_CL(ker_alloc), nullptr, CAST_CL(ofm_alloc),
+ symmetric_tconv_info, inner_border_right, inner_border_top);
+ builder.append("TransposeConv", std::move(fn));
+ }
+ else
+ {
+ throw std::runtime_error("Not supported, yet");
+ }
};
_builder.addStage(stage);
}