File size: 1,697 Bytes
8b7c501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// Copyright 2019 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.

#pragma once

#include <benchmark/benchmark.h>


#define BENCHMARK_DCONV(conv_fn) \
  BENCHMARK_CAPTURE(conv_fn, mobilenet_v1, "MobileNet v1/v2")->Apply(MobileNetConvArguments)->UseRealTime(); \
  BENCHMARK_CAPTURE(conv_fn, mobilenet_v3, "MobileNet v3")->Apply(MobileNetV3ConvArguments)->UseRealTime(); \
  BENCHMARK_CAPTURE(conv_fn, shufflenet, "ShuffleNet v1/v2")->Apply(ShuffleNetConvArguments)->UseRealTime(); \
  BENCHMARK_CAPTURE(conv_fn, squeezenet_v11, "SqueezeNet 1.1")->Apply(SqueezeNetV11ConvArguments)->UseRealTime();


// ShuffleNet v1/v2.
static void ShuffleNetConvArguments(benchmark::internal::Benchmark* b) {
  b->ArgNames({"H", "W", "Cout"});

  /********* Conv 1 ********/
  /*        H    W   GCout */
  b->Args({224, 224,   24});
}

// MobileNet v1/v2.
static void MobileNetConvArguments(benchmark::internal::Benchmark* b) {
  b->ArgNames({"H", "W", "Cout"});

  /*        H    W   GCout */
  b->Args({224, 224,   32});
}

// MobileNet v3 Small/Large.
static void MobileNetV3ConvArguments(benchmark::internal::Benchmark* b) {
  b->ArgNames({"H", "W", "Cout"});

  /******************* Initial Stage *******************/
  /*        H    W   GCout */
  b->Args({224, 224,   16});
}

// SqueezeNet 1.1
static void SqueezeNetV11ConvArguments(benchmark::internal::Benchmark* b) {
  b->ArgNames({"H", "W", "GCout"});

  /*********************** Conv 1 **********************/
  /*        H    W   GCout */
  b->Args({224, 224,   64});
}