ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TransposeConv.cpp File Reference
#include <nonius/nonius.h++>
#include <arm_compute/core/Types.h>
#include <arm_compute/runtime/NEON/NEScheduler.h>
#include <arm_compute/runtime/NEON/NEFunctions.h>
#include <cstdint>
#include <cassert>
#include <stdexcept>
#include "acl_common/Utils.h"

Go to the source code of this file.

Macros

#define NONIUS_LOCAL_BENCHMARK(name, ...)
 

Functions

 NONIUS_PARAM (BATCH, 1)
 
 NONIUS_PARAM (IFM_C, 3)
 
 NONIUS_PARAM (IFM_H, 244)
 
 NONIUS_PARAM (IFM_W, 244)
 
 NONIUS_PARAM (OFM_C, 3)
 
 NONIUS_PARAM (OFM_H, 244)
 
 NONIUS_PARAM (OFM_W, 244)
 
 NONIUS_PARAM (KER_H, 3)
 
 NONIUS_PARAM (KER_W, 3)
 
 NONIUS_PARAM (STRIDE_H, 1)
 
 NONIUS_PARAM (STRIDE_W, 1)
 
 NONIUS_LOCAL_BENCHMARK ("NEDeconvolutionLayer_NCHW", [](nonius::chronometer meter) { NEDeconvolutionLayer deconv;Configuration p{meter};Tensor src_tensor{};Tensor dst_tensor{};Tensor ker_tensor{};src_tensor.allocator() ->init(p.src_info< NCHW >());dst_tensor.allocator() ->init(p.dst_info< NCHW >());ker_tensor.allocator() ->init(p.ker_info< NCHW >());try { check(deconv.validate(src_tensor.info(), ker_tensor.info(), nullptr, dst_tensor.info(), p.deconv_info, p.inner_border_right, p.inner_border_top));} catch(...) { meter.measure([&](int) { volatile int x=0;return x;});return;} deconv.configure(&src_tensor, &ker_tensor, nullptr, &dst_tensor, p.deconv_info, p.inner_border_right, p.inner_border_top);src_tensor.allocator() ->allocate();ker_tensor.allocator() ->allocate();dst_tensor.allocator() ->allocate();meter.measure([&](int) { deconv.run();});}) NONIUS_LOCAL_BENCHMARK("NEDeconvolutionLayer_NHWC"
 
src_tensor allocator () -> init(p.src_info< NHWC >())
 
 catch (...)
 
meter measure ([&](int) { deconv.run();})
 
nonius::benchmark_registry & benchmark_functions (void)
 

Variables

nonius::chronometer meter
 
Configuration p {meter}
 
Tensor src_tensor {}
 
Tensor dst_tensor {}
 
Tensor ker_tensor {}
 
 try
 

Macro Definition Documentation

◆ NONIUS_LOCAL_BENCHMARK

#define NONIUS_LOCAL_BENCHMARK (   name,
  ... 
)
Value:
namespace \
{ \
static ::nonius::benchmark_registrar \
NONIUS_DETAIL_UNIQUE_NAME(benchmark_registrar)(local_benchmark_registry(), name, __VA_ARGS__); \
}

Definition at line 202 of file TransposeConv.cpp.

204 { \
205 static ::nonius::benchmark_registrar \
206 NONIUS_DETAIL_UNIQUE_NAME(benchmark_registrar)(local_benchmark_registry(), name, __VA_ARGS__); \
207 }

Function Documentation

◆ allocator()

src_tensor allocator ( ) -> init(p.src_info< NHWC >())

◆ benchmark_functions()

nonius::benchmark_registry & benchmark_functions ( void  )

Definition at line 289 of file TransposeConv.cpp.

290{
291 return local_benchmark_registry();
292}

◆ catch()

catch (   ...)

Definition at line 268 of file TransposeConv.cpp.

269 {
270 meter.measure([&](int) {
271 // DO NOTHING
272 volatile int x = 0;
273 return x;
274 });
275 return;
276 }
nonius::chronometer meter

