@@ -91,9 +91,9 @@ void simple_net(engine::kind engine_kind, int times = 100) {
91
91
std::vector<float > conv1_bias (product (conv1_bias_tz));
92
92
// [Allocate buffers]
93
93
94
- // / Create memory that describes data layout in the buffers. This example uses
95
- // / tag:: nchw (batch-channels-height-width) for input data and tag::oihw
96
- // / for weights.
94
+ // / Create memory that describes data layout in the buffers. This example
95
+ // / uses dnnl::memory::format_tag:: nchw (batch-channels-height-width)
96
+ // / for input data and dnnl::memory::format_tag::oihw for weights.
97
97
// / @snippet cnn_inference_f32.cpp Create user memory
98
98
// [Create user memory]
99
99
auto user_src_memory = memory ({{conv1_src_tz}, dt::f32, tag::nchw}, eng);
@@ -106,12 +106,13 @@ void simple_net(engine::kind engine_kind, int times = 100) {
106
106
write_to_dnnl_memory (conv1_bias.data (), conv1_user_bias_memory);
107
107
// [Create user memory]
108
108
109
- // / Create memory descriptors with layout tag::any. The `any` format enables
110
- // / the convolution primitive to choose the data format that will result in
111
- // / best performance based on its input parameters (convolution kernel
112
- // / sizes, strides, padding, and so on). If the resulting format is different
113
- // / from `nchw`, the user data must be transformed to the format required for
114
- // / the convolution (as explained below).
109
+ // / Create memory descriptors with layout dnnl::memory::format_tag::any.
110
+ // / The `any` format enables the convolution primitive to choose the data
111
+ // / format that will result in best performance based on its input
112
+ // / parameters (convolution kernel sizes, strides, padding, and so on).
113
+ // / If the resulting format is different from `nchw`, the user data must be
114
+ // / transformed to the format required for the convolution (as explained
115
+ // / below).
115
116
// / @snippet cnn_inference_f32.cpp Create convolution memory descriptors
116
117
// [Create convolution memory descriptors]
117
118
auto conv1_src_md = memory::desc ({conv1_src_tz}, dt::f32, tag::any);
@@ -136,9 +137,9 @@ void simple_net(engine::kind engine_kind, int times = 100) {
136
137
conv1_strides, conv1_padding, conv1_padding);
137
138
// [Create convolution primitive descriptor]
138
139
139
- // / Check whether data and weights formats required by convolution is different
140
- // / from the user format. In case it is different change the layout using
141
- // / reorder primitive.
140
+ // / Check whether data and weights formats required by convolution is
141
+ // / different from the user format. In case it is different change the
142
+ // / layout using reorder primitive.
142
143
// / @snippet cnn_inference_f32.cpp Reorder data and weights
143
144
// [Reorder data and weights]
144
145
auto conv1_src_memory = user_src_memory;
@@ -180,7 +181,8 @@ void simple_net(engine::kind engine_kind, int times = 100) {
180
181
// / Create the relu primitive. For better performance, keep the input data
181
182
// / format for ReLU (as well as for other operation primitives until another
182
183
// / convolution or inner product is encountered) the same as the one chosen
183
- // / for convolution. Also note that ReLU is done in-place by using conv1 memory.
184
+ // / for convolution. Also note that ReLU is done in-place by using conv1
185
+ // / memory.
184
186
// / @snippet cnn_inference_f32.cpp Create relu primitive
185
187
// [Create relu primitive]
186
188
auto relu1_prim_desc
@@ -227,8 +229,8 @@ void simple_net(engine::kind engine_kind, int times = 100) {
227
229
auto pool1_dst_md = memory::desc ({pool1_dst_tz}, dt::f32, tag::any);
228
230
229
231
// / For training execution, pooling requires a private workspace memory
230
- // / to perform the backward pass. However, pooling should not use 'workspace'
231
- // / for inference, because this is detrimental to performance.
232
+ // / to perform the backward pass. However, pooling should not use
233
+ // / 'workspace' for inference, because this is detrimental to performance.
232
234
// / @snippet cnn_inference_f32.cpp Create pooling primitive
233
235
// /
234
236
// / The example continues to create more layers according
0 commit comments