#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>
Go to the source code of this file.
|
| 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 ("NEDirectConvolutionLayer_NCHW", [](nonius::chronometer meter) { NEDirectConvolutionLayer conv;Configuration p{meter};Tensor src_tensor{};Tensor dst_tensor{};Tensor ker_tensor{};Tensor bias_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 >());bias_tensor.allocator() ->init(p.bias_info());try { check(conv.validate(src_tensor.info(), ker_tensor.info(), bias_tensor.info(), dst_tensor.info(), p.pad_stride_info()));} catch(...) { meter.measure([&](int) { volatile int x=0;return x;});return;} conv.configure(&src_tensor, &ker_tensor, &bias_tensor, &dst_tensor, p.pad_stride_info());src_tensor.allocator() ->allocate();ker_tensor.allocator() ->allocate();bias_tensor.allocator() ->allocate();dst_tensor.allocator() ->allocate();meter.measure([&](int) { conv.run();});}) NONIUS_LOCAL_BENCHMARK("NEDirectConvolutionLayer_NHWC" |
|
src_tensor | allocator () -> init(p.src_info< NHWC >()) |
|
| catch (...) |
|
meter | measure ([&](int) { conv.run();}) |
|
| NONIUS_LOCAL_BENCHMARK ("NEGEMMConvolutionLayer_NCHW", [](nonius::chronometer meter) { NEGEMMConvolutionLayer conv;Configuration p{meter};Tensor src_tensor{};Tensor dst_tensor{};Tensor ker_tensor{};Tensor bias_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 >());bias_tensor.allocator() ->init(p.bias_info());try { check(conv.validate(src_tensor.info(), ker_tensor.info(), bias_tensor.info(), dst_tensor.info(), p.pad_stride_info()));} catch(...) { meter.measure([&](int) { volatile int x=0;return x;});return;} conv.configure(&src_tensor, &ker_tensor, &bias_tensor, &dst_tensor, p.pad_stride_info());src_tensor.allocator() ->allocate();ker_tensor.allocator() ->allocate();bias_tensor.allocator() ->allocate();dst_tensor.allocator() ->allocate();meter.measure([&](int) { conv.run();});}) NONIUS_LOCAL_BENCHMARK("NEGEMMConvolutionLayer_NHWC" |
|
| NONIUS_LOCAL_BENCHMARK ("NEWinogradConvolutionLayer_NCHW", [](nonius::chronometer meter) { NEWinogradConvolutionLayer conv;Configuration p{meter};Tensor src_tensor{};Tensor dst_tensor{};Tensor ker_tensor{};Tensor bias_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 >());bias_tensor.allocator() ->init(p.bias_info());try { check(conv.validate(src_tensor.info(), ker_tensor.info(), bias_tensor.info(), dst_tensor.info(), p.pad_stride_info()));} catch(...) { meter.measure([&](int) { volatile int x=0;return x;});return;} conv.configure(&src_tensor, &ker_tensor, &bias_tensor, &dst_tensor, p.pad_stride_info());src_tensor.allocator() ->allocate();ker_tensor.allocator() ->allocate();bias_tensor.allocator() ->allocate();dst_tensor.allocator() ->allocate();meter.measure([&](int) { conv.run();});}) NONIUS_LOCAL_BENCHMARK("NEWinogradConvolutionLayer_NHWC" |
|
nonius::benchmark_registry & | benchmark_functions (void) |
|
◆ 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 226 of file Convolution.cpp.
228 { \
229 static ::nonius::benchmark_registrar \
230 NONIUS_DETAIL_UNIQUE_NAME(benchmark_registrar)(local_benchmark_registry(), name, __VA_ARGS__); \
231 }
◆ allocator()
src_tensor allocator |
( |
| ) |
-> init(p.src_info< NHWC >()) |
◆ benchmark_functions()
nonius::benchmark_registry & benchmark_functions |
( |
void |
| ) |
|
Definition at line 485 of file Convolution.cpp.
486{
487 return local_benchmark_registry();
488}
◆ catch()
Definition at line 296 of file Convolution.cpp.
297 {
298 meter.measure([&](
int) {
299
300 volatile int x = 0;
301 return x;
302 });
303 return;
304 }
References meter.
◆ measure()
◆ NONIUS_LOCAL_BENCHMARK() [1/3]
◆ NONIUS_LOCAL_BENCHMARK() [2/3]
◆ NONIUS_LOCAL_BENCHMARK() [3/3]
◆ NONIUS_PARAM() [1/11]
NONIUS_PARAM |
( |
BATCH |
, |
|
|
1 |
|
|
) |
| |
◆ NONIUS_PARAM() [2/11]
NONIUS_PARAM |
( |
IFM_C |
, |
|
|
3 |
|
|
) |
| |
◆ 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 |
, |
|
|
3 |
|
|
) |
| |
◆ NONIUS_PARAM() [6/11]
NONIUS_PARAM |
( |
KER_W |
, |
|
|
3 |
|
|
) |
| |
◆ NONIUS_PARAM() [7/11]
NONIUS_PARAM |
( |
OFM_C |
, |
|
|
3 |
|
|
) |
| |
◆ 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 |
, |
|
|
1 |
|
|
) |
| |
◆ NONIUS_PARAM() [11/11]
NONIUS_PARAM |
( |
STRIDE_W |
, |
|
|
1 |
|
|
) |
| |
◆ bias_tensor
◆ dst_tensor
◆ ker_tensor
◆ meter
nonius::chronometer meter |
◆ src_tensor
◆ try