Caffe2 - C++ API
A deep learning, cross platform ML framework
Related Pages
Modules
Data Structures
Files
C++ API
Python API
GitHub
File List
Globals
caffe2
mkl
mkl_utils.h
1
#ifndef CAFFE2_UTILS_MKL_UTILS_H_
2
#define CAFFE2_UTILS_MKL_UTILS_H_
3
4
#include "caffe2/core/macros.h"
// For caffe2 macros.
5
6
#ifdef CAFFE2_USE_MKL
7
8
#include "caffe2/mkl/utils/mkl_version_check.h"
9
10
// MKLDNN_CHECK should be used in places where exceptions should not be thrown,
11
// such as in destructors.
12
#define MKLDNN_CHECK(condition) \
13
do { \
14
dnnError_t error = condition; \
15
CAFFE_ENFORCE_EQ( \
16
error, \
17
E_SUCCESS, \
18
"Error at : ", \
19
__FILE__, \
20
":", \
21
__LINE__, \
22
", error number: ", \
23
error); \
24
} while (0)
25
26
#define MKLDNN_SAFE_CALL(condition) \
27
do { \
28
dnnError_t error = condition; \
29
CAFFE_ENFORCE_EQ( \
30
error, \
31
E_SUCCESS, \
32
"Error at : ", \
33
__FILE__, \
34
":", \
35
__LINE__, \
36
", error number: ", \
37
error); \
38
} while (0)
39
40
#define CHECK_INPUT_FILTER_DIMS(X, filter, condition) \
41
do { \
42
if (cached_input_dims_ != X.dims() || \
43
cached_filter_dims_ != filter.dims()) { \
44
cached_input_dims_ = X.dims(); \
45
cached_filter_dims_ = filter.dims(); \
46
condition = true; \
47
} else { \
48
condition = false; \
49
} \
50
} while (0)
51
52
#define CHECK_INPUT_DIMS(X, condition) \
53
do { \
54
if (cached_input_dims_ != X.dims()) { \
55
cached_input_dims_ = X.dims(); \
56
condition = true; \
57
} else { \
58
condition = false; \
59
} \
60
} while (0)
61
62
// All caffe2 mkl related headers
63
64
#ifdef CAFFE2_HAS_MKL_DNN
65
#include "caffe2/mkl/utils/mkl_context.h"
66
#include "caffe2/mkl/utils/mkl_dnn_cppwrapper.h"
67
#include "caffe2/mkl/utils/mkl_memory.h"
68
#include "caffe2/mkl/utils/mkl_operator.h"
69
#endif // CAFFE2_HAS_MKL_DNN
70
71
#ifdef CAFFE2_HAS_MKL_SGEMM_PACK
72
#include "caffe2/mkl/utils/sgemm_pack.h"
73
#endif // CAFFE2_HAS_MKL_SGEMM_PACK
74
75
#endif // CAFFE2_USE_MKL
76
#endif // CAFFE2_UTILS_MKL_UTILS_H_
Generated on Thu Apr 19 2018 13:03:50 for Caffe2 - C++ API by
1.8.11