References meter.

◆ measure()

meter measure ( [&] (int) { deconv.run();}  )

◆ NONIUS_LOCAL_BENCHMARK()

NONIUS_LOCAL_BENCHMARK ( "NEDeconvolutionLayer_NCHW"  ,
[] (nonius::chronometer meter) { NEDeconvolutionLayer deconv;Configuration p{meter};Tensor src_tensor{};Tensor dst_tensor{};Tensor ker_tensor{};src_tensor.allocator() ->init(p.src_info< NCHW >());dst_tensor.allocator() ->init(p.dst_info< NCHW >());ker_tensor.allocator() ->init(p.ker_info< NCHW >());try { check(deconv.validate(src_tensor.info(), ker_tensor.info(), nullptr, dst_tensor.info(), p.deconv_info, p.inner_border_right, p.inner_border_top));} catch(...) { meter.measure([&](int) { volatile int x=0;return x;});return;} deconv.configure(&src_tensor, &ker_tensor, nullptr, &dst_tensor, p.deconv_info, p.inner_border_right, p.inner_border_top);src_tensor.allocator() ->allocate();ker_tensor.allocator() ->allocate();dst_tensor.allocator() ->allocate();meter.measure([&](int) { deconv.run();});}   
)

References dst_tensor, ker_tensor, meter, p, and src_tensor.

◆ NONIUS_PARAM() [1/11]

NONIUS_PARAM ( BATCH  ,
 
)

◆ NONIUS_PARAM() [2/11]

NONIUS_PARAM ( IFM_C  ,
 
)

◆ NONIUS_PARAM() [3/11]

NONIUS_PARAM ( IFM_H  ,
244   
)

◆ NONIUS_PARAM() [4/11]

NONIUS_PARAM ( IFM_W  ,
244   
)

◆ NONIUS_PARAM() [5/11]

NONIUS_PARAM ( KER_H  ,
 
)

◆ NONIUS_PARAM() [6/11]

NONIUS_PARAM ( KER_W  ,
 
)

◆ NONIUS_PARAM() [7/11]

NONIUS_PARAM ( OFM_C  ,
 
)

◆ NONIUS_PARAM() [8/11]

NONIUS_PARAM ( OFM_H  ,
244   
)

◆ NONIUS_PARAM() [9/11]

NONIUS_PARAM ( OFM_W  ,
244   
)

◆ NONIUS_PARAM() [10/11]

NONIUS_PARAM ( STRIDE_H  ,
 
)

◆ NONIUS_PARAM() [11/11]

NONIUS_PARAM ( STRIDE_W  ,
 
)

Variable Documentation

◆ dst_tensor

Tensor dst_tensor {}

Definition at line 256 of file TransposeConv.cpp.

256{};

Referenced by NONIUS_LOCAL_BENCHMARK().

◆ ker_tensor

Tensor ker_tensor {}

Definition at line 257 of file TransposeConv.cpp.

257{};

Referenced by NONIUS_LOCAL_BENCHMARK().

◆ meter

nonius::chronometer meter
Initial value:
{
NEDeconvolutionLayer deconv

Definition at line 249 of file TransposeConv.cpp.

Referenced by catch(), and NONIUS_LOCAL_BENCHMARK().

◆ p

Configuration p {meter}

Definition at line 253 of file TransposeConv.cpp.

253{meter};

Referenced by NONIUS_LOCAL_BENCHMARK().

◆ src_tensor

deconv configure& src_tensor {}

Definition at line 255 of file TransposeConv.cpp.

255{};

Referenced by NONIUS_LOCAL_BENCHMARK().

◆ try

try
Initial value:
{
check(deconv.validate(src_tensor.info(), ker_tensor.info(), nullptr, dst_tensor.info(),
p.deconv_info, p.inner_border_right, p.inner_border_top))
Tensor ker_tensor
Tensor src_tensor
Configuration p
Tensor dst_tensor

Definition at line 263 of file TransposeConv.cpp.