Caffe2 - C++ API
A deep learning, cross platform ML framework
mkl_dnn_cppwrapper.h
1 
17 // Do not directl include this file. Include caffe2/mkl/mkl_utils.h instead.
18 #ifndef CAFFE2_UTILS_MKL_MKL_DNN_CPPWRAPPER_H
19 #define CAFFE2_UTILS_MKL_MKL_DNN_CPPWRAPPER_H
20 
21 #include <stdarg.h>
22 #include <stddef.h>
23 
24 #include <mkl.h>
25 
26 #define C2_MKL_TEMPLATE_PREFIX \
27  template <typename T> \
28  inline
29 #define C2_MKL_SPEC_PREFIX \
30  template <> \
31  inline
32 
33 namespace caffe2 {
34 namespace mkl {
35 
36 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnLayoutCreate(
37  dnnLayout_t* pLayout,
38  size_t dimension,
39  const size_t size[],
40  const size_t strides[]);
41 C2_MKL_SPEC_PREFIX dnnError_t dnnLayoutCreate<float>(
42  dnnLayout_t* pLayout,
43  size_t dimension,
44  const size_t size[],
45  const size_t strides[]) {
46  return dnnLayoutCreate_F32(pLayout, dimension, size, strides);
47 }
48 C2_MKL_SPEC_PREFIX dnnError_t dnnLayoutCreate<double>(
49  dnnLayout_t* pLayout,
50  size_t dimension,
51  const size_t size[],
52  const size_t strides[]) {
53  return dnnLayoutCreate_F64(pLayout, dimension, size, strides);
54 }
55 
56 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnLayoutCreateFromPrimitive(
57  dnnLayout_t* pLayout,
58  const dnnPrimitive_t primitive,
59  dnnResourceType_t type);
60 C2_MKL_SPEC_PREFIX dnnError_t dnnLayoutCreateFromPrimitive<float>(
61  dnnLayout_t* pLayout,
62  const dnnPrimitive_t primitive,
63  dnnResourceType_t type) {
64  return dnnLayoutCreateFromPrimitive_F32(pLayout, primitive, type);
65 }
66 C2_MKL_SPEC_PREFIX dnnError_t dnnLayoutCreateFromPrimitive<double>(
67  dnnLayout_t* pLayout,
68  const dnnPrimitive_t primitive,
69  dnnResourceType_t type) {
70  return dnnLayoutCreateFromPrimitive_F64(pLayout, primitive, type);
71 }
72 
73 C2_MKL_TEMPLATE_PREFIX size_t dnnLayoutGetMemorySize(const dnnLayout_t layout);
74 C2_MKL_SPEC_PREFIX size_t
75 dnnLayoutGetMemorySize<float>(const dnnLayout_t layout) {
76  return dnnLayoutGetMemorySize_F32(layout);
77 }
78 C2_MKL_SPEC_PREFIX size_t
79 dnnLayoutGetMemorySize<double>(const dnnLayout_t layout) {
80  return dnnLayoutGetMemorySize_F64(layout);
81 }
82 
83 C2_MKL_TEMPLATE_PREFIX int dnnLayoutCompare(
84  const dnnLayout_t l1,
85  const dnnLayout_t l2);
86 C2_MKL_SPEC_PREFIX int dnnLayoutCompare<float>(
87  const dnnLayout_t l1,
88  const dnnLayout_t l2) {
89  return dnnLayoutCompare_F32(l1, l2);
90 }
91 C2_MKL_SPEC_PREFIX int dnnLayoutCompare<double>(
92  const dnnLayout_t l1,
93  const dnnLayout_t l2) {
94  return dnnLayoutCompare_F64(l1, l2);
95 }
96 
97 C2_MKL_TEMPLATE_PREFIX dnnError_t
98 dnnAllocateBuffer(void** pPtr, dnnLayout_t layout);
99 C2_MKL_SPEC_PREFIX dnnError_t
100 dnnAllocateBuffer<float>(void** pPtr, dnnLayout_t layout) {
101  return dnnAllocateBuffer_F32(pPtr, layout);
102 }
103 C2_MKL_SPEC_PREFIX dnnError_t
104 dnnAllocateBuffer<double>(void** pPtr, dnnLayout_t layout) {
105  return dnnAllocateBuffer_F64(pPtr, layout);
106 }
107 
108 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnReleaseBuffer(void* ptr);
109 C2_MKL_SPEC_PREFIX dnnError_t dnnReleaseBuffer<float>(void* ptr) {
110  return dnnReleaseBuffer_F32(ptr);
111 }
112 C2_MKL_SPEC_PREFIX dnnError_t dnnReleaseBuffer<double>(void* ptr) {
113  return dnnReleaseBuffer_F64(ptr);
114 }
115 
116 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnLayoutDelete(dnnLayout_t layout);
117 C2_MKL_SPEC_PREFIX dnnError_t dnnLayoutDelete<float>(dnnLayout_t layout) {
118  return dnnLayoutDelete_F32(layout);
119 }
120 C2_MKL_SPEC_PREFIX dnnError_t dnnLayoutDelete<double>(dnnLayout_t layout) {
121  return dnnLayoutDelete_F64(layout);
122 }
123 
124 C2_MKL_TEMPLATE_PREFIX dnnError_t
125 dnnPrimitiveAttributesCreate(dnnPrimitiveAttributes_t* attributes);
126 C2_MKL_SPEC_PREFIX dnnError_t
127 dnnPrimitiveAttributesCreate<float>(dnnPrimitiveAttributes_t* attributes) {
128  return dnnPrimitiveAttributesCreate_F32(attributes);
129 }
130 C2_MKL_SPEC_PREFIX dnnError_t
131 dnnPrimitiveAttributesCreate<double>(dnnPrimitiveAttributes_t* attributes) {
132  return dnnPrimitiveAttributesCreate_F64(attributes);
133 }
134 
135 C2_MKL_TEMPLATE_PREFIX dnnError_t
136 dnnPrimitiveAttributesDestroy(dnnPrimitiveAttributes_t attributes);
137 C2_MKL_SPEC_PREFIX dnnError_t
138 dnnPrimitiveAttributesDestroy<float>(dnnPrimitiveAttributes_t attributes) {
139  return dnnPrimitiveAttributesDestroy_F32(attributes);
140 }
141 C2_MKL_SPEC_PREFIX dnnError_t
142 dnnPrimitiveAttributesDestroy<double>(dnnPrimitiveAttributes_t attributes) {
143  return dnnPrimitiveAttributesDestroy_F64(attributes);
144 }
145 
146 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnPrimitiveGetAttributes(
147  dnnPrimitive_t primitive,
148  dnnPrimitiveAttributes_t* attributes);
149 C2_MKL_SPEC_PREFIX dnnError_t dnnPrimitiveGetAttributes<float>(
150  dnnPrimitive_t primitive,
151  dnnPrimitiveAttributes_t* attributes) {
152  return dnnPrimitiveGetAttributes_F32(primitive, attributes);
153 }
154 C2_MKL_SPEC_PREFIX dnnError_t dnnPrimitiveGetAttributes<double>(
155  dnnPrimitive_t primitive,
156  dnnPrimitiveAttributes_t* attributes) {
157  return dnnPrimitiveGetAttributes_F64(primitive, attributes);
158 }
159 
160 C2_MKL_TEMPLATE_PREFIX dnnError_t
161 dnnExecute(dnnPrimitive_t primitive, void* resources[]);
162 C2_MKL_SPEC_PREFIX dnnError_t
163 dnnExecute<float>(dnnPrimitive_t primitive, void* resources[]) {
164  return dnnExecute_F32(primitive, resources);
165 }
166 C2_MKL_SPEC_PREFIX dnnError_t
167 dnnExecute<double>(dnnPrimitive_t primitive, void* resources[]) {
168  return dnnExecute_F64(primitive, resources);
169 }
170 
171 C2_MKL_TEMPLATE_PREFIX dnnError_t
172 dnnExecuteAsync(dnnPrimitive_t primitive, void* resources[]);
173 C2_MKL_SPEC_PREFIX dnnError_t
174 dnnExecuteAsync<float>(dnnPrimitive_t primitive, void* resources[]) {
175  return dnnExecuteAsync_F32(primitive, resources);
176 }
177 C2_MKL_SPEC_PREFIX dnnError_t
178 dnnExecuteAsync<double>(dnnPrimitive_t primitive, void* resources[]) {
179  return dnnExecuteAsync_F64(primitive, resources);
180 }
181 
182 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnWaitFor(dnnPrimitive_t primitive);
183 C2_MKL_SPEC_PREFIX dnnError_t dnnWaitFor<float>(dnnPrimitive_t primitive) {
184  return dnnWaitFor_F32(primitive);
185 }
186 C2_MKL_SPEC_PREFIX dnnError_t dnnWaitFor<double>(dnnPrimitive_t primitive) {
187  return dnnWaitFor_F64(primitive);
188 }
189 
190 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnDelete(dnnPrimitive_t primitive);
191 C2_MKL_SPEC_PREFIX dnnError_t dnnDelete<float>(dnnPrimitive_t primitive) {
192  return dnnDelete_F32(primitive);
193 }
194 C2_MKL_SPEC_PREFIX dnnError_t dnnDelete<double>(dnnPrimitive_t primitive) {
195  return dnnDelete_F64(primitive);
196 }
197 
198 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnConversionCreate(
199  dnnPrimitive_t* pConversion,
200  const dnnLayout_t from,
201  const dnnLayout_t to);
202 C2_MKL_SPEC_PREFIX dnnError_t dnnConversionCreate<float>(
203  dnnPrimitive_t* pConversion,
204  const dnnLayout_t from,
205  const dnnLayout_t to) {
206  return dnnConversionCreate_F32(pConversion, from, to);
207 }
208 C2_MKL_SPEC_PREFIX dnnError_t dnnConversionCreate<double>(
209  dnnPrimitive_t* pConversion,
210  const dnnLayout_t from,
211  const dnnLayout_t to) {
212  return dnnConversionCreate_F64(pConversion, from, to);
213 }
214 
215 C2_MKL_TEMPLATE_PREFIX dnnError_t
216 dnnConversionExecute(dnnPrimitive_t conversion, void* from, void* to);
217 C2_MKL_SPEC_PREFIX dnnError_t
218 dnnConversionExecute<float>(dnnPrimitive_t conversion, void* from, void* to) {
219  return dnnConversionExecute_F32(conversion, from, to);
220 }
221 C2_MKL_SPEC_PREFIX dnnError_t
222 dnnConversionExecute<double>(dnnPrimitive_t conversion, void* from, void* to) {
223  return dnnConversionExecute_F64(conversion, from, to);
224 }
225 
226 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnConvolutionCreateForward(
227  dnnPrimitive_t* pConvolution,
228  dnnPrimitiveAttributes_t attributes,
229  dnnAlgorithm_t algorithm,
230  size_t dimension,
231  const size_t srcSize[],
232  const size_t dstSize[],
233  const size_t filterSize[],
234  const size_t convolutionStrides[],
235  const int inputOffset[],
236  const dnnBorder_t border_type);
237 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateForward<float>(
238  dnnPrimitive_t* pConvolution,
239  dnnPrimitiveAttributes_t attributes,
240  dnnAlgorithm_t algorithm,
241  size_t dimension,
242  const size_t srcSize[],
243  const size_t dstSize[],
244  const size_t filterSize[],
245  const size_t convolutionStrides[],
246  const int inputOffset[],
247  const dnnBorder_t border_type) {
248  return dnnConvolutionCreateForward_F32(
249  pConvolution,
250  attributes,
251  algorithm,
252  dimension,
253  srcSize,
254  dstSize,
255  filterSize,
256  convolutionStrides,
257  inputOffset,
258  border_type);
259 }
260 
261 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateForward<double>(
262  dnnPrimitive_t* pConvolution,
263  dnnPrimitiveAttributes_t attributes,
264  dnnAlgorithm_t algorithm,
265  size_t dimension,
266  const size_t srcSize[],
267  const size_t dstSize[],
268  const size_t filterSize[],
269  const size_t convolutionStrides[],
270  const int inputOffset[],
271  const dnnBorder_t border_type) {
272  return dnnConvolutionCreateForward_F64(
273  pConvolution,
274  attributes,
275  algorithm,
276  dimension,
277  srcSize,
278  dstSize,
279  filterSize,
280  convolutionStrides,
281  inputOffset,
282  border_type);
283 }
284 
285 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnConvolutionCreateForwardBias(
286  dnnPrimitive_t* pConvolution,
287  dnnPrimitiveAttributes_t attributes,
288  dnnAlgorithm_t algorithm,
289  size_t dimension,
290  const size_t srcSize[],
291  const size_t dstSize[],
292  const size_t filterSize[],
293  const size_t convolutionStrides[],
294  const int inputOffset[],
295  const dnnBorder_t border_type);
296 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateForwardBias<float>(
297  dnnPrimitive_t* pConvolution,
298  dnnPrimitiveAttributes_t attributes,
299  dnnAlgorithm_t algorithm,
300  size_t dimension,
301  const size_t srcSize[],
302  const size_t dstSize[],
303  const size_t filterSize[],
304  const size_t convolutionStrides[],
305  const int inputOffset[],
306  const dnnBorder_t border_type) {
307  return dnnConvolutionCreateForwardBias_F32(
308  pConvolution,
309  attributes,
310  algorithm,
311  dimension,
312  srcSize,
313  dstSize,
314  filterSize,
315  convolutionStrides,
316  inputOffset,
317  border_type);
318 }
319 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateForwardBias<double>(
320  dnnPrimitive_t* pConvolution,
321  dnnPrimitiveAttributes_t attributes,
322  dnnAlgorithm_t algorithm,
323  size_t dimension,
324  const size_t srcSize[],
325  const size_t dstSize[],
326  const size_t filterSize[],
327  const size_t convolutionStrides[],
328  const int inputOffset[],
329  const dnnBorder_t border_type) {
330  return dnnConvolutionCreateForwardBias_F64(
331  pConvolution,
332  attributes,
333  algorithm,
334  dimension,
335  srcSize,
336  dstSize,
337  filterSize,
338  convolutionStrides,
339  inputOffset,
340  border_type);
341 }
342 
343 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnConvolutionCreateBackwardData(
344  dnnPrimitive_t* pConvolution,
345  dnnPrimitiveAttributes_t attributes,
346  dnnAlgorithm_t algorithm,
347  size_t dimension,
348  const size_t srcSize[],
349  const size_t dstSize[],
350  const size_t filterSize[],
351  const size_t convolutionStrides[],
352  const int inputOffset[],
353  const dnnBorder_t border_type);
354 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateBackwardData<float>(
355  dnnPrimitive_t* pConvolution,
356  dnnPrimitiveAttributes_t attributes,
357  dnnAlgorithm_t algorithm,
358  size_t dimension,
359  const size_t srcSize[],
360  const size_t dstSize[],
361  const size_t filterSize[],
362  const size_t convolutionStrides[],
363  const int inputOffset[],
364  const dnnBorder_t border_type) {
365  return dnnConvolutionCreateBackwardData_F32(
366  pConvolution,
367  attributes,
368  algorithm,
369  dimension,
370  srcSize,
371  dstSize,
372  filterSize,
373  convolutionStrides,
374  inputOffset,
375  border_type);
376 }
377 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateBackwardData<double>(
378  dnnPrimitive_t* pConvolution,
379  dnnPrimitiveAttributes_t attributes,
380  dnnAlgorithm_t algorithm,
381  size_t dimension,
382  const size_t srcSize[],
383  const size_t dstSize[],
384  const size_t filterSize[],
385  const size_t convolutionStrides[],
386  const int inputOffset[],
387  const dnnBorder_t border_type) {
388  return dnnConvolutionCreateBackwardData_F64(
389  pConvolution,
390  attributes,
391  algorithm,
392  dimension,
393  srcSize,
394  dstSize,
395  filterSize,
396  convolutionStrides,
397  inputOffset,
398  border_type);
399 }
400 
401 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnConvolutionCreateBackwardFilter(
402  dnnPrimitive_t* pConvolution,
403  dnnPrimitiveAttributes_t attributes,
404  dnnAlgorithm_t algorithm,
405  size_t dimension,
406  const size_t srcSize[],
407  const size_t dstSize[],
408  const size_t filterSize[],
409  const size_t convolutionStrides[],
410  const int inputOffset[],
411  const dnnBorder_t border_type);
412 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateBackwardFilter<float>(
413  dnnPrimitive_t* pConvolution,
414  dnnPrimitiveAttributes_t attributes,
415  dnnAlgorithm_t algorithm,
416  size_t dimension,
417  const size_t srcSize[],
418  const size_t dstSize[],
419  const size_t filterSize[],
420  const size_t convolutionStrides[],
421  const int inputOffset[],
422  const dnnBorder_t border_type) {
423  return dnnConvolutionCreateBackwardFilter_F32(
424  pConvolution,
425  attributes,
426  algorithm,
427  dimension,
428  srcSize,
429  dstSize,
430  filterSize,
431  convolutionStrides,
432  inputOffset,
433  border_type);
434 }
435 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateBackwardFilter<double>(
436  dnnPrimitive_t* pConvolution,
437  dnnPrimitiveAttributes_t attributes,
438  dnnAlgorithm_t algorithm,
439  size_t dimension,
440  const size_t srcSize[],
441  const size_t dstSize[],
442  const size_t filterSize[],
443  const size_t convolutionStrides[],
444  const int inputOffset[],
445  const dnnBorder_t border_type) {
446  return dnnConvolutionCreateBackwardFilter_F64(
447  pConvolution,
448  attributes,
449  algorithm,
450  dimension,
451  srcSize,
452  dstSize,
453  filterSize,
454  convolutionStrides,
455  inputOffset,
456  border_type);
457 }
458 
459 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnConvolutionCreateBackwardBias(
460  dnnPrimitive_t* pConvolution,
461  dnnPrimitiveAttributes_t attributes,
462  dnnAlgorithm_t algorithm,
463  size_t dimension,
464  const size_t dstSize[]);
465 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateBackwardBias<float>(
466  dnnPrimitive_t* pConvolution,
467  dnnPrimitiveAttributes_t attributes,
468  dnnAlgorithm_t algorithm,
469  size_t dimension,
470  const size_t dstSize[]) {
471  return dnnConvolutionCreateBackwardBias_F32(
472  pConvolution, attributes, algorithm, dimension, dstSize);
473 }
474 C2_MKL_SPEC_PREFIX dnnError_t dnnConvolutionCreateBackwardBias<double>(
475  dnnPrimitive_t* pConvolution,
476  dnnPrimitiveAttributes_t attributes,
477  dnnAlgorithm_t algorithm,
478  size_t dimension,
479  const size_t dstSize[]) {
480  return dnnConvolutionCreateBackwardBias_F64(
481  pConvolution, attributes, algorithm, dimension, dstSize);
482 }
483 
484 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnGroupsConvolutionCreateForward(
485  dnnPrimitive_t* pConvolution,
486  dnnPrimitiveAttributes_t attributes,
487  dnnAlgorithm_t algorithm,
488  size_t groups,
489  size_t dimension,
490  const size_t srcSize[],
491  const size_t dstSize[],
492  const size_t filterSize[],
493  const size_t convolutionStrides[],
494  const int inputOffset[],
495  const dnnBorder_t border_type);
496 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateForward<float>(
497  dnnPrimitive_t* pConvolution,
498  dnnPrimitiveAttributes_t attributes,
499  dnnAlgorithm_t algorithm,
500  size_t groups,
501  size_t dimension,
502  const size_t srcSize[],
503  const size_t dstSize[],
504  const size_t filterSize[],
505  const size_t convolutionStrides[],
506  const int inputOffset[],
507  const dnnBorder_t border_type) {
508  return dnnGroupsConvolutionCreateForward_F32(
509  pConvolution,
510  attributes,
511  algorithm,
512  groups,
513  dimension,
514  srcSize,
515  dstSize,
516  filterSize,
517  convolutionStrides,
518  inputOffset,
519  border_type);
520 }
521 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateForward<double>(
522  dnnPrimitive_t* pConvolution,
523  dnnPrimitiveAttributes_t attributes,
524  dnnAlgorithm_t algorithm,
525  size_t groups,
526  size_t dimension,
527  const size_t srcSize[],
528  const size_t dstSize[],
529  const size_t filterSize[],
530  const size_t convolutionStrides[],
531  const int inputOffset[],
532  const dnnBorder_t border_type) {
533  return dnnGroupsConvolutionCreateForward_F64(
534  pConvolution,
535  attributes,
536  algorithm,
537  groups,
538  dimension,
539  srcSize,
540  dstSize,
541  filterSize,
542  convolutionStrides,
543  inputOffset,
544  border_type);
545 }
546 
547 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnGroupsConvolutionCreateForwardBias(
548  dnnPrimitive_t* pConvolution,
549  dnnPrimitiveAttributes_t attributes,
550  dnnAlgorithm_t algorithm,
551  size_t groups,
552  size_t dimension,
553  const size_t srcSize[],
554  const size_t dstSize[],
555  const size_t filterSize[],
556  const size_t convolutionStrides[],
557  const int inputOffset[],
558  const dnnBorder_t border_type);
559 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateForwardBias<float>(
560  dnnPrimitive_t* pConvolution,
561  dnnPrimitiveAttributes_t attributes,
562  dnnAlgorithm_t algorithm,
563  size_t groups,
564  size_t dimension,
565  const size_t srcSize[],
566  const size_t dstSize[],
567  const size_t filterSize[],
568  const size_t convolutionStrides[],
569  const int inputOffset[],
570  const dnnBorder_t border_type) {
571  return dnnGroupsConvolutionCreateForwardBias_F32(
572  pConvolution,
573  attributes,
574  algorithm,
575  groups,
576  dimension,
577  srcSize,
578  dstSize,
579  filterSize,
580  convolutionStrides,
581  inputOffset,
582  border_type);
583 }
584 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateForwardBias<double>(
585  dnnPrimitive_t* pConvolution,
586  dnnPrimitiveAttributes_t attributes,
587  dnnAlgorithm_t algorithm,
588  size_t groups,
589  size_t dimension,
590  const size_t srcSize[],
591  const size_t dstSize[],
592  const size_t filterSize[],
593  const size_t convolutionStrides[],
594  const int inputOffset[],
595  const dnnBorder_t border_type) {
596  return dnnGroupsConvolutionCreateForwardBias_F64(
597  pConvolution,
598  attributes,
599  algorithm,
600  groups,
601  dimension,
602  srcSize,
603  dstSize,
604  filterSize,
605  convolutionStrides,
606  inputOffset,
607  border_type);
608 }
609 
610 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardData(
611  dnnPrimitive_t* pConvolution,
612  dnnPrimitiveAttributes_t attributes,
613  dnnAlgorithm_t algorithm,
614  size_t groups,
615  size_t dimension,
616  const size_t srcSize[],
617  const size_t dstSize[],
618  const size_t filterSize[],
619  const size_t convolutionStrides[],
620  const int inputOffset[],
621  const dnnBorder_t border_type);
622 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardData<float>(
623  dnnPrimitive_t* pConvolution,
624  dnnPrimitiveAttributes_t attributes,
625  dnnAlgorithm_t algorithm,
626  size_t groups,
627  size_t dimension,
628  const size_t srcSize[],
629  const size_t dstSize[],
630  const size_t filterSize[],
631  const size_t convolutionStrides[],
632  const int inputOffset[],
633  const dnnBorder_t border_type) {
634  return dnnGroupsConvolutionCreateBackwardData_F32(
635  pConvolution,
636  attributes,
637  algorithm,
638  groups,
639  dimension,
640  srcSize,
641  dstSize,
642  filterSize,
643  convolutionStrides,
644  inputOffset,
645  border_type);
646 }
647 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardData<double>(
648  dnnPrimitive_t* pConvolution,
649  dnnPrimitiveAttributes_t attributes,
650  dnnAlgorithm_t algorithm,
651  size_t groups,
652  size_t dimension,
653  const size_t srcSize[],
654  const size_t dstSize[],
655  const size_t filterSize[],
656  const size_t convolutionStrides[],
657  const int inputOffset[],
658  const dnnBorder_t border_type) {
659  return dnnGroupsConvolutionCreateBackwardData_F64(
660  pConvolution,
661  attributes,
662  algorithm,
663  groups,
664  dimension,
665  srcSize,
666  dstSize,
667  filterSize,
668  convolutionStrides,
669  inputOffset,
670  border_type);
671 }
672 
673 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardFilter(
674  dnnPrimitive_t* pConvolution,
675  dnnPrimitiveAttributes_t attributes,
676  dnnAlgorithm_t algorithm,
677  size_t groups,
678  size_t dimension,
679  const size_t srcSize[],
680  const size_t dstSize[],
681  const size_t filterSize[],
682  const size_t convolutionStrides[],
683  const int inputOffset[],
684  const dnnBorder_t border_type);
685 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardFilter<float>(
686  dnnPrimitive_t* pConvolution,
687  dnnPrimitiveAttributes_t attributes,
688  dnnAlgorithm_t algorithm,
689  size_t groups,
690  size_t dimension,
691  const size_t srcSize[],
692  const size_t dstSize[],
693  const size_t filterSize[],
694  const size_t convolutionStrides[],
695  const int inputOffset[],
696  const dnnBorder_t border_type) {
697  return dnnGroupsConvolutionCreateBackwardFilter_F32(
698  pConvolution,
699  attributes,
700  algorithm,
701  groups,
702  dimension,
703  srcSize,
704  dstSize,
705  filterSize,
706  convolutionStrides,
707  inputOffset,
708  border_type);
709 }
710 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardFilter<double>(
711  dnnPrimitive_t* pConvolution,
712  dnnPrimitiveAttributes_t attributes,
713  dnnAlgorithm_t algorithm,
714  size_t groups,
715  size_t dimension,
716  const size_t srcSize[],
717  const size_t dstSize[],
718  const size_t filterSize[],
719  const size_t convolutionStrides[],
720  const int inputOffset[],
721  const dnnBorder_t border_type) {
722  return dnnGroupsConvolutionCreateBackwardFilter_F64(
723  pConvolution,
724  attributes,
725  algorithm,
726  groups,
727  dimension,
728  srcSize,
729  dstSize,
730  filterSize,
731  convolutionStrides,
732  inputOffset,
733  border_type);
734 }
735 
736 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardBias(
737  dnnPrimitive_t* pConvolution,
738  dnnPrimitiveAttributes_t attributes,
739  dnnAlgorithm_t algorithm,
740  size_t groups,
741  size_t dimension,
742  const size_t dstSize[]);
743 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardBias<float>(
744  dnnPrimitive_t* pConvolution,
745  dnnPrimitiveAttributes_t attributes,
746  dnnAlgorithm_t algorithm,
747  size_t groups,
748  size_t dimension,
749  const size_t dstSize[]) {
750  return dnnGroupsConvolutionCreateBackwardBias_F32(
751  pConvolution, attributes, algorithm, groups, dimension, dstSize);
752 }
753 C2_MKL_SPEC_PREFIX dnnError_t dnnGroupsConvolutionCreateBackwardBias<double>(
754  dnnPrimitive_t* pConvolution,
755  dnnPrimitiveAttributes_t attributes,
756  dnnAlgorithm_t algorithm,
757  size_t groups,
758  size_t dimension,
759  const size_t dstSize[]) {
760  return dnnGroupsConvolutionCreateBackwardBias_F64(
761  pConvolution, attributes, algorithm, groups, dimension, dstSize);
762 }
763 
764 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnReLUCreateForward(
765  dnnPrimitive_t* pRelu,
766  dnnPrimitiveAttributes_t attributes,
767  const dnnLayout_t dataLayout,
768  float negativeSlope);
769 C2_MKL_SPEC_PREFIX dnnError_t dnnReLUCreateForward<float>(
770  dnnPrimitive_t* pRelu,
771  dnnPrimitiveAttributes_t attributes,
772  const dnnLayout_t dataLayout,
773  float negativeSlope) {
774  return dnnReLUCreateForward_F32(pRelu, attributes, dataLayout, negativeSlope);
775 }
776 C2_MKL_SPEC_PREFIX dnnError_t dnnReLUCreateForward<double>(
777  dnnPrimitive_t* pRelu,
778  dnnPrimitiveAttributes_t attributes,
779  const dnnLayout_t dataLayout,
780  float negativeSlope) {
781  return dnnReLUCreateForward_F64(pRelu, attributes, dataLayout, negativeSlope);
782 }
783 
784 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnReLUCreateBackward(
785  dnnPrimitive_t* pRelu,
786  dnnPrimitiveAttributes_t attributes,
787  const dnnLayout_t diffLayout,
788  const dnnLayout_t dataLayout,
789  float negativeSlope);
790 C2_MKL_SPEC_PREFIX dnnError_t dnnReLUCreateBackward<float>(
791  dnnPrimitive_t* pRelu,
792  dnnPrimitiveAttributes_t attributes,
793  const dnnLayout_t diffLayout,
794  const dnnLayout_t dataLayout,
795  float negativeSlope) {
796  return dnnReLUCreateBackward_F32(
797  pRelu, attributes, diffLayout, dataLayout, negativeSlope);
798 }
799 C2_MKL_SPEC_PREFIX dnnError_t dnnReLUCreateBackward<double>(
800  dnnPrimitive_t* pRelu,
801  dnnPrimitiveAttributes_t attributes,
802  const dnnLayout_t diffLayout,
803  const dnnLayout_t dataLayout,
804  float negativeSlope) {
805  return dnnReLUCreateBackward_F64(
806  pRelu, attributes, diffLayout, dataLayout, negativeSlope);
807 }
808 
809 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnLRNCreateForward(
810  dnnPrimitive_t* pLrn,
811  dnnPrimitiveAttributes_t attributes,
812  const dnnLayout_t dataLayout,
813  size_t kernel_size,
814  float alpha,
815  float beta,
816  float k);
817 C2_MKL_SPEC_PREFIX dnnError_t dnnLRNCreateForward<float>(
818  dnnPrimitive_t* pLrn,
819  dnnPrimitiveAttributes_t attributes,
820  const dnnLayout_t dataLayout,
821  size_t kernel_size,
822  float alpha,
823  float beta,
824  float k) {
825  return dnnLRNCreateForward_F32(
826  pLrn, attributes, dataLayout, kernel_size, alpha, beta, k);
827 }
828 C2_MKL_SPEC_PREFIX dnnError_t dnnLRNCreateForward<double>(
829  dnnPrimitive_t* pLrn,
830  dnnPrimitiveAttributes_t attributes,
831  const dnnLayout_t dataLayout,
832  size_t kernel_size,
833  float alpha,
834  float beta,
835  float k) {
836  return dnnLRNCreateForward_F64(
837  pLrn, attributes, dataLayout, kernel_size, alpha, beta, k);
838 }
839 
840 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnLRNCreateBackward(
841  dnnPrimitive_t* pLrn,
842  dnnPrimitiveAttributes_t attributes,
843  const dnnLayout_t diffLayout,
844  const dnnLayout_t dataLayout,
845  size_t kernel_size,
846  float alpha,
847  float beta,
848  float k);
849 C2_MKL_SPEC_PREFIX dnnError_t dnnLRNCreateBackward<float>(
850  dnnPrimitive_t* pLrn,
851  dnnPrimitiveAttributes_t attributes,
852  const dnnLayout_t diffLayout,
853  const dnnLayout_t dataLayout,
854  size_t kernel_size,
855  float alpha,
856  float beta,
857  float k) {
858  return dnnLRNCreateBackward_F32(
859  pLrn, attributes, diffLayout, dataLayout, kernel_size, alpha, beta, k);
860 }
861 C2_MKL_SPEC_PREFIX dnnError_t dnnLRNCreateBackward<double>(
862  dnnPrimitive_t* pLrn,
863  dnnPrimitiveAttributes_t attributes,
864  const dnnLayout_t diffLayout,
865  const dnnLayout_t dataLayout,
866  size_t kernel_size,
867  float alpha,
868  float beta,
869  float k) {
870  return dnnLRNCreateBackward_F64(
871  pLrn, attributes, diffLayout, dataLayout, kernel_size, alpha, beta, k);
872 }
873 
874 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnPoolingCreateForward(
875  dnnPrimitive_t* pPooling,
876  dnnPrimitiveAttributes_t attributes,
877  dnnAlgorithm_t op,
878  const dnnLayout_t srcLayout,
879  const size_t kernelSize[],
880  const size_t kernelStride[],
881  const int inputOffset[],
882  const dnnBorder_t border_type);
883 C2_MKL_SPEC_PREFIX dnnError_t dnnPoolingCreateForward<float>(
884  dnnPrimitive_t* pPooling,
885  dnnPrimitiveAttributes_t attributes,
886  dnnAlgorithm_t op,
887  const dnnLayout_t srcLayout,
888  const size_t kernelSize[],
889  const size_t kernelStride[],
890  const int inputOffset[],
891  const dnnBorder_t border_type) {
892  return dnnPoolingCreateForward_F32(
893  pPooling,
894  attributes,
895  op,
896  srcLayout,
897  kernelSize,
898  kernelStride,
899  inputOffset,
900  border_type);
901 }
902 C2_MKL_SPEC_PREFIX dnnError_t dnnPoolingCreateForward<double>(
903  dnnPrimitive_t* pPooling,
904  dnnPrimitiveAttributes_t attributes,
905  dnnAlgorithm_t op,
906  const dnnLayout_t srcLayout,
907  const size_t kernelSize[],
908  const size_t kernelStride[],
909  const int inputOffset[],
910  const dnnBorder_t border_type) {
911  return dnnPoolingCreateForward_F64(
912  pPooling,
913  attributes,
914  op,
915  srcLayout,
916  kernelSize,
917  kernelStride,
918  inputOffset,
919  border_type);
920 }
921 
922 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnPoolingCreateBackward(
923  dnnPrimitive_t* pPooling,
924  dnnPrimitiveAttributes_t attributes,
925  dnnAlgorithm_t op,
926  const dnnLayout_t srcLayout,
927  const size_t kernelSize[],
928  const size_t kernelStride[],
929  const int inputOffset[],
930  const dnnBorder_t border_type);
931 C2_MKL_SPEC_PREFIX dnnError_t dnnPoolingCreateBackward<float>(
932  dnnPrimitive_t* pPooling,
933  dnnPrimitiveAttributes_t attributes,
934  dnnAlgorithm_t op,
935  const dnnLayout_t srcLayout,
936  const size_t kernelSize[],
937  const size_t kernelStride[],
938  const int inputOffset[],
939  const dnnBorder_t border_type) {
940  return dnnPoolingCreateBackward_F32(
941  pPooling,
942  attributes,
943  op,
944  srcLayout,
945  kernelSize,
946  kernelStride,
947  inputOffset,
948  border_type);
949 }
950 C2_MKL_SPEC_PREFIX dnnError_t dnnPoolingCreateBackward<double>(
951  dnnPrimitive_t* pPooling,
952  dnnPrimitiveAttributes_t attributes,
953  dnnAlgorithm_t op,
954  const dnnLayout_t srcLayout,
955  const size_t kernelSize[],
956  const size_t kernelStride[],
957  const int inputOffset[],
958  const dnnBorder_t border_type) {
959  return dnnPoolingCreateBackward_F64(
960  pPooling,
961  attributes,
962  op,
963  srcLayout,
964  kernelSize,
965  kernelStride,
966  inputOffset,
967  border_type);
968 }
969 
970 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnConcatCreate(
971  dnnPrimitive_t* pConcat,
972  dnnPrimitiveAttributes_t attributes,
973  const size_t N,
974  dnnLayout_t src[]);
975 C2_MKL_SPEC_PREFIX dnnError_t dnnConcatCreate<float>(
976  dnnPrimitive_t* pConcat,
977  dnnPrimitiveAttributes_t attributes,
978  const size_t N,
979  dnnLayout_t src[]) {
980  return dnnConcatCreate_F32(pConcat, attributes, N, src);
981 }
982 C2_MKL_SPEC_PREFIX dnnError_t dnnConcatCreate<double>(
983  dnnPrimitive_t* pConcat,
984  dnnPrimitiveAttributes_t attributes,
985  const size_t N,
986  dnnLayout_t src[]) {
987  return dnnConcatCreate_F64(pConcat, attributes, N, src);
988 }
989 
990 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnSplitCreate(
991  dnnPrimitive_t* pSplit,
992  dnnPrimitiveAttributes_t attributes,
993  const size_t N,
994  dnnLayout_t src,
995  size_t dst[]);
996 C2_MKL_SPEC_PREFIX dnnError_t dnnSplitCreate<float>(
997  dnnPrimitive_t* pSplit,
998  dnnPrimitiveAttributes_t attributes,
999  const size_t N,
1000  dnnLayout_t src,
1001  size_t dst[]) {
1002  return dnnSplitCreate_F32(pSplit, attributes, N, src, dst);
1003 }
1004 C2_MKL_SPEC_PREFIX dnnError_t dnnSplitCreate<double>(
1005  dnnPrimitive_t* pSplit,
1006  dnnPrimitiveAttributes_t attributes,
1007  const size_t N,
1008  dnnLayout_t src,
1009  size_t dst[]) {
1010  return dnnSplitCreate_F64(pSplit, attributes, N, src, dst);
1011 }
1012 
1013 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnSumCreate(
1014  dnnPrimitive_t* pSum,
1015  dnnPrimitiveAttributes_t attributes,
1016  const size_t nSummands,
1017  dnnLayout_t layout,
1018  T* coefficients);
1019 C2_MKL_SPEC_PREFIX dnnError_t dnnSumCreate<float>(
1020  dnnPrimitive_t* pSum,
1021  dnnPrimitiveAttributes_t attributes,
1022  const size_t nSummands,
1023  dnnLayout_t layout,
1024  float* coefficients) {
1025  return dnnSumCreate_F32(pSum, attributes, nSummands, layout, coefficients);
1026 }
1027 C2_MKL_SPEC_PREFIX dnnError_t dnnSumCreate<double>(
1028  dnnPrimitive_t* pSum,
1029  dnnPrimitiveAttributes_t attributes,
1030  const size_t nSummands,
1031  dnnLayout_t layout,
1032  double* coefficients) {
1033  return dnnSumCreate_F64(pSum, attributes, nSummands, layout, coefficients);
1034 }
1035 
1036 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnBatchNormalizationCreateForward(
1037  dnnPrimitive_t* pBatchNormalization,
1038  dnnPrimitiveAttributes_t attributes,
1039  const dnnLayout_t dataLayout,
1040  float eps);
1041 C2_MKL_SPEC_PREFIX dnnError_t dnnBatchNormalizationCreateForward<float>(
1042  dnnPrimitive_t* pBatchNormalization,
1043  dnnPrimitiveAttributes_t attributes,
1044  const dnnLayout_t dataLayout,
1045  float eps) {
1046  return dnnBatchNormalizationCreateForward_F32(
1047  pBatchNormalization, attributes, dataLayout, eps);
1048 }
1049 C2_MKL_SPEC_PREFIX dnnError_t dnnBatchNormalizationCreateForward<double>(
1050  dnnPrimitive_t* pBatchNormalization,
1051  dnnPrimitiveAttributes_t attributes,
1052  const dnnLayout_t dataLayout,
1053  float eps) {
1054  return dnnBatchNormalizationCreateForward_F64(
1055  pBatchNormalization, attributes, dataLayout, eps);
1056 }
1057 
1058 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnBatchNormalizationCreateBackwardData(
1059  dnnPrimitive_t* pBatchNormalization,
1060  dnnPrimitiveAttributes_t attributes,
1061  const dnnLayout_t dataLayout,
1062  float eps);
1063 C2_MKL_SPEC_PREFIX dnnError_t dnnBatchNormalizationCreateBackwardData<float>(
1064  dnnPrimitive_t* pBatchNormalization,
1065  dnnPrimitiveAttributes_t attributes,
1066  const dnnLayout_t dataLayout,
1067  float eps) {
1068  return dnnBatchNormalizationCreateBackwardData_F32(
1069  pBatchNormalization, attributes, dataLayout, eps);
1070 }
1071 
1072 C2_MKL_SPEC_PREFIX dnnError_t dnnBatchNormalizationCreateBackwardData<double>(
1073  dnnPrimitive_t* pBatchNormalization,
1074  dnnPrimitiveAttributes_t attributes,
1075  const dnnLayout_t dataLayout,
1076  float eps) {
1077  return dnnBatchNormalizationCreateBackwardData_F64(
1078  pBatchNormalization, attributes, dataLayout, eps);
1079 }
1080 
1081 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnBatchNormalizationCreateBackwardScaleShift(
1082  dnnPrimitive_t* pBatchNormalization,
1083  dnnPrimitiveAttributes_t attributes,
1084  const dnnLayout_t dataLayout,
1085  float eps);
1086 C2_MKL_SPEC_PREFIX dnnError_t
1087 dnnBatchNormalizationCreateBackwardScaleShift<float>(
1088  dnnPrimitive_t* pBatchNormalization,
1089  dnnPrimitiveAttributes_t attributes,
1090  const dnnLayout_t dataLayout,
1091  float eps) {
1092  return dnnBatchNormalizationCreateBackwardScaleShift_F32(
1093  pBatchNormalization, attributes, dataLayout, eps);
1094 }
1095 C2_MKL_SPEC_PREFIX dnnError_t
1096 dnnBatchNormalizationCreateBackwardScaleShift<double>(
1097  dnnPrimitive_t* pBatchNormalization,
1098  dnnPrimitiveAttributes_t attributes,
1099  const dnnLayout_t dataLayout,
1100  float eps) {
1101  return dnnBatchNormalizationCreateBackwardScaleShift_F64(
1102  pBatchNormalization, attributes, dataLayout, eps);
1103 }
1104 
1105 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnBatchNormalizationCreateForward_v2(
1106  dnnPrimitive_t* pBatchNormalization,
1107  dnnPrimitiveAttributes_t attributes,
1108  const dnnLayout_t dataLayout,
1109  float eps,
1110  unsigned int flags);
1111 C2_MKL_SPEC_PREFIX dnnError_t dnnBatchNormalizationCreateForward_v2<float>(
1112  dnnPrimitive_t* pBatchNormalization,
1113  dnnPrimitiveAttributes_t attributes,
1114  const dnnLayout_t dataLayout,
1115  float eps,
1116  unsigned int flags) {
1117  return dnnBatchNormalizationCreateForward_v2_F32(
1118  pBatchNormalization, attributes, dataLayout, eps, flags);
1119 }
1120 C2_MKL_SPEC_PREFIX dnnError_t dnnBatchNormalizationCreateForward_v2<double>(
1121  dnnPrimitive_t* pBatchNormalization,
1122  dnnPrimitiveAttributes_t attributes,
1123  const dnnLayout_t dataLayout,
1124  float eps,
1125  unsigned int flags) {
1126  return dnnBatchNormalizationCreateForward_v2_F64(
1127  pBatchNormalization, attributes, dataLayout, eps, flags);
1128 }
1129 
1130 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnBatchNormalizationCreateBackward_v2(
1131  dnnPrimitive_t* pBatchNormalization,
1132  dnnPrimitiveAttributes_t attributes,
1133  const dnnLayout_t dataLayout,
1134  float eps,
1135  unsigned int flags);
1136 C2_MKL_SPEC_PREFIX dnnError_t dnnBatchNormalizationCreateBackward_v2<float>(
1137  dnnPrimitive_t* pBatchNormalization,
1138  dnnPrimitiveAttributes_t attributes,
1139  const dnnLayout_t dataLayout,
1140  float eps,
1141  unsigned int flags) {
1142  return dnnBatchNormalizationCreateBackward_v2_F32(
1143  pBatchNormalization, attributes, dataLayout, eps, flags);
1144 }
1145 
1146 C2_MKL_SPEC_PREFIX dnnError_t dnnBatchNormalizationCreateBackward_v2<double>(
1147  dnnPrimitive_t* pBatchNormalization,
1148  dnnPrimitiveAttributes_t attributes,
1149  const dnnLayout_t dataLayout,
1150  float eps,
1151  unsigned int flags) {
1152  return dnnBatchNormalizationCreateBackward_v2_F64(
1153  pBatchNormalization, attributes, dataLayout, eps, flags);
1154 }
1155 
1156 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnInnerProductCreateForward(
1157  dnnPrimitive_t* pInnerProduct,
1158  dnnPrimitiveAttributes_t attributes,
1159  size_t dimensions,
1160  const size_t srcSize[],
1161  size_t outputChannels);
1162 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateForward<float>(
1163  dnnPrimitive_t* pInnerProduct,
1164  dnnPrimitiveAttributes_t attributes,
1165  size_t dimensions,
1166  const size_t srcSize[],
1167  size_t outputChannels) {
1168  return dnnInnerProductCreateForward_F32(
1169  pInnerProduct, attributes, dimensions, srcSize, outputChannels);
1170 }
1171 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateForward<double>(
1172  dnnPrimitive_t* pInnerProduct,
1173  dnnPrimitiveAttributes_t attributes,
1174  size_t dimensions,
1175  const size_t srcSize[],
1176  size_t outputChannels) {
1177  return dnnInnerProductCreateForward_F64(
1178  pInnerProduct, attributes, dimensions, srcSize, outputChannels);
1179 }
1180 
1181 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnInnerProductCreateForwardBias(
1182  dnnPrimitive_t* pInnerProduct,
1183  dnnPrimitiveAttributes_t attributes,
1184  size_t dimensions,
1185  const size_t srcSize[],
1186  size_t outputChannels);
1187 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateForwardBias<float>(
1188  dnnPrimitive_t* pInnerProduct,
1189  dnnPrimitiveAttributes_t attributes,
1190  size_t dimensions,
1191  const size_t srcSize[],
1192  size_t outputChannels) {
1193  return dnnInnerProductCreateForwardBias_F32(
1194  pInnerProduct, attributes, dimensions, srcSize, outputChannels);
1195 }
1196 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateForwardBias<double>(
1197  dnnPrimitive_t* pInnerProduct,
1198  dnnPrimitiveAttributes_t attributes,
1199  size_t dimensions,
1200  const size_t srcSize[],
1201  size_t outputChannels) {
1202  return dnnInnerProductCreateForwardBias_F64(
1203  pInnerProduct, attributes, dimensions, srcSize, outputChannels);
1204 }
1205 
1206 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnInnerProductCreateBackwardData(
1207  dnnPrimitive_t* pInnerProduct,
1208  dnnPrimitiveAttributes_t attributes,
1209  size_t dimensions,
1210  const size_t srcSize[],
1211  size_t outputChannels);
1212 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateBackwardData<float>(
1213  dnnPrimitive_t* pInnerProduct,
1214  dnnPrimitiveAttributes_t attributes,
1215  size_t dimensions,
1216  const size_t srcSize[],
1217  size_t outputChannels) {
1218  return dnnInnerProductCreateBackwardData_F32(
1219  pInnerProduct, attributes, dimensions, srcSize, outputChannels);
1220 }
1221 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateBackwardData<double>(
1222  dnnPrimitive_t* pInnerProduct,
1223  dnnPrimitiveAttributes_t attributes,
1224  size_t dimensions,
1225  const size_t srcSize[],
1226  size_t outputChannels) {
1227  return dnnInnerProductCreateBackwardData_F64(
1228  pInnerProduct, attributes, dimensions, srcSize, outputChannels);
1229 }
1230 
1231 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnInnerProductCreateBackwardFilter(
1232  dnnPrimitive_t* pInnerProduct,
1233  dnnPrimitiveAttributes_t attributes,
1234  size_t dimensions,
1235  const size_t srcSize[],
1236  size_t outputChannels);
1237 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateBackwardFilter<float>(
1238  dnnPrimitive_t* pInnerProduct,
1239  dnnPrimitiveAttributes_t attributes,
1240  size_t dimensions,
1241  const size_t srcSize[],
1242  size_t outputChannels) {
1243  return dnnInnerProductCreateBackwardFilter_F32(
1244  pInnerProduct, attributes, dimensions, srcSize, outputChannels);
1245 }
1246 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateBackwardFilter<double>(
1247  dnnPrimitive_t* pInnerProduct,
1248  dnnPrimitiveAttributes_t attributes,
1249  size_t dimensions,
1250  const size_t srcSize[],
1251  size_t outputChannels) {
1252  return dnnInnerProductCreateBackwardFilter_F64(
1253  pInnerProduct, attributes, dimensions, srcSize, outputChannels);
1254 }
1255 
1256 C2_MKL_TEMPLATE_PREFIX dnnError_t dnnInnerProductCreateBackwardBias(
1257  dnnPrimitive_t* pInnerProduct,
1258  dnnPrimitiveAttributes_t attributes,
1259  size_t dimensions,
1260  const size_t srcSize[]);
1261 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateBackwardBias<float>(
1262  dnnPrimitive_t* pInnerProduct,
1263  dnnPrimitiveAttributes_t attributes,
1264  size_t dimensions,
1265  const size_t srcSize[]) {
1266  return dnnInnerProductCreateBackwardBias_F32(
1267  pInnerProduct, attributes, dimensions, srcSize);
1268 }
1269 C2_MKL_SPEC_PREFIX dnnError_t dnnInnerProductCreateBackwardBias<double>(
1270  dnnPrimitive_t* pInnerProduct,
1271  dnnPrimitiveAttributes_t attributes,
1272  size_t dimensions,
1273  const size_t srcSize[]) {
1274  return dnnInnerProductCreateBackwardBias_F64(
1275  pInnerProduct, attributes, dimensions, srcSize);
1276 }
1277 
1278 } // namespace mkl
1279 } // namespace caffe2
1280 
1281 // Undef macros to make sure that things are clean.
1282 #undef C2_MKL_TEMPLATE_PREFIX
1283 #undef C2_MKL_SPEC_PREFIX
1284 
1285 #endif // CAFFE2_UTILS_MKL_MKL_DNN_CPPWRAPPER_H
Copyright (c) 2016-present, Facebook, Inc.