Deep Neural Network Library (DNNL)  1.3.0
Performance library for Deep Learning
dnnl_types.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2016-2020 Intel Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16 
19 
20 #ifndef DNNL_TYPES_H
21 #define DNNL_TYPES_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
28 #include <stddef.h>
29 #include <stdint.h>
31 
34 
37 
39 typedef enum {
55 
57 
60 
62 typedef enum {
66  dnnl_f16 = 1,
68  dnnl_bf16 = 2,
70  dnnl_f32 = 3,
72  dnnl_s32 = 4,
74  dnnl_s8 = 5,
76  dnnl_u8 = 6,
78 
80 typedef enum {
95 
164 typedef enum {
170 
171  // Semantic agnostic section
172  // The physical order of dimensions is defined by the permutation of the
173  // characters, assuming that ab..z defines the natural order.
174 
175  // Plain formats
176 
183 
184  // Permuted plain formats
185 
203 
204  // Opaque blocked formats
205 
206  dnnl_Abc16a,
207  dnnl_ABc16a16b,
208  dnnl_ABc4a4b,
211  dnnl_ABc16b16a,
212  dnnl_Abc4a,
215  dnnl_ABc4b16a4b,
216  dnnl_ABc2b8a4b,
217  dnnl_ABc4b4a,
218  dnnl_ABc8a16b2a,
219  dnnl_ABc8a8b,
222  dnnl_ABc8b16a2b,
223  dnnl_BAc8a16b2a,
224  dnnl_ABc8b8a,
225  dnnl_Abcd16a,
226  dnnl_Abcd8a,
227  dnnl_ABcd16a16b,
228  dnnl_ABcd32a32b,
231  dnnl_ABcd16b16a,
232  dnnl_aBCd16b16c,
233  dnnl_aBCd16c16b,
234  dnnl_Abcd4a,
237  dnnl_ABcd4b16a4b,
238  dnnl_ABcd4b4a,
239  dnnl_ABcd4a4b,
240  dnnl_aBCd4c16b4c,
241  dnnl_aBCd2c8b4c,
242  dnnl_aBCd4c4b,
243  dnnl_aBCd4b4c,
244  dnnl_ABcd8a16b2a,
245  dnnl_ABcd2b8a4b,
246  dnnl_ABcd8a8b,
249  dnnl_ABcd8b16a2b,
250  dnnl_aBCd8b16c2b,
251  dnnl_BAcd8a16b2a,
254  dnnl_aBCd8b8c,
255  dnnl_aBCd8c16b2c,
256  dnnl_ABcde8a16b2a,
257  dnnl_aCBd8b16c2b,
258  dnnl_aBCd8c8b,
259  dnnl_Abcde16a,
260  dnnl_ABcde16a16b,
261  dnnl_BAcde8a16b2a,
268  dnnl_ABcde16b16a,
269  dnnl_aBCde16b16c,
270  dnnl_aBCde16c16b,
271  dnnl_aBCde2c8b4c,
272  dnnl_Abcde4a,
275  dnnl_ABcde4b4a,
276  dnnl_ABcde4a4b,
277  dnnl_aBCde4b4c,
278  dnnl_aBCde4c16b4c,
279  dnnl_aBCde4c4b,
280  dnnl_Abcde8a,
281  dnnl_ABcde8a8b,
282  dnnl_BAcde16b16a,
285  dnnl_ABcde8b16a2b,
286  dnnl_aBCde8b16c2b,
287  dnnl_aCBde8b16c2b,
288  dnnl_ABcde8b8a,
289  dnnl_aBCde8b8c,
290  dnnl_ABcd4a8b8a4b,
291  dnnl_ABcd2a8b8a2b,
292  dnnl_aBCde4b8c8b4c,
293  dnnl_aBCde2b8c8b2c,
294  dnnl_aBCde8c16b2c,
295  dnnl_aBCde8c8b,
298  dnnl_aBCdef16b16c,
299  dnnl_aBCdef16c16b,
300  dnnl_aBCdef4c16b4c,
305  dnnl_aBCdef4c4b,
306  dnnl_aBCdef4b4c,
307  dnnl_aBCdef8b8c,
308  dnnl_aBCdef8c16b2c,
309  dnnl_aBCdef8b16c2b,
310  dnnl_aCBdef8b16c2b,
311  dnnl_aBCdef8c8b,
312  dnnl_aBdc16b,
313  dnnl_aBdC16b2c,
314  dnnl_aBdc4b,
315  dnnl_aBdc8b,
316  dnnl_aBdec16b,
317  dnnl_aBdeC16b2c,
318  dnnl_aBdec32b,
319  dnnl_aBdec4b,
320  dnnl_aBdec8b,
321  dnnl_aBdefc16b,
322  dnnl_aBdefC16b2c,
323  dnnl_aCBdef16c16b,
324  dnnl_aBdefc4b,
325  dnnl_aBdefc8b,
326  dnnl_Abcdef16a,
327  dnnl_Acb16a,
328  dnnl_AcB16a2b,
329  dnnl_Acb4a,
330  dnnl_Acb8a,
331  dnnl_aCBd16b16c,
332  dnnl_aCBd16c16b,
333  dnnl_aCBde16b16c,
334  dnnl_aCBde16c16b,
335  dnnl_Acdb16a,
336  dnnl_AcdB16a2b,
337  dnnl_Acdb32a,
338  dnnl_Acdb4a,
339  dnnl_Acdb8a,
340  dnnl_Acdeb16a,
341  dnnl_AcdeB16a2b,
342  dnnl_Acdeb4a,
343  dnnl_Acdeb8a,
344  dnnl_BAc16a16b,
345  dnnl_BAc16b16a,
346  dnnl_BAcd16a16b,
347  dnnl_BAcd16b16a,
348  dnnl_BAcde16a16b,
349  dnnl_aCBdef16b16c,
350 
354 
355  // Aliases
356 
381 
412 
427 
456 
457  // Opaque data types, are not to be used explicitly
458 
459  // data
460 
488  dnnl_NCw16n16c = dnnl_ABc16a16b,
489  dnnl_NCdhw16n16c = dnnl_ABcde16a16b,
490  dnnl_NChw16n16c = dnnl_ABcd16a16b,
491  dnnl_NChw32n32c = dnnl_ABcd32a32b,
492 
493  // weights, 3D
494  dnnl_IOw16o16i = dnnl_BAc16a16b,
495  dnnl_IOw16i16o = dnnl_BAc16b16a,
496  dnnl_OIw16i16o = dnnl_ABc16b16a,
497  dnnl_OIw16o16i = dnnl_ABc16a16b,
498  dnnl_Oiw16o = dnnl_Abc16a,
499  dnnl_OIw4i16o4i = dnnl_ABc4b16a4b,
500  dnnl_OIw2i8o4i = dnnl_ABc2b8a4b,
501  dnnl_OIw4i4o = dnnl_ABc4b4a,
502  dnnl_OIw4o4i = dnnl_ABc4a4b,
503  dnnl_Oiw4o = dnnl_Abc4a,
504  dnnl_OIw8i16o2i = dnnl_ABc8b16a2b,
505  dnnl_OIw8i8o = dnnl_ABc8b8a,
506  dnnl_OIw8o16i2o = dnnl_ABc8a16b2a,
507  dnnl_IOw8o16i2o = dnnl_BAc8a16b2a,
508  dnnl_OIw8o8i = dnnl_ABc8a8b,
509  dnnl_Owi16o = dnnl_Acb16a,
510  dnnl_OwI16o2i = dnnl_AcB16a2b,
511  dnnl_Owi4o = dnnl_Acb4a,
512  dnnl_Owi8o = dnnl_Acb8a,
513 
514  // weights, 4D
515  dnnl_IOhw16i16o = dnnl_BAcd16b16a,
516  dnnl_IOhw16o16i = dnnl_BAcd16a16b,
517  dnnl_Ohwi16o = dnnl_Acdb16a,
518  dnnl_OhwI16o2i = dnnl_AcdB16a2b,
519  dnnl_Ohwi32o = dnnl_Acdb32a,
520  dnnl_Ohwi4o = dnnl_Acdb4a,
521  dnnl_Ohwi8o = dnnl_Acdb8a,
522  dnnl_OIhw16i16o = dnnl_ABcd16b16a,
523  dnnl_OIhw16o16i = dnnl_ABcd16a16b,
524  dnnl_Oihw16o = dnnl_Abcd16a,
525  dnnl_OIhw4i16o4i = dnnl_ABcd4b16a4b,
526  dnnl_OIhw4i4o = dnnl_ABcd4b4a,
527  dnnl_OIhw4o4i = dnnl_ABcd4a4b,
528  dnnl_Oihw4o = dnnl_Abcd4a,
529  dnnl_OIhw8i16o2i = dnnl_ABcd8b16a2b,
530  dnnl_OIhw8i8o = dnnl_ABcd8b8a,
531  dnnl_OIhw8o16i2o = dnnl_ABcd8a16b2a,
532  dnnl_OIhw2i8o4i = dnnl_ABcd2b8a4b,
533  dnnl_IOhw8o16i2o = dnnl_BAcd8a16b2a,
534  dnnl_OIhw8o8i = dnnl_ABcd8a8b,
535 
536  // weights, 5D
537  dnnl_Odhwi16o = dnnl_Acdeb16a,
538  dnnl_OdhwI16o2i = dnnl_AcdeB16a2b,
539  dnnl_Odhwi4o = dnnl_Acdeb4a,
540  dnnl_Odhwi8o = dnnl_Acdeb8a,
541  dnnl_OIdhw16i16o = dnnl_ABcde16b16a,
542  dnnl_OIdhw16o16i = dnnl_ABcde16a16b,
543  dnnl_Oidhw16o = dnnl_Abcde16a,
544  dnnl_OIdhw4i4o = dnnl_ABcde4b4a,
545  dnnl_OIdhw4o4i = dnnl_ABcde4a4b,
546  dnnl_Oidhw4o = dnnl_Abcde4a,
547  dnnl_OIdhw8i16o2i = dnnl_ABcde8b16a2b,
548  dnnl_OIdhw8i8o = dnnl_ABcde8b8a,
549  dnnl_OIdhw8o16i2o = dnnl_ABcde8a16b2a,
550  dnnl_IOdhw8o16i2o = dnnl_BAcde8a16b2a,
551  dnnl_OIdhw4i16o4i = dnnl_ABcde4b16a4b,
552  dnnl_OIdhw2i8o4i = dnnl_ABcde2b8a4b,
553  dnnl_OIdhw8o8i = dnnl_ABcde8a8b,
554  dnnl_IOdhw16i16o = dnnl_BAcde16b16a,
555  dnnl_IOdhw16o16i = dnnl_BAcde16a16b,
556 
557  // weights w/ groups, 3D
558  dnnl_Goiw16g = dnnl_Abcd16a,
559  dnnl_Goiw8g = dnnl_Abcd8a,
560  dnnl_gIOw16o16i = dnnl_aCBd16b16c,
561  dnnl_gIOw16i16o = dnnl_aCBd16c16b,
562  dnnl_gOIw16i16o = dnnl_aBCd16c16b,
563  dnnl_gOIw16o16i = dnnl_aBCd16b16c,
564  dnnl_gOiw16o = dnnl_aBcd16b,
565  dnnl_gOIw4i16o4i = dnnl_aBCd4c16b4c,
566  dnnl_gOIw2i8o4i = dnnl_aBCd2c8b4c,
567  dnnl_gOIw4i4o = dnnl_aBCd4c4b,
568  dnnl_gOIw4o4i = dnnl_aBCd4b4c,
569  dnnl_gOiw4o = dnnl_aBcd4b,
570  dnnl_gOIw8i16o2i = dnnl_aBCd8c16b2c,
571  dnnl_gOIw8i8o = dnnl_aBCd8c8b,
572  dnnl_gOIw8o16i2o = dnnl_aBCd8b16c2b,
573  dnnl_gIOw8o16i2o = dnnl_aCBd8b16c2b,
574  dnnl_gOIw8o8i = dnnl_aBCd8b8c,
575  dnnl_gOwi16o = dnnl_aBdc16b,
576  dnnl_gOwI16o2i = dnnl_aBdC16b2c,
577  dnnl_gOwi4o = dnnl_aBdc4b,
578  dnnl_gOwi8o = dnnl_aBdc8b,
579 
580  // weights w/ groups, 4D
581  dnnl_gIOhw16i16o = dnnl_aCBde16c16b,
582  dnnl_gIOhw16o16i = dnnl_aCBde16b16c,
583  dnnl_gOhwi16o = dnnl_aBdec16b,
584  dnnl_gOhwI16o2i = dnnl_aBdeC16b2c,
585  dnnl_gOhwi32o = dnnl_aBdec32b,
586  dnnl_gOhwi4o = dnnl_aBdec4b,
587  dnnl_gOhwi8o = dnnl_aBdec8b,
588  dnnl_Goihw16g = dnnl_Abcde16a,
589  dnnl_gOIhw16i16o = dnnl_aBCde16c16b,
590  dnnl_gOIhw16o16i = dnnl_aBCde16b16c,
591  dnnl_gOihw16o = dnnl_aBcde16b,
592  dnnl_gOIhw2i8o4i = dnnl_aBCde2c8b4c,
593  dnnl_gOIhw4i16o4i = dnnl_aBCde4c16b4c,
594  dnnl_gOIhw4i4o = dnnl_aBCde4c4b,
595  dnnl_gOIhw4o4i = dnnl_aBCde4b4c,
596  dnnl_gOihw4o = dnnl_aBcde4b,
597  dnnl_Goihw8g = dnnl_Abcde8a,
598  dnnl_gOIhw8i16o2i = dnnl_aBCde8c16b2c,
599  dnnl_gOIhw8i8o = dnnl_aBCde8c8b,
600  dnnl_gOIhw8o16i2o = dnnl_aBCde8b16c2b,
601  dnnl_gIOhw8o16i2o = dnnl_aCBde8b16c2b,
602  dnnl_gOIhw8o8i = dnnl_aBCde8b8c,
603 
604  dnnl_OIhw4o8i8o4i = dnnl_ABcd4a8b8a4b,
605  dnnl_OIhw2o8i8o2i = dnnl_ABcd2a8b8a2b,
606  dnnl_gOIhw4o8i8o4i = dnnl_aBCde4b8c8b4c,
607  dnnl_gOIhw2o8i8o2i = dnnl_aBCde2b8c8b2c,
608 
609  // weights w/ groups, 6D
610  dnnl_gIOdhw16i16o = dnnl_aCBdef16c16b,
611  dnnl_gIOdhw16o16i = dnnl_aCBdef16b16c,
612  dnnl_gOdhwi16o = dnnl_aBdefc16b,
613  dnnl_gOdhwI16o2i = dnnl_aBdefC16b2c,
614  dnnl_gOdhwi4o = dnnl_aBdefc4b,
615  dnnl_gOdhwi8o = dnnl_aBdefc8b,
616  dnnl_gOIdhw16i16o = dnnl_aBCdef16c16b,
617  dnnl_gOIdhw4i16o4i = dnnl_aBCdef4c16b4c,
618  dnnl_gOIdhw2i8o4i = dnnl_aBCdef2c8b4c,
619  dnnl_gOIdhw16o16i = dnnl_aBCdef16b16c,
620  dnnl_gOidhw16o = dnnl_aBcdef16b,
621  dnnl_gOIdhw4i4o = dnnl_aBCdef4c4b,
622  dnnl_gOIdhw4o4i = dnnl_aBCdef4b4c,
623  dnnl_gOidhw4o = dnnl_aBcdef4b,
624  dnnl_gOIdhw8i16o2i = dnnl_aBCdef8c16b2c,
625  dnnl_gOIdhw8i8o = dnnl_aBCdef8c8b,
626  dnnl_gOIdhw8o16i2o = dnnl_aBCdef8b16c2b,
627  dnnl_gIOdhw8o16i2o = dnnl_aCBdef8b16c2b,
628  dnnl_gOIdhw8o8i = dnnl_aBCdef8b8c,
629  dnnl_Goidhw16g = dnnl_Abcdef16a,
631 
633 
638 
640 typedef enum {
641  // TODO: suggest renames
664 
667 typedef enum {
709 
711 typedef enum {
712  dnnl_alg_kind_undef,
799  dnnl_lbr_gru = 0x4fff,
801  dnnl_binary_add = 0x1fff0,
803  dnnl_binary_mul = 0x1fff1,
805  dnnl_binary_max = 0x1fff2,
807  dnnl_binary_min = 0x1fff3,
813 
815 typedef enum {
828 
841 
855 
858 
861 
865 #define DNNL_MAX_NDIMS 12
866 
869 #define DNNL_RUNTIME_DIM_VAL INT64_MIN
870 
874 #define DNNL_RUNTIME_SIZE_VAL ((size_t)DNNL_RUNTIME_DIM_VAL)
875 
878 static const union {
879  unsigned u;
880  float f;
881 } DNNL_RUNTIME_F32_VAL_REP = {0x7fc000d0};
883 
886 #define DNNL_RUNTIME_F32_VAL (DNNL_RUNTIME_F32_VAL_REP.f)
887 
889 static const int DNNL_RUNTIME_S32_VAL_REP = INT32_MIN;
891 
894 #define DNNL_RUNTIME_S32_VAL DNNL_RUNTIME_S32_VAL_REP
895 
897 typedef int64_t dnnl_dim_t;
898 
901 
905 typedef struct {
909  // Innermost section
910  // ASSUMPTION: the innermost blocks are always dense
919 
921 typedef enum {
924  // Tensors of weights for 2x3 winograd convolutions.
928  // Tensor of weights for 4x3 convolution.
931 
933 typedef struct {
934  dnnl_wino_memory_format_t wino_format;
935  int r;
936  int alpha;
937  int ic;
938  int oc;
939  int ic_block;
940  int oc_block;
941  int ic2_block;
942  int oc2_block;
943  float adj_scale;
944  size_t size;
946 
947 typedef enum {
948  dnnl_packed_format_undef = 0,
949  dnnl_ldigo_p,
950  dnnl_ldgoi_p
951 } dnnl_rnn_packed_memory_format_t;
952 
955 #define DNNL_RNN_MAX_N_PARTS 4
956 
958 typedef struct {
959  dnnl_rnn_packed_memory_format_t format;
960  int n_parts;
961  int n;
962  int ldb;
963  int parts[DNNL_RNN_MAX_N_PARTS];
964  size_t part_pack_size[DNNL_RNN_MAX_N_PARTS];
965  unsigned pack_part[DNNL_RNN_MAX_N_PARTS];
966  size_t offset_compensation;
967  size_t size;
968  char reserved[200];
970 
972 typedef enum {
973  dnnl_memory_extra_flag_none = 0x0U,
982  dnnl_memory_extra_flag_scale_adjust = 0x2U,
983  dnnl_memory_extra_flag_gpu_rnn_u8s8_compensation = 0x4U,
985 
987 typedef struct {
990  uint64_t flags;
996  char reserved[64];
998 
1003 typedef struct {
1005  int ndims;
1021 
1024 
1027 
1031 
1035 
1038  union {
1046  // ... other descriptions possible
1047  } format_desc;
1048 
1051 
1054 struct dnnl_memory;
1055 
1057 typedef struct dnnl_memory *dnnl_memory_t;
1058 
1060 typedef const struct dnnl_memory *const_dnnl_memory_t;
1061 
1062 #define DNNL_MEMORY_NONE (NULL)
1063 #define DNNL_MEMORY_ALLOCATE ((void *)(size_t)-1)
1064 
1066 
1071 
1073 typedef void *dnnl_op_desc_t;
1075 typedef const void *const_dnnl_op_desc_t;
1076 
1079 
1082 
1085 
1087 typedef struct {
1121  dnnl_dims_t padding[2];
1125 
1127 
1130 
1133 
1135 
1138 
1140 typedef struct {
1151  int axis;
1155 
1157 
1160 
1162 typedef struct {
1205  float alpha, beta;
1207 
1209 
1212 
1214 typedef struct {
1228 
1230 
1233 
1237 
1239 
1242 
1244 typedef struct {
1271  dnnl_dims_t padding[2];
1275 
1277 
1280 
1282 typedef struct {
1300  float lrn_alpha;
1302  float lrn_beta;
1304  float lrn_k;
1305 } dnnl_lrn_desc_t;
1306 
1308 
1311 
1313 typedef struct {
1330  dnnl_memory_desc_t diff_data_scaleshift_desc;
1337  unsigned flags;
1339 
1341 
1344 
1346 typedef struct {
1365  dnnl_memory_desc_t diff_data_scaleshift_desc;
1374  unsigned flags;
1376 
1378 
1381 
1383 typedef struct {
1410 
1412 
1415 
1417 typedef enum {
1421 
1423 typedef enum {
1437 
1439 typedef struct {
1475 
1500 
1502  unsigned int flags;
1506  float alpha;
1507  float beta;
1508 
1509 } dnnl_rnn_desc_t;
1510 
1512 
1515 
1517 typedef struct {
1526  dnnl_memory_desc_t src_desc[2];
1530 
1532 
1535 
1543 typedef struct {
1558 
1560 
1563 
1565 typedef struct {
1584  float factors[DNNL_MAX_NDIMS];
1586 
1588 
1590 
1593 
1595 typedef enum {
1603 
1606 struct dnnl_engine;
1608 typedef struct dnnl_engine *dnnl_engine_t;
1609 #if 0
1610 // FIXME: looks like this never happens
1612 typedef const struct dnnl_engine *const_dnnl_engine_t;
1613 #endif
1614 
1616 
1621 
1625 
1628 
1630 typedef const struct dnnl_primitive_desc_iterator
1632 
1635 struct dnnl_primitive_desc;
1636 
1639 
1642 
1644 
1647 
1649 typedef enum {
1673 
1679 struct dnnl_primitive_attr;
1680 
1684 
1687 
1706 struct dnnl_post_ops;
1707 
1710 
1712 typedef const struct dnnl_post_ops *const_dnnl_post_ops_t;
1713 
1715 
1718 
1721 struct dnnl_primitive;
1726 
1728 #define DNNL_ARG_SRC_0 1
1729 #define DNNL_ARG_SRC DNNL_ARG_SRC_0
1732 #define DNNL_ARG_SRC_LAYER DNNL_ARG_SRC_0
1735 #define DNNL_ARG_FROM DNNL_ARG_SRC_0
1738 
1740 #define DNNL_ARG_SRC_1 2
1741 #define DNNL_ARG_SRC_ITER DNNL_ARG_SRC_1
1744 
1746 #define DNNL_ARG_SRC_2 3
1747 #define DNNL_ARG_SRC_ITER_C DNNL_ARG_SRC_2
1750 
1752 #define DNNL_ARG_DST_0 17
1753 #define DNNL_ARG_DST DNNL_ARG_DST_0
1756 #define DNNL_ARG_TO DNNL_ARG_DST_0
1759 #define DNNL_ARG_DST_LAYER DNNL_ARG_DST_0
1761 
1763 #define DNNL_ARG_DST_1 18
1764 #define DNNL_ARG_DST_ITER DNNL_ARG_DST_1
1767 
1769 #define DNNL_ARG_DST_2 19
1770 #define DNNL_ARG_DST_ITER_C DNNL_ARG_DST_2
1773 
1775 #define DNNL_ARG_WEIGHTS_0 33
1776 #define DNNL_ARG_WEIGHTS DNNL_ARG_WEIGHTS_0
1779 #define DNNL_ARG_SCALE_SHIFT DNNL_ARG_WEIGHTS_0
1782 #define DNNL_ARG_WEIGHTS_LAYER DNNL_ARG_WEIGHTS_0
1785 
1787 #define DNNL_ARG_WEIGHTS_1 34
1788 #define DNNL_ARG_WEIGHTS_ITER DNNL_ARG_WEIGHTS_1
1791 
1793 #define DNNL_ARG_WEIGHTS_2 35
1794 #define DNNL_ARG_WEIGHTS_PEEPHOLE DNNL_ARG_WEIGHTS_2
1797 
1799 #define DNNL_ARG_BIAS 41
1800 
1802 #define DNNL_ARG_MEAN 49
1803 #define DNNL_ARG_VARIANCE 50
1805 
1808 #define DNNL_ARG_WORKSPACE 64
1809 #define DNNL_ARG_SCRATCHPAD 80
1811 
1813 #define DNNL_ARG_DIFF_SRC_0 129
1814 #define DNNL_ARG_DIFF_SRC DNNL_ARG_DIFF_SRC_0
1817 #define DNNL_ARG_DIFF_SRC_LAYER DNNL_ARG_DIFF_SRC_0
1820 
1822 #define DNNL_ARG_DIFF_SRC_1 130
1823 #define DNNL_ARG_DIFF_SRC_ITER DNNL_ARG_DIFF_SRC_1
1826 
1828 #define DNNL_ARG_DIFF_SRC_2 131
1829 #define DNNL_ARG_DIFF_SRC_ITER_C DNNL_ARG_DIFF_SRC_2
1832 
1834 #define DNNL_ARG_DIFF_DST_0 145
1835 #define DNNL_ARG_DIFF_DST DNNL_ARG_DIFF_DST_0
1838 #define DNNL_ARG_DIFF_DST_LAYER DNNL_ARG_DIFF_DST_0
1841 
1843 #define DNNL_ARG_DIFF_DST_1 146
1844 #define DNNL_ARG_DIFF_DST_ITER DNNL_ARG_DIFF_DST_1
1847 
1849 #define DNNL_ARG_DIFF_DST_2 147
1850 #define DNNL_ARG_DIFF_DST_ITER_C DNNL_ARG_DIFF_DST_2
1853 
1855 #define DNNL_ARG_DIFF_WEIGHTS_0 161
1856 #define DNNL_ARG_DIFF_WEIGHTS DNNL_ARG_DIFF_WEIGHTS_0
1859 #define DNNL_ARG_DIFF_SCALE_SHIFT DNNL_ARG_DIFF_WEIGHTS_0
1862 #define DNNL_ARG_DIFF_WEIGHTS_LAYER DNNL_ARG_DIFF_WEIGHTS_0
1865 
1867 #define DNNL_ARG_DIFF_WEIGHTS_1 162
1868 #define DNNL_ARG_DIFF_WEIGHTS_ITER DNNL_ARG_DIFF_WEIGHTS_1
1871 
1873 #define DNNL_ARG_DIFF_WEIGHTS_2 163
1874 #define DNNL_ARG_DIFF_WEIGHTS_PEEPHOLE DNNL_ARG_DIFF_WEIGHTS_2
1877 
1879 #define DNNL_ARG_DIFF_BIAS 169
1880 
1882 #define DNNL_ARG_ATTR_OUTPUT_SCALES 513
1883 
1886 #define DNNL_ARG_MULTIPLE_SRC 1024
1887 #define DNNL_ARG_MULTIPLE_DST 2048
1890 
1892 #define DNNL_ARG_ATTR_ZERO_POINTS 4096
1893 
1896 #define DNNL_ARG_ATTR_POST_OP_DW 8192
1897 
1900 typedef struct {
1901  int arg;
1903 } dnnl_exec_arg_t;
1904 
1906 
1909 
1939 typedef enum {
1941 
1944 
1947 
1950 
1955 
1958 
1961 
1963 
1964  // memory and op descriptor section
1983 
1984  // memory descriptor section
1995 } dnnl_query_t;
1996 
1998 
2000 
2003 
2005 typedef enum {
2016 
2019 struct dnnl_stream;
2021 typedef struct dnnl_stream *dnnl_stream_t;
2023 typedef const struct dnnl_stream *const_dnnl_stream_t;
2024 
2026 
2029 
2031 #define DNNL_RUNTIME_NONE 0u
2032 
2034 #define DNNL_RUNTIME_SEQ 1u
2035 
2037 #define DNNL_RUNTIME_OMP 2u
2038 
2040 #define DNNL_RUNTIME_TBB 4u
2041 
2043 #define DNNL_RUNTIME_OCL 256u
2044 
2047 typedef struct {
2048  int major;
2049  int minor;
2050  int patch;
2051  const char *hash;
2052  unsigned cpu_runtime;
2053  unsigned gpu_runtime;
2054 } dnnl_version_t;
2055 
2057 #define DNNL_JIT_PROFILE_NONE 0u
2058 
2060 #define DNNL_JIT_PROFILE_VTUNE 1u
2061 
2063 #define DNNL_JIT_PROFILE_LINUX_PERFMAP 2u
2064 
2066 #define DNNL_JIT_PROFILE_LINUX_JITDUMP 4u
2067 
2070 #define DNNL_JIT_PROFILE_LINUX_JITDUMP_USE_TSC 8u
2071 
2073 #define DNNL_JIT_PROFILE_LINUX_PERF \
2074  (DNNL_JIT_PROFILE_LINUX_JITDUMP | DNNL_JIT_PROFILE_LINUX_PERFMAP)
2075 
2077 typedef enum {
2080 
2083 
2086 
2089 
2093 
2097 
2101 
2106 
2111 } dnnl_cpu_isa_t;
2112 
2114 
2116 
2117 #ifdef __cplusplus
2118 }
2119 #endif
2120 
2121 #endif
dnnl_memory_desc_t diff_dst_layer_desc
Destination gradient layer memory descriptor.
Definition: dnnl_types.h:1489
A layer normalization primitive.
Definition: dnnl_types.h:693
destination grad. memory desc
Definition: dnnl_types.h:1991
An element-wise primitive.
Definition: dnnl_types.h:683
dnnl_alg_kind_t activation_kind
Activation function used for vanilla_rnn cell kind.
Definition: dnnl_types.h:1505
dnnl_memory_desc_t weights_layer_desc
Weights layer memory descriptor.
Definition: dnnl_types.h:1458
dnnl_alg_kind_t alg_kind
The kind of pooling algorithm.
Definition: dnnl_types.h:1255
execution engine
Definition: dnnl_types.h:1942
dnnl_memory_desc_t weights_desc
Weights memory descriptor.
Definition: dnnl_types.h:1396
dnnl_memory_desc_t diff_dst_iter_c_desc
Destination gradient iteration memory descriptor for cell state.
Definition: dnnl_types.h:1493
A batch normalization primitive.
Definition: dnnl_types.h:691
Eltwise: bounded_relu.
Definition: dnnl_types.h:738
Undefined memory format tag.
Definition: dnnl_types.h:169
3D tensor blocked by 2nd dimension with block size 16
Definition: dnnl_types.h:210
A tensor in a generic format described by the stride and blocking values in each dimension.
Definition: dnnl_types.h:89
CPU engine.
Definition: dnnl_types.h:1599
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1316
Eltwise: ReLU (dst for backward)
Definition: dnnl_types.h:763
destination memory desc
Definition: dnnl_types.h:1990
Direct deconvolution.
Definition: dnnl_types.h:720
struct dnnl_memory * dnnl_memory_t
A memory handle.
Definition: dnnl_types.h:1057
A descriptor for an RNN operation.
Definition: dnnl_types.h:1439
The user manages the scratchpad allocation by querying and providing the scratchpad memory to primiti...
Definition: dnnl_types.h:1671
layer normalization descriptor
Definition: dnnl_types.h:1975
memory consumption – extra
Definition: dnnl_types.h:1949
dnnl_primitive_kind_t
Kinds of primitives.
Definition: dnnl_types.h:667
permuted 3D tensor
Definition: dnnl_types.h:193
Eltwise: linear.
Definition: dnnl_types.h:736
dnnl_memory_desc_t bias_desc
Bias memory descriptor.
Definition: dnnl_types.h:1400
dnnl_dim_t local_size
The number of channels to sum over (for cross-channel LRN) or the side length of the square region to...
Definition: dnnl_types.h:1298
Internal weights format for 2x3 Winograd.
Definition: dnnl_types.h:926
dnnl_memory_desc_t data_scaleshift_desc
Scale and shift data and gradient memory descriptors.
Definition: dnnl_types.h:1364
void * dnnl_op_desc_t
A pointer to any of the operation descriptors.
Definition: dnnl_types.h:1073
dnnl_alg_kind_t alg_kind
LRN algorithm.
Definition: dnnl_types.h:1291
A resampling primitive.
Definition: dnnl_types.h:707
dnnl_format_kind_t format_kind
Memory format kind.
Definition: dnnl_types.h:1037
An opaque structure to describe a primitive.
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1319
GRU cell with linear before reset.
Definition: dnnl_types.h:799
Any ISA (no restrictions)
Definition: dnnl_types.h:2079
dnnl_dims_t strides
Pooling kernel strides for spatial dimensions.
Definition: dnnl_types.h:1265
4D CNN weights tensor, an alias to dnnl_acdb
Definition: dnnl_types.h:399
Undefined data type, used for empty memory descriptors.
Definition: dnnl_types.h:64
dnnl_memory_desc_t dst_desc
Destination memory descriptor.
Definition: dnnl_types.h:1554
dnnl_dim_t group_size
Number of groups.
Definition: dnnl_types.h:1153
dnnl_memory_desc_t bias_desc
Bias memory descriptor.
Definition: dnnl_types.h:1107
5D CNN weights tensor, an alias to dnnl_acdeb
Definition: dnnl_types.h:409
float scale_adjust
Scale applied to the data.
Definition: dnnl_types.h:994
dnnl_convolution_desc_t dnnl_deconvolution_desc_t
A descriptor of a deconvolution operation.
Definition: dnnl_types.h:1132
4D CNN weights tensor (incl. groups), an alias to dnnl_abcd
Definition: dnnl_types.h:414
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1217
dnnl_alg_kind_t alg_kind
The kind of the convolution algorithm.
Definition: dnnl_types.h:1097
In-order execution.
Definition: dnnl_types.h:2010
dnnl_data_type_t accum_data_type
The accumulator data type. Initialized automatically.
Definition: dnnl_types.h:1123
scratchpad memory desc
Definition: dnnl_types.h:1993
dnnl_memory_desc_t src_desc
Source memory descriptor.
Definition: dnnl_types.h:1576
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1250
dnnl_memory_t memory
Input/output memory.
Definition: dnnl_types.h:1902
const void * const_dnnl_op_desc_t
A pointer to any of the operation descriptors (constant variant).
Definition: dnnl_types.h:1075
Intel(R) SSE4.1.
Definition: dnnl_types.h:2082
Eltwise: clip.
Definition: dnnl_types.h:757
An opaque structure for primitive descriptor attributes.
dnnl_memory_desc_t dst_desc
Destination memory descriptor.
Definition: dnnl_types.h:1111
logsoftmax descriptor
Definition: dnnl_types.h:1980
permuted 4D tensor
Definition: dnnl_types.h:190
dnnl_memory_desc_t src_desc
Source memory descriptor.
Definition: dnnl_types.h:1257
float lrn_alpha
LRN alpha parameter.
Definition: dnnl_types.h:1300
dnnl_memory_desc_t diff_weights_desc
Weights gradient memory descriptor.
Definition: dnnl_types.h:1398
dnnl_memory_desc_t dst_iter_c_desc
Destination iter memory descriptor for cell state.
Definition: dnnl_types.h:1468
Primitive iterator passed over last primitive descriptor.
Definition: dnnl_types.h:49
int minor
Minor version.
Definition: dnnl_types.h:2049
2D CNN weights tensor, an alias to dnnl_ab
Definition: dnnl_types.h:383
An opaque structure to describe a memory.
dnnl_memory_desc_t dst_layer_desc
Destination layer memory descriptor.
Definition: dnnl_types.h:1464
permuted 5D tensor
Definition: dnnl_types.h:191
dnnl_engine_kind_t
Kinds of engines.
Definition: dnnl_types.h:1595
struct dnnl_primitive_desc * dnnl_primitive_desc_t
A primitive descriptor handle.
Definition: dnnl_types.h:1638
Eltwise: square root (dst for backward)
Definition: dnnl_types.h:769
non-standard 16-bit (bfloat16 w/ 7 bit mantissa) floating point.
Definition: dnnl_types.h:68
Undefined primitive.
Definition: dnnl_types.h:669
dnnl_dims_t strides
Convolution strides in each spatial dimension.
Definition: dnnl_types.h:1115
int softmax_axis
The axis along which to perform the softmax.
Definition: dnnl_types.h:1226
Unidirectional execution of RNN primitive from left to right.
Definition: dnnl_types.h:1425
The library manages the scratchpad allocation according to the policy specified by the DNNL_ENABLE_CO...
Definition: dnnl_types.h:1666
5D CNN weights tensor (incl. groups), an alias to dnnl_acbde
Definition: dnnl_types.h:420
3D tensor blocked by 2nd dimension with block size 4
Definition: dnnl_types.h:214
3D CNN activations tensor blocked by channels with block size 8, an alias to dnnl_aBc8b ...
Definition: dnnl_types.h:487
dnnl_dims_t dims
Dimensions in the following order:
Definition: dnnl_types.h:1020
const struct dnnl_memory * const_dnnl_memory_t
A constant memory handle.
Definition: dnnl_types.h:1060
4D CNN activations tensor blocked by channels with block size 16, an alias to dnnl_aBcd16b ...
Definition: dnnl_types.h:472
binary descriptor
Definition: dnnl_types.h:1979
dnnl_memory_desc_t diff_weights_iter_desc
Weights gradient iter memory descriptor.
Definition: dnnl_types.h:1485
Description of tensor of packed weights for rnn.
Definition: dnnl_types.h:958
A descriptor of a pooling operation.
Definition: dnnl_types.h:1244
2D CNN activations tensor, an alias to dnnl_ab
Definition: dnnl_types.h:360
plain 2D tensor
Definition: dnnl_types.h:178
4D CNN activations tensor, an alias to dnnl_bcda
Definition: dnnl_types.h:376
4D RNN bias tensor in the format (num_layers, num_directions, num_gates, output_channels).
Definition: dnnl_types.h:455
permuted 5D tensor
Definition: dnnl_types.h:197
Undefined memory format kind, used for empty memory descriptors.
Definition: dnnl_types.h:82
dnnl_memory_desc_t bias_desc
Bias memory descriptor.
Definition: dnnl_types.h:1552
Bidirectional execution of RNN primitive with summation of the results.
Definition: dnnl_types.h:1433
32-bit signed integer.
Definition: dnnl_types.h:72
dnnl_memory_desc_t diff_src_iter_c_desc
Source gradient iter memory descriptor for cell state.
Definition: dnnl_types.h:1481
int inner_nblks
The number of innermost blocks, e.g. 3 in case of OIhw_4i16o4i_
Definition: dnnl_types.h:912
Direct convolution.
Definition: dnnl_types.h:714
int major
Major version.
Definition: dnnl_types.h:2048
Just a sentinel, not real memory format tag.
Definition: dnnl_types.h:353
5D tensor blocked by 1st dimension with block size 8
Definition: dnnl_types.h:265
An opaque structure to describe a primitive descriptor iterator.
pooling descriptor
Definition: dnnl_types.h:1972
Convolution algorithm(either direct or Winograd) is chosen just in time.
Definition: dnnl_types.h:718
float lrn_beta
LRN beta parameter.
Definition: dnnl_types.h:1302
dnnl_memory_desc_t src_desc
Source memory descriptor.
Definition: dnnl_types.h:1392
Unidirectional execution of RNN primitive from right to left.
Definition: dnnl_types.h:1427
A deconvolution primitive.
Definition: dnnl_types.h:681
dnnl_memory_desc_t src_iter_desc
Source iteration memory descriptor for hidden state.
Definition: dnnl_types.h:1454
5D tensor blocked by 2nd dimension with block size 8
Definition: dnnl_types.h:284
8-bit unsigned integer.
Definition: dnnl_types.h:76
dnnl_alg_kind_t alg_kind
The kind of the binary algorithm.
Definition: dnnl_types.h:1524
A descriptor of a matrix multiplication operation.
Definition: dnnl_types.h:1543
permuted 6D tensor
Definition: dnnl_types.h:202
3D RNN data tensor in the format (batch, seq_length, input channels).
Definition: dnnl_types.h:431
dnnl_alg_kind_t cell_kind
RNN cell kind.
Definition: dnnl_types.h:1448
const char * hash
Git hash of the sources (may be absent)
Definition: dnnl_types.h:2051
5D CNN weights tensor, an alias to dnnl_cdeba
Definition: dnnl_types.h:407
4D CNN activations tensor, an alias to dnnl_acdb
Definition: dnnl_types.h:374
dnnl_query_t
Primitive descriptor query specification.
Definition: dnnl_types.h:1939
Intel(R) Advanced Vector Extensions.
Definition: dnnl_types.h:2085
Intel(R) Advanced Vector Extensions 512 subset for Intel(R) Xeon Phi(TM) Processors 7235...
Definition: dnnl_types.h:2096
dnnl_memory_desc_t weights_desc
Weights memory descriptor.
Definition: dnnl_types.h:1550
Backward data propagation.
Definition: dnnl_types.h:658
dnnl_memory_desc_t stat_desc
Statistics memory descriptor.
Definition: dnnl_types.h:1334
A descriptor of a binary operation.
Definition: dnnl_types.h:1517
source gradient memory desc
Definition: dnnl_types.h:1987
A binary primitive.
Definition: dnnl_types.h:701
Structure containing version information as per Semantic Versioning
Definition: dnnl_types.h:2047
int arg
An argument index, e.g. DNNL_ARG_SRC.
Definition: dnnl_types.h:1901
dnnl_memory_desc_t diff_bias_desc
Bias gradient memory descriptor.
Definition: dnnl_types.h:1402
LSTM cell.
Definition: dnnl_types.h:789
Packed weights format used in RNN.
Definition: dnnl_types.h:93
4D CNN weights tensor, an alias to dnnl_bcda
Definition: dnnl_types.h:401
4D tensor blocked by 2nd dimension with block size 16
Definition: dnnl_types.h:230
A reorder primitive.
Definition: dnnl_types.h:671
dnnl_memory_desc_t weights_desc
Weights memory descriptor.
Definition: dnnl_types.h:1103
A descriptor of a convolution operation.
Definition: dnnl_types.h:1087
2D CNN activations tensor, an alias to dnnl_ba
Definition: dnnl_types.h:362
dnnl_data_type_t accum_data_type
The accumulator data type. Initialized automatically.
Definition: dnnl_types.h:1408
softmax descriptor
Definition: dnnl_types.h:1971
Intel(R) Advanced Vector Extensions 512 for Intel(R) Xeon(R) Processor Scalable Family and Intel(R) C...
Definition: dnnl_types.h:2100
no query
Definition: dnnl_types.h:1940
dnnl_scratchpad_mode_t
Scratchpad mode.
Definition: dnnl_types.h:1649
Fuse with ReLU.
Definition: dnnl_types.h:853
batch normalization descriptor
Definition: dnnl_types.h:1974
dnnl_dims_t padded_dims
Size of the data including padding in each dimension.
Definition: dnnl_types.h:1026
dnnl_dim_t offset0
Offset from memory origin to the current block, non-zero only in a description of a memory sub-block...
Definition: dnnl_types.h:1034
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1568
5D CNN weights tensor, an alias to dnnl_abcde
Definition: dnnl_types.h:405
dnnl_dims_t padded_offsets
Per-dimension offset from the padding to actual data, the top-level tensor with offsets applied must ...
Definition: dnnl_types.h:1030
Undefined memory format, used for empty memory descriptors.
Definition: dnnl_types.h:923
runtime estimation (seconds)
Definition: dnnl_types.h:1948
Backward propagation (with respect to all parameters).
Definition: dnnl_types.h:656
An unspecified engine.
Definition: dnnl_types.h:1597
5D tensor blocked by 1st dimension with block size 16
Definition: dnnl_types.h:263
Eltwise: ReLU.
Definition: dnnl_types.h:724
GPU engine.
Definition: dnnl_types.h:1601
dnnl_memory_desc_t dst_desc
Destination memory descriptor.
Definition: dnnl_types.h:1528
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1520
4D RNN states tensor in the format (num_layers, num_directions, batch, state channels).
Definition: dnnl_types.h:434
5D RNN weights tensor in the format (num_layers, num_directions, input_channels, num_gates, output_channels).
Definition: dnnl_types.h:441
6D CNN weights tensor (incl. groups), an alias to dnnl_acbdef
Definition: dnnl_types.h:424
(scratch) memory, additional to all inputs and outputs memory (bytes)
Definition: dnnl_types.h:1954
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1445
Eltwise: pow.
Definition: dnnl_types.h:759
5D tensor blocked by 2nd dimension with block size 4
Definition: dnnl_types.h:274
dnnl_memory_extra_flags_t
Flags for memory special features.
Definition: dnnl_types.h:972
5D RNN weights tensor in the format (num_layers, num_directions, num_gates, output_channels, input_channels).
Definition: dnnl_types.h:448
permuted 4D tensor
Definition: dnnl_types.h:199
An opaque structure to describe an engine.
dnnl_memory_desc_t data_desc
Source and destination memory descriptor.
Definition: dnnl_types.h:1293
dnnl_memory_desc_t src_desc
Source memory descriptor.
Definition: dnnl_types.h:1548
dnnl_memory_desc_t src_desc
Source memory descriptor.
Definition: dnnl_types.h:1099
6D CNN weights tensor (incl. groups), an alias to dnnl_abcdef
Definition: dnnl_types.h:422
Forward data propagation (inference mode).
Definition: dnnl_types.h:650
dnnl_memory_desc_t data_desc
Source and destination memory descriptor.
Definition: dnnl_types.h:1354
Undefined RNN flags.
Definition: dnnl_types.h:1419
A sum primitive.
Definition: dnnl_types.h:677
unsigned cpu_runtime
CPU runtime.
Definition: dnnl_types.h:2052
5D CNN weights tensor (incl. groups), an alias to dnnl_decab
Definition: dnnl_types.h:418
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1168
Intel(R) Advanced Vector Extensions 512 subset for Intel(R) Xeon Phi(TM) Processors x200 Series...
Definition: dnnl_types.h:2092
dnnl_memory_desc_t data_desc
Source and destination memory descriptor.
Definition: dnnl_types.h:1222
dnnl_memory_desc_t diff_data_desc
Source and destination gradient memory descriptor.
Definition: dnnl_types.h:1356
A descriptor of a element-wise operation.
Definition: dnnl_types.h:1162
dnnl_dims_t inner_blks
The size of the blocks, e.g. {4, 16, 4} in case of OIhw_4i16o4i
Definition: dnnl_types.h:914
A descriptor of a Softmax operation.
Definition: dnnl_types.h:1214
An opaque structure for a chain of post operations.
A descriptor of an inner product operation.
Definition: dnnl_types.h:1383
The operation failed because of incorrect function arguments.
Definition: dnnl_types.h:45
3D RNN data tensor in the format (seq_length, batch, input channels).
Definition: dnnl_types.h:429
dnnl_rnn_direction_t
A direction of RNN primitive execution.
Definition: dnnl_types.h:1423
Internal weights format for 2x3 Winograd.
Definition: dnnl_types.h:925
inner product descriptor
Definition: dnnl_types.h:1976
5D tensor blocked by 2nd dimension with block size 16
Definition: dnnl_types.h:267
6D tensor blocked by 2nd dimension with block size 4
Definition: dnnl_types.h:304
dnnl_status_t
Status values returned by the library functions.
Definition: dnnl_types.h:39
dnnl_memory_desc_t dst_desc
Destination memory descriptor.
Definition: dnnl_types.h:1261
Binary mul.
Definition: dnnl_types.h:803
dnnl_memory_desc_t dst_iter_desc
Destination iter memory descriptor for hidden state.
Definition: dnnl_types.h:1466
A softmax primitive.
Definition: dnnl_types.h:685
const struct dnnl_primitive_desc * const_dnnl_primitive_desc_t
A constant primitive descriptor handle.
Definition: dnnl_types.h:1641
int64_t dnnl_dim_t
A type to describe tensor dimension.
Definition: dnnl_types.h:897
Forward data propagation (alias for dnnl_forward_training).
Definition: dnnl_types.h:654
primitive kind
Definition: dnnl_types.h:1943
matrix multiplication (matmul) descriptor
Definition: dnnl_types.h:1981
Default stream configuration.
Definition: dnnl_types.h:2014
dnnl_memory_desc_t dst_desc
Destination memory descriptor.
Definition: dnnl_types.h:1404
dnnl_memory_desc_t stat_desc
Mean and variance data memory descriptors.
Definition: dnnl_types.h:1371
const struct dnnl_primitive * const_dnnl_primitive_t
A constant primitive handle.
Definition: dnnl_types.h:1725
LRN within a single channel.
Definition: dnnl_types.h:785
dnnl_data_type_t
Data type specification.
Definition: dnnl_types.h:62
plain 4D tensor
Definition: dnnl_types.h:180
Generic description of blocked data layout for most memory formats.
Definition: dnnl_types.h:905
plain 6D tensor
Definition: dnnl_types.h:182
Eltwise: exp (dst for backward)
Definition: dnnl_types.h:773
Winograd convolution.
Definition: dnnl_types.h:716
dnnl_wino_desc_t wino_desc
Tensor of weights for integer 8bit winograd convolution.
Definition: dnnl_types.h:1043
dnnl_alg_kind_t alg_kind
The kind of eltwise algorithm.
Definition: dnnl_types.h:1181
dnnl_format_tag_t
Memory format tag specification.
Definition: dnnl_types.h:164
Max pooling.
Definition: dnnl_types.h:775
Eltwise: natural logarithm.
Definition: dnnl_types.h:755
dnnl_memory_desc_t dst_desc
Destination memory descriptor.
Definition: dnnl_types.h:1580
float batch_norm_epsilon
Batch normalization epsilon parameter.
Definition: dnnl_types.h:1336
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1352
Description of tensor of weights for winograd 2x3 convolution.
Definition: dnnl_types.h:933
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1220
4D CNN activations tensor blocked by channels with block size 4, an alias to dnnl_aBcd4b ...
Definition: dnnl_types.h:475
dnnl_memory_desc_t bias_desc
Bias memory descriptor.
Definition: dnnl_types.h:1462
3D CNN weights tensor, an alias to dnnl_cba
Definition: dnnl_types.h:391
4D tensor blocked by 2nd dimension with block size 8
Definition: dnnl_types.h:248
Out-of-order execution.
Definition: dnnl_types.h:2012
Binary min.
Definition: dnnl_types.h:807
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1285
dnnl_format_kind_t
Memory format kind.
Definition: dnnl_types.h:80
permuted 3D tensor
Definition: dnnl_types.h:187
5D CNN activations tensor blocked by channels with block size 4, an alias to dnnl_aBcde4b ...
Definition: dnnl_types.h:466
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1442
Average pooling (alias for dnnl_pooling_avg_exclude_padding)
Definition: dnnl_types.h:781
dnnl_memory_desc_t diff_src_layer_desc
Source gradient layer memory descriptor.
Definition: dnnl_types.h:1477
int axis
Axis for shuffling.
Definition: dnnl_types.h:1151
dnnl_rnn_packed_desc_t rnn_packed_desc
Tensor of packed weights for RNN.
Definition: dnnl_types.h:1045
3D tensor blocked by 2nd dimension with block size 8
Definition: dnnl_types.h:221
Binary add.
Definition: dnnl_types.h:801
3D CNN activations tensor, an alias to dnnl_abc
Definition: dnnl_types.h:368
deconvolution descriptor
Definition: dnnl_types.h:1968
A pooling primitive.
Definition: dnnl_types.h:687
dnnl_dims_t strides
The strides between the outermost blocks.
Definition: dnnl_types.h:908
rnn descriptor
Definition: dnnl_types.h:1977
dnnl_memory_desc_t placeholder_desc
Placeholders.
Definition: dnnl_types.h:1474
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1090
Eltwise: logistic.
Definition: dnnl_types.h:742
A descriptor of a shuffle operation.
Definition: dnnl_types.h:1140
const struct dnnl_primitive_desc_iterator * const_dnnl_primitive_desc_iterator_t
A constant primitive descriptor iterator handle.
Definition: dnnl_types.h:1630
dnnl_dims_t kernel
Pooling kernel spatial dimensions.
Definition: dnnl_types.h:1267
Eltwise: hyperbolic tangent non-linearity (tanh) (dst for backward)
Definition: dnnl_types.h:765
Winograd deconvolution.
Definition: dnnl_types.h:722
number of outputs expected
Definition: dnnl_types.h:1946
#define DNNL_MAX_NDIMS
Maximum number of dimensions a tensor can have.
Definition: dnnl_types.h:865
5D CNN weights tensor (incl. groups), an alias to dnnl_abcde
Definition: dnnl_types.h:416
dnnl_memory_desc_t diff_src_desc
Source gradient memory descriptor.
Definition: dnnl_types.h:1394
float lrn_k
LRN k parameter.
Definition: dnnl_types.h:1304
dnnl_rnn_direction_t direction
The direction of RNN primitive execution.
Definition: dnnl_types.h:1450
6D CNN weights tensor (incl. groups), an alias to dnnl_defcab
Definition: dnnl_types.h:426
GEMM descriptor (internal)
Definition: dnnl_types.h:1978
plain 1D tensor
Definition: dnnl_types.h:177
Bidirectional execution of RNN primitive with concatenation of the results.
Definition: dnnl_types.h:1430
permuted 2D tensor
Definition: dnnl_types.h:192
permuted 5D tensor
Definition: dnnl_types.h:201
permuted 6D tensor
Definition: dnnl_types.h:189
dnnl_memory_desc_t src_iter_c_desc
Source iteration memory descriptor for cell state.
Definition: dnnl_types.h:1456
stub
Definition: dnnl_types.h:1965
dnnl_memory_desc_t diff_desc
Source and Destination of gradient memory descriptor.
Definition: dnnl_types.h:1224
3D CNN weights tensor, an alias to dnnl_bca
Definition: dnnl_types.h:393
5D CNN activations tensor blocked by channels with block size 8, an alias to dnnl_aBcde8b ...
Definition: dnnl_types.h:469
propagation kind
Definition: dnnl_types.h:1962
An inner product primitive.
Definition: dnnl_types.h:695
Use global statistics.
Definition: dnnl_types.h:827
GRU cell.
Definition: dnnl_types.h:791
3D CNN activations tensor, an alias to dnnl_acb
Definition: dnnl_types.h:370
The operation was successful.
Definition: dnnl_types.h:41
A descriptor of a Layer Normalization operation.
Definition: dnnl_types.h:1346
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1143
8-bit signed integer.
Definition: dnnl_types.h:74
convolution descriptor
Definition: dnnl_types.h:1967
dnnl_memory_desc_t weights_peephole_desc
Weights peephole memory descriptor This memory descriptor is equal to zero memory descriptor in case ...
Definition: dnnl_types.h:1472
RNN cell.
Definition: dnnl_types.h:787
Alias for dnnl_unidirectional_left2right.
Definition: dnnl_types.h:1435
A (out-of-place) concat primitive.
Definition: dnnl_types.h:675
Internal weights format for 2x3 Winograd.
Definition: dnnl_types.h:927
dnnl_dims_t dilates
Convolution dilates in each spatial dimension.
Definition: dnnl_types.h:1117
const struct dnnl_stream * const_dnnl_stream_t
A constant execution stream handle.
Definition: dnnl_types.h:2023
2D RNN statistics tensor, an alias to dnnl_ba
Definition: dnnl_types.h:366
5D CNN activations tensor, an alias to dnnl_acdeb
Definition: dnnl_types.h:380
Intel(R) Advanced Vector Extensions 512 with Intel(R) DL Boost Support for Intel(R) Xeon(R) Processor...
Definition: dnnl_types.h:2105
Undefined memory format tag.
Definition: dnnl_types.h:166
permuted 5D tensor
Definition: dnnl_types.h:188
Eltwise: square root.
Definition: dnnl_types.h:734
dnnl_memory_desc_t data_desc
Source and destination memory descriptor.
Definition: dnnl_types.h:1321
int patch
Patch version.
Definition: dnnl_types.h:2050
permuted 3D tensor
Definition: dnnl_types.h:195
dnnl_memory_desc_t diff_data_desc
Source and destination gradient memory descriptor.
Definition: dnnl_types.h:1295
source memory desc
Definition: dnnl_types.h:1986
Eltwise: swish.
Definition: dnnl_types.h:753
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1288
#define DNNL_RNN_MAX_N_PARTS
Maximum number of parts of RNN weights tensor that require separate computation.
Definition: dnnl_types.h:955
Memory descriptor.
Definition: dnnl_types.h:1003
dnnl_wino_memory_format_t
Winograd-specific formats.
Definition: dnnl_types.h:921
2D RNN statistics tensor, an alias to dnnl_ab
Definition: dnnl_types.h:364
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1349
dnnl_data_type_t data_type
Data type of the tensor elements.
Definition: dnnl_types.h:1023
A matrix multiplication primitive.
Definition: dnnl_types.h:705
Queried element is not required for given primitive.
Definition: dnnl_types.h:53
dnnl_data_type_t accum_data_type
The accumulator data type. Initialized automatically.
Definition: dnnl_types.h:1273
Eltwise: erf-based gelu.
Definition: dnnl_types.h:761
Indicates the weights have an additional buffer, that depends on the compensation_mask.
Definition: dnnl_types.h:981
dnnl_blocking_desc_t blocking
Description of the data layout for memory formats that use blocking.
Definition: dnnl_types.h:1041
dnnl_dims_t inner_idxs
The logical indices of the blocks, e.g.
Definition: dnnl_types.h:917
The operation failed due to an out-of-memory condition.
Definition: dnnl_types.h:43
Backward weights propagation.
Definition: dnnl_types.h:660
3D CNN weights tensor, an alias to dnnl_acb
Definition: dnnl_types.h:389
dnnl_memory_desc_t diff_weights_desc
Weights gradient memory descriptor.
Definition: dnnl_types.h:1105
Default order execution.
Definition: dnnl_types.h:2008
dnnl_memory_desc_t data_scaleshift_desc
Scale and shift data and gradient memory descriptors.
Definition: dnnl_types.h:1329
workspace memory desc
Definition: dnnl_types.h:1992
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1546
dnnl_memory_desc_t diff_dst_desc
Destination gradient memory descriptor.
Definition: dnnl_types.h:1113
eltwise descriptor
Definition: dnnl_types.h:1970
number of inputs expected
Definition: dnnl_types.h:1945
shuffle descriptor
Definition: dnnl_types.h:1969
Average pooling include padding.
Definition: dnnl_types.h:777
dnnl_memory_desc_t diff_data_desc
Source and destination gradient memory descriptor.
Definition: dnnl_types.h:1323
Weights format used in 8bit Winograd convolution.
Definition: dnnl_types.h:91
dnnl_memory_desc_t diff_src_desc
Source gradient memory descriptor.
Definition: dnnl_types.h:1578
32-bit/single-precision floating point.
Definition: dnnl_types.h:70
permuted 5D tensor
Definition: dnnl_types.h:200
A structure that contains an index and a memory object, and is used to pass arguments to dnnl_primiti...
Definition: dnnl_types.h:1900
Intel(R) Advanced Vector Extensions 512 with Intel(R) DL Boost and Bfloat16 Support for Intel(R) Xeon...
Definition: dnnl_types.h:2110
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1571
4D CNN activations tensor blocked by channels with block size 8, an alias to dnnl_aBcd8b ...
Definition: dnnl_types.h:478
struct dnnl_primitive_attr * dnnl_primitive_attr_t
A primitive descriptor attributes handle that controls primitive behavior.
Definition: dnnl_types.h:1683
lrn descriptor
Definition: dnnl_types.h:1973
dnnl_memory_desc_t src_layer_desc
Source layer memory descriptor.
Definition: dnnl_types.h:1452
dnnl_memory_desc_t diff_dst_desc
Destination gradient memory descriptor.
Definition: dnnl_types.h:1582
4D tensor blocked by 1st and 2nd dimension with block size 8
Definition: dnnl_types.h:253
A shuffle primitive.
Definition: dnnl_types.h:673
for creating scratchpad memory
Definition: dnnl_types.h:1957
float layer_norm_epsilon
Layer normalization epsilon parameter.
Definition: dnnl_types.h:1373
dnnl_memory_desc_t diff_weights_peephole_desc
Weights gradient peephole memory descriptor This memory descriptor is equal to zero memory descriptor...
Definition: dnnl_types.h:1497
struct dnnl_engine * dnnl_engine_t
An engine handle.
Definition: dnnl_types.h:1608
unsigned int flags
RNN cell flags.
Definition: dnnl_types.h:1502
permuted 4D tensor
Definition: dnnl_types.h:196
4D tensor blocked by 2nd dimension with block size 4
Definition: dnnl_types.h:236
Binary max.
Definition: dnnl_types.h:805
Unspecified format kind.
Definition: dnnl_types.h:85
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1146
2D CNN weights tensor, an alias to dnnl_ba
Definition: dnnl_types.h:385
Average pooling exclude padding.
Definition: dnnl_types.h:779
3D CNN activations tensor blocked by channels with block size 16, an alias to dnnl_aBc16b ...
Definition: dnnl_types.h:481
dnnl_alg_kind_t
Kinds of algorithms.
Definition: dnnl_types.h:711
4D CNN weights tensor, an alias to dnnl_cdba
Definition: dnnl_types.h:397
permuted 3D tensor
Definition: dnnl_types.h:198
dnnl_rnn_flags_t
Flags for RNN cell.
Definition: dnnl_types.h:1417
uint64_t flags
The flags contain arbitrary extra information, such as compensation.
Definition: dnnl_types.h:990
dnnl_memory_desc_t diff_dst_iter_desc
Destination gradient iteration memory descriptor for hidden state.
Definition: dnnl_types.h:1491
Description of extra information stored in memory.
Definition: dnnl_types.h:987
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1390
An LRN primitive.
Definition: dnnl_types.h:689
A descriptor of a Local Response Normalization (LRN) operation.
Definition: dnnl_types.h:1282
dnnl_softmax_desc_t dnnl_logsoftmax_desc_t
A descriptor of a LogSoftmax operation.
Definition: dnnl_types.h:1236
int ndims
Number of dimensions.
Definition: dnnl_types.h:1005
dnnl_stream_flags_t
Stream flags.
Definition: dnnl_types.h:2005
dnnl_dim_t dnnl_dims_t[DNNL_MAX_NDIMS]
A type to describe tensor dimensions.
Definition: dnnl_types.h:900
Undefined propagation type.
Definition: dnnl_types.h:643
dnnl_memory_desc_t diff_data_desc
Source and destination gradient memory descriptor.
Definition: dnnl_types.h:1185
Primitive or engine failed on execution.
Definition: dnnl_types.h:51
op descriptor
Definition: dnnl_types.h:1966
6D tensor blocked by 2nd dimension with block size 8
Definition: dnnl_types.h:302
dnnl_memory_desc_t weights_iter_desc
Weights iteration memory descriptor.
Definition: dnnl_types.h:1460
const struct dnnl_post_ops * const_dnnl_post_ops_t
A constant post operation chain handle.
Definition: dnnl_types.h:1712
Eltwise: exponent.
Definition: dnnl_types.h:744
1D tensor, an alias to dnnl_a
Definition: dnnl_types.h:358
Local response normalization (LRN) across multiple channels.
Definition: dnnl_types.h:783
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1247
resampling descriptor
Definition: dnnl_types.h:1982
const struct dnnl_primitive_attr * const_dnnl_primitive_attr_t
A constant primitive descriptor attributes handle.
Definition: dnnl_types.h:1686
A matrix multiplication primitive (internal).
Definition: dnnl_types.h:699
dnnl_memory_desc_t diff_bias_desc
Bias gradient memory descriptor.
Definition: dnnl_types.h:1487
plain 3D tensor
Definition: dnnl_types.h:179
Use scale and shift parameters.
Definition: dnnl_types.h:840
A descriptor of a Batch Normalization operation.
Definition: dnnl_types.h:1313
5D CNN weights tensor, an alias to dnnl_bcdea
Definition: dnnl_types.h:411
struct dnnl_primitive * dnnl_primitive_t
A primitive handle.
Definition: dnnl_types.h:1723
Intel(R) Advanced Vector Extensions 2.
Definition: dnnl_types.h:2088
3D CNN activations tensor blocked by channels with block size 4, an alias to dnnl_aBc4b ...
Definition: dnnl_types.h:484
struct dnnl_stream * dnnl_stream_t
An execution stream handle.
Definition: dnnl_types.h:2021
4D CNN weights tensor, an alias to dnnl_bacd
Definition: dnnl_types.h:403
Eltwise: exponential linear unit (elu) (dst for backward)
Definition: dnnl_types.h:767
Eltwise: exponential linear unit (elu)
Definition: dnnl_types.h:728
Forward data propagation (alias for dnnl_forward_inference).
Definition: dnnl_types.h:652
6D tensor blocked by 2nd dimension with block size 16
Definition: dnnl_types.h:297
5D CNN activations tensor blocked by channels with block size 16, an alias to dnnl_aBcde16b ...
Definition: dnnl_types.h:463
dnnl_memory_desc_t diff_placeholder_desc
Placeholders.
Definition: dnnl_types.h:1499
An opaque structure to describe a primitive descriptor.
dnnl_prop_kind_t prop_kind
The kind of propagation.
Definition: dnnl_types.h:1094
struct dnnl_primitive_desc_iterator * dnnl_primitive_desc_iterator_t
A primitive descriptor iterator handle.
Definition: dnnl_types.h:1627
Eltwise: abs.
Definition: dnnl_types.h:732
dnnl_memory_desc_t data_desc
Source and destination memory descriptor.
Definition: dnnl_types.h:1183
Internal weights format for 4x3 Winograd.
Definition: dnnl_types.h:929
Forward data propagation (training mode).
Definition: dnnl_types.h:646
permuted 5D tensor
Definition: dnnl_types.h:186
dnnl_memory_desc_t data_desc
Source and destination memory descriptor, and source and destination gradient memory descriptor...
Definition: dnnl_types.h:1149
Eltwise: tanh-based gelu (alias for dnnl_eltwise_gelu_tanh)
Definition: dnnl_types.h:751
dnnl_memory_desc_t diff_src_desc
Source gradient memory descriptor.
Definition: dnnl_types.h:1101
A rnn primitive.
Definition: dnnl_types.h:697
An opaque structure to describe an execution stream.
4D CNN activations tensor, an alias to dnnl_abcd
Definition: dnnl_types.h:372
A logsoftmax primitive.
Definition: dnnl_types.h:703
The operation failed because requested functionality is not implemented.
Definition: dnnl_types.h:47
Eltwise: gelu.
Definition: dnnl_types.h:749
dnnl_data_type_t accum_data_type
The accumulator data type. Initialized automatically.
Definition: dnnl_types.h:1556
dnnl_memory_desc_t diff_src_iter_desc
Source gradient iter memory descriptor for hidden state.
Definition: dnnl_types.h:1479
dnnl_memory_desc_t diff_src_desc
Source gradient memory descriptor.
Definition: dnnl_types.h:1259
Eltwise: hyperbolic tangent non-linearity (tanh)
Definition: dnnl_types.h:726
struct dnnl_post_ops * dnnl_post_ops_t
A post operation chain handle.
Definition: dnnl_types.h:1709
A descriptor of resampling operation.
Definition: dnnl_types.h:1565
dnnl_memory_desc_t diff_dst_desc
Destination gradient memory descriptor.
Definition: dnnl_types.h:1263
dnnl_prop_kind_t
Kinds of propagation.
Definition: dnnl_types.h:640
stub
Definition: dnnl_types.h:1985
Nearest Neighbor Resampling Method.
Definition: dnnl_types.h:809
permuted 4D tensor
Definition: dnnl_types.h:194
dnnl_memory_desc_t diff_dst_desc
Destination gradient memory descriptor.
Definition: dnnl_types.h:1406
16-bit/half-precision floating point.
Definition: dnnl_types.h:66
source engine
Definition: dnnl_types.h:1959
dnnl_memory_desc_t diff_bias_desc
Bias gradient memory descriptor.
Definition: dnnl_types.h:1109
dnnl_alg_kind_t alg_kind
The kind of the resampling algorithm.
Definition: dnnl_types.h:1574
dnnl_normalization_flags_t
Flags for batch normalization primitive.
Definition: dnnl_types.h:815
weights grad. memory desc
Definition: dnnl_types.h:1989
A convolution primitive.
Definition: dnnl_types.h:679
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1165
memory desc of an execute argument
Definition: dnnl_types.h:1994
Backward bias propagation.
Definition: dnnl_types.h:662
5D CNN activations tensor, an alias to dnnl_abcde
Definition: dnnl_types.h:378
4D CNN weights tensor, an alias to dnnl_abcd
Definition: dnnl_types.h:395
Eltwise: logistic (dst for backward)
Definition: dnnl_types.h:771
dnnl_memory_desc_t diff_weights_layer_desc
Weights gradient layer memory descriptor.
Definition: dnnl_types.h:1483
weights memory descriptor desc
Definition: dnnl_types.h:1988
unsigned gpu_runtime
GPU runtime.
Definition: dnnl_types.h:2053
Linear Resampling Method.
Definition: dnnl_types.h:811
3D CNN weights tensor, an alias to dnnl_abc
Definition: dnnl_types.h:387
dnnl_cpu_isa_t
CPU instruction set flags.
Definition: dnnl_types.h:2077
int compensation_mask
Compensation mask.
Definition: dnnl_types.h:992
Eltwise: soft_relu.
Definition: dnnl_types.h:740
plain 5D tensor
Definition: dnnl_types.h:181
destination engine
Definition: dnnl_types.h:1960
dnnl_primitive_kind_t primitive_kind
The kind of primitive.
Definition: dnnl_types.h:1386
Eltwise: square.
Definition: dnnl_types.h:730
float alpha
Algorithm specific parameter.
Definition: dnnl_types.h:1205