-
Notifications
You must be signed in to change notification settings - Fork 115
/
dl_layer_base.hpp
56 lines (50 loc) · 1.15 KB
/
dl_layer_base.hpp
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
56
#pragma once
#include "dl_tool.hpp"
#include "dl_tool_cache.hpp"
#include <iostream>
namespace dl
{
namespace layer
{
/**
* @brief Base class for layer.
*
*/
class Layer
{
public:
char *name; /*<! name of layer >*/
/**
* @brief Construct a new Layer object.
*
* @param name name of layer.
*/
Layer(const char *name = NULL);
/**
* @brief Destroy the Layer object. Return resource.
*
*/
~Layer();
};
} // namespace layer
} // namespace dl
#if DL_LOG_LAYER_LATENCY
/**
* @brief Initialize.
*/
#define DL_LOG_LAYER_LATENCY_INIT() dl::tool::Latency latency
/**
* @brief Time starts.
*/
#define DL_LOG_LAYER_LATENCY_START() latency.start()
/**
* @brief Time ends and printed.
*/
#define DL_LOG_LAYER_LATENCY_END(prefix, key) \
latency.end(); \
latency.print(prefix, key)
#else
#define DL_LOG_LAYER_LATENCY_INIT()
#define DL_LOG_LAYER_LATENCY_START()
#define DL_LOG_LAYER_LATENCY_END(prefix, key)
#endif