mxnet
Classes | Macros | Typedefs | Enumerations | Functions
Dnnl_api_memory
Collaboration diagram for Dnnl_api_memory:

Classes

struct  dnnl_blocking_desc_t
 
struct  dnnl_wino_desc_t
 Description of tensor of weights for winograd 2x3 convolution. More...
 
struct  dnnl_rnn_packed_desc_t
 Description of tensor of packed weights for rnn. More...
 
struct  dnnl_memory_extra_desc_t
 Description of extra information stored in memory. More...
 
struct  dnnl_memory_desc_t
 
struct  dnnl_memory
 

Macros

#define DNNL_MAX_NDIMS   12
 
#define DNNL_RUNTIME_DIM_VAL   INT64_MIN
 
#define DNNL_RUNTIME_SIZE_VAL   ((size_t)DNNL_RUNTIME_DIM_VAL)
 
#define DNNL_RUNTIME_F32_VAL   (DNNL_RUNTIME_F32_VAL_REP.f)
 
#define DNNL_RUNTIME_S32_VAL   DNNL_RUNTIME_S32_VAL_REP
 
#define DNNL_RNN_MAX_N_PARTS   4
 
#define DNNL_MEMORY_NONE   (NULL)
 
#define DNNL_MEMORY_ALLOCATE   ((void *)(size_t)-1)
 

Typedefs

typedef int64_t dnnl_dim_t
 A type to describe tensor dimension. More...
 
typedef dnnl_dim_t dnnl_dims_t[DNNL_MAX_NDIMS]
 A type to describe tensor dimensions. More...
 
typedef struct dnnl_memorydnnl_memory_t
 A memory handle. More...
 
typedef const struct dnnl_memoryconst_dnnl_memory_t
 A constant memory handle. More...
 

Enumerations

enum  dnnl_data_type_t {
  dnnl_data_type_undef = 0, dnnl_f16 = 1, dnnl_bf16 = 2, dnnl_f32 = 3,
  dnnl_s32 = 4, dnnl_s8 = 5, dnnl_u8 = 6
}
 Data type specification. More...
 
enum  dnnl_format_kind_t {
  dnnl_format_kind_undef = 0, dnnl_format_kind_any, dnnl_blocked, dnnl_format_kind_wino,
  dnnl_format_kind_rnn_packed
}
 Memory format kind. More...
 
enum  dnnl_format_tag_t {
  dnnl_format_tag_undef = 0, dnnl_format_tag_any, dnnl_a, dnnl_ab,
  dnnl_abc, dnnl_abcd, dnnl_abcde, dnnl_abcdef,
  dnnl_abdc, dnnl_abdec, dnnl_acb, dnnl_acbde,
  dnnl_acbdef, dnnl_acdb, dnnl_acdeb, dnnl_ba,
  dnnl_bac, dnnl_bacd, dnnl_bacde, dnnl_bca,
  dnnl_bcda, dnnl_bcdea, dnnl_cba, dnnl_cdba,
  dnnl_dcab, dnnl_cdeba, dnnl_decab, dnnl_defcab,
  dnnl_Abc16a, dnnl_ABc16a16b, dnnl_ABc32a32b, dnnl_ABc4a4b,
  dnnl_aBc16b, dnnl_ABc16b16a, dnnl_Abc4a, dnnl_aBc32b,
  dnnl_aBc4b, dnnl_ABc4b16a4b, dnnl_ABc2b8a4b, dnnl_ABc16b16a4b,
  dnnl_ABc16b16a2b, dnnl_ABc4b4a, dnnl_ABc8a16b2a, dnnl_ABc8a8b,
  dnnl_ABc8a4b, dnnl_aBc8b, dnnl_ABc8b16a2b, dnnl_BAc8a16b2a,
  dnnl_ABc8b8a, dnnl_Abcd16a, dnnl_Abcd8a, dnnl_ABcd16a16b,
  dnnl_Abcd32a, dnnl_ABcd32a32b, dnnl_aBcd16b, dnnl_ABcd16b16a,
  dnnl_aBCd16b16c, dnnl_aBCd16c16b, dnnl_Abcd4a, dnnl_aBcd32b,
  dnnl_aBcd4b, dnnl_ABcd4b16a4b, dnnl_ABcd16b16a4b, dnnl_ABcd16b16a2b,
  dnnl_ABcd4b4a, dnnl_ABcd4a4b, dnnl_aBCd2c4b2c, dnnl_aBCd4b8c2b,
  dnnl_aBCd4c16b4c, dnnl_aBCd2c8b4c, dnnl_aBCd16c16b4c, dnnl_aBCd16c16b2c,
  dnnl_aBCd4c4b, dnnl_aBCd4b4c, dnnl_ABcd8a16b2a, dnnl_ABcd2b8a4b,
  dnnl_ABcd8a8b, dnnl_ABcd8a4b, dnnl_aBcd8b, dnnl_aBCd4c8b2c,
  dnnl_ABcd8b16a2b, dnnl_aBCd8b16c2b, dnnl_BAcd8a16b2a, dnnl_ABcd8b8a,
  dnnl_aBCd8b8c, dnnl_aBCd8b4c, dnnl_aBCd8c16b2c, dnnl_ABcde8a16b2a,
  dnnl_aCBd8b16c2b, dnnl_aBCd8c8b, dnnl_Abcde16a, dnnl_Abcde32a,
  dnnl_ABcde16a16b, dnnl_BAcde8a16b2a, dnnl_aBCd2b4c2b, dnnl_ABcde4b16a4b,
  dnnl_ABcde2b8a4b, dnnl_aBcde16b, dnnl_ABcde16b16a, dnnl_aBCde16b16c,
  dnnl_aBCde16c16b, dnnl_aBCde2c8b4c, dnnl_Abcde4a, dnnl_aBcde32b,
  dnnl_aBcde4b, dnnl_ABcde4b4a, dnnl_ABcde4a4b, dnnl_aBCde4b4c,
  dnnl_aBCde2c4b2c, dnnl_aBCde4b8c2b, dnnl_aBCde4c16b4c, dnnl_aBCde16c16b4c,
  dnnl_aBCde16c16b2c, dnnl_aBCde4c4b, dnnl_Abcde8a, dnnl_ABcde8a8b,
  dnnl_ABcde8a4b, dnnl_BAcde16b16a, dnnl_aBcde8b, dnnl_ABcde8b16a2b,
  dnnl_aBCde8b16c2b, dnnl_aBCde4c8b2c, dnnl_aCBde8b16c2b, dnnl_ABcde8b8a,
  dnnl_ABcde32a32b, dnnl_aBCde8b8c, dnnl_aBCde8b4c, dnnl_ABc4a8b8a4b,
  dnnl_ABcd4a8b8a4b, dnnl_ABcde4a8b8a4b, dnnl_BAc4b8a8b4a, dnnl_BAcd4b8a8b4a,
  dnnl_BAcde4b8a8b4a, dnnl_ABcd2a8b8a2b, dnnl_aBCd4b8c8b4c, dnnl_aBCde4b8c8b4c,
  dnnl_aBCde2b8c8b2c, dnnl_aBCde8c16b2c, dnnl_aBCde8c8b, dnnl_aBCde2b4c2b,
  dnnl_aBcdef16b, dnnl_aBCdef16b16c, dnnl_aBCdef16c16b, dnnl_aBCdef4c16b4c,
  dnnl_aBCdef2c8b4c, dnnl_aBCdef4c8b2c, dnnl_aBCdef2b4c2b, dnnl_aBcdef4b,
  dnnl_aBCdef4c4b, dnnl_aBCdef4b4c, dnnl_aBCdef2c4b2c, dnnl_aBCdef4b8c2b,
  dnnl_aBCdef8b8c, dnnl_aBCdef8b4c, dnnl_aBCdef8c16b2c, dnnl_aBCdef4b8c8b4c,
  dnnl_aBCdef8b16c2b, dnnl_aCBdef8b16c2b, dnnl_aBCdef8c8b, dnnl_aBdc16b,
  dnnl_aBdC16b2c, dnnl_aBdC16b4c, dnnl_aBdc4b, dnnl_aBdc8b,
  dnnl_aBdec16b, dnnl_aBdeC16b2c, dnnl_aBdeC16b4c, dnnl_aBdec32b,
  dnnl_aBdec4b, dnnl_aBdec8b, dnnl_aBdefc16b, dnnl_aBdefC16b2c,
  dnnl_aCBdef16c16b, dnnl_aBdefc4b, dnnl_aBdefc8b, dnnl_Abcdef16a,
  dnnl_Abcdef32a, dnnl_Acb16a, dnnl_AcB16a2b, dnnl_AcB16a4b,
  dnnl_Acb4a, dnnl_Acb8a, dnnl_aCBd16b16c, dnnl_aCBd16c16b,
  dnnl_aCBde16b16c, dnnl_aCBde16c16b, dnnl_Acdb16a, dnnl_AcdB16a2b,
  dnnl_AcdB16a4b, dnnl_Acdb32a, dnnl_Acdb4a, dnnl_Acdb8a,
  dnnl_Acdeb16a, dnnl_AcdeB16a2b, dnnl_Acdeb4a, dnnl_Acdeb8a,
  dnnl_BAc16a16b, dnnl_BAc16b16a, dnnl_BAcd16a16b, dnnl_BAcd16b16a,
  dnnl_aCBd4c8b8c4b, dnnl_aCBde4c8b8c4b, dnnl_aCBdef4c8b8c4b, dnnl_BAcde16a16b,
  dnnl_aCBdef16b16c, dnnl_format_tag_last, dnnl_x = dnnl_a, dnnl_nc = dnnl_ab,
  dnnl_cn = dnnl_ba, dnnl_tn = dnnl_ab, dnnl_nt = dnnl_ba, dnnl_ncw = dnnl_abc,
  dnnl_nwc = dnnl_acb, dnnl_nchw = dnnl_abcd, dnnl_nhwc = dnnl_acdb, dnnl_chwn = dnnl_bcda,
  dnnl_ncdhw = dnnl_abcde, dnnl_ndhwc = dnnl_acdeb, dnnl_oi = dnnl_ab, dnnl_io = dnnl_ba,
  dnnl_oiw = dnnl_abc, dnnl_owi = dnnl_acb, dnnl_wio = dnnl_cba, dnnl_iwo = dnnl_bca,
  dnnl_oihw = dnnl_abcd, dnnl_hwio = dnnl_cdba, dnnl_ohwi = dnnl_acdb, dnnl_ihwo = dnnl_bcda,
  dnnl_iohw = dnnl_bacd, dnnl_oidhw = dnnl_abcde, dnnl_iodhw = dnnl_bacde, dnnl_dhwio = dnnl_cdeba,
  dnnl_odhwi = dnnl_acdeb, dnnl_idhwo = dnnl_bcdea, dnnl_goiw = dnnl_abcd, dnnl_wigo = dnnl_dcab,
  dnnl_goihw = dnnl_abcde, dnnl_hwigo = dnnl_decab, dnnl_giohw = dnnl_acbde, dnnl_goidhw = dnnl_abcdef,
  dnnl_giodhw = dnnl_acbdef, dnnl_dhwigo = dnnl_defcab, dnnl_tnc = dnnl_abc, dnnl_ntc = dnnl_bac,
  dnnl_ldnc = dnnl_abcd, dnnl_ldigo = dnnl_abcde, dnnl_ldgoi = dnnl_abdec, dnnl_ldio = dnnl_abcd,
  dnnl_ldoi = dnnl_abdc, dnnl_ldgo = dnnl_abcd, dnnl_nCdhw32c = dnnl_aBcde32b, dnnl_nCdhw16c = dnnl_aBcde16b,
  dnnl_nCdhw4c = dnnl_aBcde4b, dnnl_nCdhw8c = dnnl_aBcde8b, dnnl_nChw32c = dnnl_aBcd32b, dnnl_nChw16c = dnnl_aBcd16b,
  dnnl_nChw4c = dnnl_aBcd4b, dnnl_nChw8c = dnnl_aBcd8b, dnnl_nCw32c = dnnl_aBc32b, dnnl_nCw16c = dnnl_aBc16b,
  dnnl_nCw4c = dnnl_aBc4b, dnnl_nCw8c = dnnl_aBc8b, dnnl_NCw16n16c = dnnl_ABc16a16b, dnnl_NCdhw16n16c = dnnl_ABcde16a16b,
  dnnl_NChw16n16c = dnnl_ABcd16a16b, dnnl_NCw32n32c = dnnl_ABc32a32b, dnnl_NChw32n32c = dnnl_ABcd32a32b, dnnl_NCdhw32n32c = dnnl_ABcde32a32b,
  dnnl_IOw16o16i = dnnl_BAc16a16b, dnnl_IOw16i16o = dnnl_BAc16b16a, dnnl_OIw16i16o = dnnl_ABc16b16a, dnnl_OIw16o16i = dnnl_ABc16a16b,
  dnnl_Oiw16o = dnnl_Abc16a, dnnl_OIw4i16o4i = dnnl_ABc4b16a4b, dnnl_OIw2i8o4i = dnnl_ABc2b8a4b, dnnl_OIw16i16o4i = dnnl_ABc16b16a4b,
  dnnl_OIw16i16o2i = dnnl_ABc16b16a2b, dnnl_OIw4i4o = dnnl_ABc4b4a, dnnl_OIw4o4i = dnnl_ABc4a4b, dnnl_Oiw4o = dnnl_Abc4a,
  dnnl_OIw8i16o2i = dnnl_ABc8b16a2b, dnnl_OIw8i8o = dnnl_ABc8b8a, dnnl_OIw8o16i2o = dnnl_ABc8a16b2a, dnnl_IOw8o16i2o = dnnl_BAc8a16b2a,
  dnnl_OIw8o8i = dnnl_ABc8a8b, dnnl_OIw8o4i = dnnl_ABc8a4b, dnnl_Owi16o = dnnl_Acb16a, dnnl_OwI16o2i = dnnl_AcB16a2b,
  dnnl_OwI16o4i = dnnl_AcB16a4b, dnnl_Owi4o = dnnl_Acb4a, dnnl_Owi8o = dnnl_Acb8a, dnnl_IOhw16i16o = dnnl_BAcd16b16a,
  dnnl_IOhw16o16i = dnnl_BAcd16a16b, dnnl_Ohwi16o = dnnl_Acdb16a, dnnl_OhwI16o2i = dnnl_AcdB16a2b, dnnl_OhwI16o4i = dnnl_AcdB16a4b,
  dnnl_Ohwi32o = dnnl_Acdb32a, dnnl_Ohwi4o = dnnl_Acdb4a, dnnl_Ohwi8o = dnnl_Acdb8a, dnnl_OIhw16i16o = dnnl_ABcd16b16a,
  dnnl_OIhw16o16i = dnnl_ABcd16a16b, dnnl_Oihw16o = dnnl_Abcd16a, dnnl_OIhw4i16o4i = dnnl_ABcd4b16a4b, dnnl_OIhw16i16o4i = dnnl_ABcd16b16a4b,
  dnnl_OIhw16i16o2i = dnnl_ABcd16b16a2b, dnnl_OIhw4i4o = dnnl_ABcd4b4a, dnnl_OIhw4o4i = dnnl_ABcd4a4b, dnnl_Oihw4o = dnnl_Abcd4a,
  dnnl_OIhw8i16o2i = dnnl_ABcd8b16a2b, dnnl_OIhw8i8o = dnnl_ABcd8b8a, dnnl_OIhw8o16i2o = dnnl_ABcd8a16b2a, dnnl_OIhw2i8o4i = dnnl_ABcd2b8a4b,
  dnnl_IOhw8o16i2o = dnnl_BAcd8a16b2a, dnnl_OIhw8o8i = dnnl_ABcd8a8b, dnnl_OIhw8o4i = dnnl_ABcd8a4b, dnnl_Odhwi16o = dnnl_Acdeb16a,
  dnnl_OdhwI16o2i = dnnl_AcdeB16a2b, dnnl_Odhwi4o = dnnl_Acdeb4a, dnnl_Odhwi8o = dnnl_Acdeb8a, dnnl_OIdhw16i16o = dnnl_ABcde16b16a,
  dnnl_OIdhw16o16i = dnnl_ABcde16a16b, dnnl_Oidhw16o = dnnl_Abcde16a, dnnl_OIdhw4i4o = dnnl_ABcde4b4a, dnnl_OIdhw4o4i = dnnl_ABcde4a4b,
  dnnl_Oidhw4o = dnnl_Abcde4a, dnnl_OIdhw8i16o2i = dnnl_ABcde8b16a2b, dnnl_OIdhw8i8o = dnnl_ABcde8b8a, dnnl_OIdhw8o16i2o = dnnl_ABcde8a16b2a,
  dnnl_IOdhw8o16i2o = dnnl_BAcde8a16b2a, dnnl_OIdhw4i16o4i = dnnl_ABcde4b16a4b, dnnl_OIdhw2i8o4i = dnnl_ABcde2b8a4b, dnnl_OIdhw8o8i = dnnl_ABcde8a8b,
  dnnl_OIdhw8o4i = dnnl_ABcde8a4b, dnnl_IOdhw16i16o = dnnl_BAcde16b16a, dnnl_OIdhw4o8i8o4i = dnnl_ABcde4a8b8a4b, dnnl_IOdhw16o16i = dnnl_BAcde16a16b,
  dnnl_Goiw16g = dnnl_Abcd16a, dnnl_Goiw8g = dnnl_Abcd8a, dnnl_gIOw16o16i = dnnl_aCBd16b16c, dnnl_gIOw16i16o = dnnl_aCBd16c16b,
  dnnl_gOIw16i16o = dnnl_aBCd16c16b, dnnl_gOIw16o16i = dnnl_aBCd16b16c, dnnl_gOiw16o = dnnl_aBcd16b, dnnl_gOIw4i16o4i = dnnl_aBCd4c16b4c,
  dnnl_gOIw2i8o4i = dnnl_aBCd2c8b4c, dnnl_gOIw16i16o4i = dnnl_aBCd16c16b4c, dnnl_gOIw16i16o2i = dnnl_aBCd16c16b2c, dnnl_gOIw4i4o = dnnl_aBCd4c4b,
  dnnl_gOIw4o4i = dnnl_aBCd4b4c, dnnl_gOiw4o = dnnl_aBcd4b, dnnl_gOIw8i16o2i = dnnl_aBCd8c16b2c, dnnl_gOIw8i8o = dnnl_aBCd8c8b,
  dnnl_gOIw8o16i2o = dnnl_aBCd8b16c2b, dnnl_gIOw8o16i2o = dnnl_aCBd8b16c2b, dnnl_gOIw8o8i = dnnl_aBCd8b8c, dnnl_gOIw8o4i = dnnl_aBCd8b4c,
  dnnl_gOwi16o = dnnl_aBdc16b, dnnl_gOwI16o2i = dnnl_aBdC16b2c, dnnl_gOwI16o4i = dnnl_aBdC16b4c, dnnl_gOwi4o = dnnl_aBdc4b,
  dnnl_gOwi8o = dnnl_aBdc8b, dnnl_Goiw32g = dnnl_Abcd32a, dnnl_gOIw2i4o2i = dnnl_aBCd2c4b2c, dnnl_gOIw2o4i2o = dnnl_aBCd2b4c2b,
  dnnl_gOIw4i8o2i = dnnl_aBCd4c8b2c, dnnl_gOIw4o8i2o = dnnl_aBCd4b8c2b, dnnl_gIOhw16i16o = dnnl_aCBde16c16b, dnnl_gIOhw16o16i = dnnl_aCBde16b16c,
  dnnl_gOhwi16o = dnnl_aBdec16b, dnnl_gOhwI16o2i = dnnl_aBdeC16b2c, dnnl_gOhwI16o4i = dnnl_aBdeC16b4c, dnnl_gOhwi32o = dnnl_aBdec32b,
  dnnl_gOhwi4o = dnnl_aBdec4b, dnnl_gOhwi8o = dnnl_aBdec8b, dnnl_Goihw16g = dnnl_Abcde16a, dnnl_gOIhw16i16o = dnnl_aBCde16c16b,
  dnnl_gOIhw16o16i = dnnl_aBCde16b16c, dnnl_gOihw16o = dnnl_aBcde16b, dnnl_gOIhw2i8o4i = dnnl_aBCde2c8b4c, dnnl_gOIhw4i16o4i = dnnl_aBCde4c16b4c,
  dnnl_gOIhw16i16o4i = dnnl_aBCde16c16b4c, dnnl_gOIhw16i16o2i = dnnl_aBCde16c16b2c, dnnl_gOIhw4i4o = dnnl_aBCde4c4b, dnnl_gOIhw4o4i = dnnl_aBCde4b4c,
  dnnl_gOihw4o = dnnl_aBcde4b, dnnl_Goihw8g = dnnl_Abcde8a, dnnl_gOIhw8i16o2i = dnnl_aBCde8c16b2c, dnnl_gOIhw8i8o = dnnl_aBCde8c8b,
  dnnl_gOIhw8o16i2o = dnnl_aBCde8b16c2b, dnnl_gIOhw8o16i2o = dnnl_aCBde8b16c2b, dnnl_gOIhw8o8i = dnnl_aBCde8b8c, dnnl_gOIhw8o4i = dnnl_aBCde8b4c,
  dnnl_Goihw32g = dnnl_Abcde32a, dnnl_OIw4o8i8o4i = dnnl_ABc4a8b8a4b, dnnl_OIhw4o8i8o4i = dnnl_ABcd4a8b8a4b, dnnl_IOw4i8o8i4o = dnnl_BAc4b8a8b4a,
  dnnl_IOhw4i8o8i4o = dnnl_BAcd4b8a8b4a, dnnl_IOdhw4i8o8i4o = dnnl_BAcde4b8a8b4a, dnnl_OIhw2o8i8o2i = dnnl_ABcd2a8b8a2b, dnnl_gOIw4o8i8o4i = dnnl_aBCd4b8c8b4c,
  dnnl_gOIhw4o8i8o4i = dnnl_aBCde4b8c8b4c, dnnl_gOIdhw4o8i8o4i = dnnl_aBCdef4b8c8b4c, dnnl_gIOw4i8o8i4o = dnnl_aCBd4c8b8c4b, dnnl_gIOhw4i8o8i4o = dnnl_aCBde4c8b8c4b,
  dnnl_gIOdhw4i8o8i4o = dnnl_aCBdef4c8b8c4b, dnnl_gOIhw2o8i8o2i = dnnl_aBCde2b8c8b2c, dnnl_gOIhw2i4o2i = dnnl_aBCde2c4b2c, dnnl_gOIhw2o4i2o = dnnl_aBCde2b4c2b,
  dnnl_gOIhw4i8o2i = dnnl_aBCde4c8b2c, dnnl_gOIhw4o8i2o = dnnl_aBCde4b8c2b, dnnl_gIOdhw16i16o = dnnl_aCBdef16c16b, dnnl_gIOdhw16o16i = dnnl_aCBdef16b16c,
  dnnl_gOdhwi16o = dnnl_aBdefc16b, dnnl_gOdhwI16o2i = dnnl_aBdefC16b2c, dnnl_gOdhwi4o = dnnl_aBdefc4b, dnnl_gOdhwi8o = dnnl_aBdefc8b,
  dnnl_gOIdhw16i16o = dnnl_aBCdef16c16b, dnnl_gOIdhw4i16o4i = dnnl_aBCdef4c16b4c, dnnl_gOIdhw2i8o4i = dnnl_aBCdef2c8b4c, dnnl_gOIdhw16o16i = dnnl_aBCdef16b16c,
  dnnl_gOidhw16o = dnnl_aBcdef16b, dnnl_gOIdhw4i4o = dnnl_aBCdef4c4b, dnnl_gOIdhw4o4i = dnnl_aBCdef4b4c, dnnl_gOidhw4o = dnnl_aBcdef4b,
  dnnl_gOIdhw8i16o2i = dnnl_aBCdef8c16b2c, dnnl_gOIdhw8i8o = dnnl_aBCdef8c8b, dnnl_gOIdhw8o16i2o = dnnl_aBCdef8b16c2b, dnnl_gIOdhw8o16i2o = dnnl_aCBdef8b16c2b,
  dnnl_gOIdhw8o8i = dnnl_aBCdef8b8c, dnnl_gOIdhw8o4i = dnnl_aBCdef8b4c, dnnl_Goidhw16g = dnnl_Abcdef16a, dnnl_Goidhw32g = dnnl_Abcdef32a,
  dnnl_gOIdhw2i4o2i = dnnl_aBCdef2c4b2c, dnnl_gOIdhw4i8o2i = dnnl_aBCdef4c8b2c, dnnl_gOIdhw2o4i2o = dnnl_aBCdef2b4c2b, dnnl_gOIdhw4o8i2o = dnnl_aBCdef4b8c2b
}
 
enum  dnnl_wino_memory_format_t {
  dnnl_wino_undef = 0, dnnl_wino_wei_aaOIoi, dnnl_wino_wei_aaOio, dnnl_wino_wei_aaOBiOo,
  dnnl_wino_wei_OBaaIBOIio
}
 Winograd-specific formats. More...
 
enum  dnnl_rnn_packed_memory_format_t { dnnl_packed_format_undef = 0, dnnl_ldigo_p, dnnl_ldgoi_p }
 
enum  dnnl_memory_extra_flags_t { dnnl_memory_extra_flag_none = 0x0U, dnnl_memory_extra_flag_compensation_conv_s8s8 = 0x1U, dnnl_memory_extra_flag_scale_adjust = 0x2U, dnnl_memory_extra_flag_gpu_rnn_u8s8_compensation = 0x4U }
 Flags for memory special features. More...
 

Functions

dnnl_status_t DNNL_API dnnl_memory_desc_init_by_strides (dnnl_memory_desc_t *memory_desc, int ndims, const dnnl_dims_t dims, dnnl_data_type_t data_type, const dnnl_dims_t strides)
 
dnnl_status_t DNNL_API dnnl_memory_desc_init_by_tag (dnnl_memory_desc_t *memory_desc, int ndims, const dnnl_dims_t dims, dnnl_data_type_t data_type, dnnl_format_tag_t tag)
 
dnnl_status_t DNNL_API dnnl_memory_desc_init_submemory (dnnl_memory_desc_t *memory_desc, const dnnl_memory_desc_t *parent_memory_desc, const dnnl_dims_t dims, const dnnl_dims_t offsets)
 
dnnl_status_t DNNL_API dnnl_memory_desc_reshape (dnnl_memory_desc_t *out_memory_desc, const dnnl_memory_desc_t *in_memory_desc, int ndims, const dnnl_dims_t dims)
 
dnnl_status_t DNNL_API dnnl_memory_desc_permute_axes (dnnl_memory_desc_t *out_memory_desc, const dnnl_memory_desc_t *in_memory_desc, const int *permutation)
 
int DNNL_API dnnl_memory_desc_equal (const dnnl_memory_desc_t *lhs, const dnnl_memory_desc_t *rhs)
 
size_t DNNL_API dnnl_memory_desc_get_size (const dnnl_memory_desc_t *memory_desc)
 
dnnl_status_t DNNL_API dnnl_memory_create (dnnl_memory_t *memory, const dnnl_memory_desc_t *memory_desc, dnnl_engine_t engine, void *handle)
 
dnnl_status_t DNNL_API dnnl_memory_get_memory_desc (const_dnnl_memory_t memory, const dnnl_memory_desc_t **memory_desc)
 
dnnl_status_t DNNL_API dnnl_memory_get_engine (const_dnnl_memory_t memory, dnnl_engine_t *engine)
 
dnnl_status_t DNNL_API dnnl_memory_map_data (const_dnnl_memory_t memory, void **mapped_ptr)
 
dnnl_status_t DNNL_API dnnl_memory_unmap_data (const_dnnl_memory_t memory, void *mapped_ptr)
 
dnnl_status_t DNNL_API dnnl_memory_get_data_handle (const_dnnl_memory_t memory, void **handle)
 
dnnl_status_t DNNL_API dnnl_memory_set_data_handle (dnnl_memory_t memory, void *handle)
 
dnnl_status_t DNNL_API dnnl_memory_set_data_handle_v2 (dnnl_memory_t memory, void *handle, dnnl_stream_t stream)
 
dnnl_status_t DNNL_API dnnl_memory_destroy (dnnl_memory_t memory)
 

Detailed Description

Macro Definition Documentation

#define DNNL_MAX_NDIMS   12

Maximum number of dimensions a tensor can have. Only restricts the amount of space used for the tensor description. Individual computational primitives may support only tensors of certain dimensions.

#define DNNL_MEMORY_ALLOCATE   ((void *)(size_t)-1)
#define DNNL_MEMORY_NONE   (NULL)
#define DNNL_RNN_MAX_N_PARTS   4

Maximum number of parts of RNN weights tensor that require separate computation.

#define DNNL_RUNTIME_DIM_VAL   INT64_MIN

A wildcard value for dimensions that are unknown at a primitive creation time.

#define DNNL_RUNTIME_F32_VAL   (DNNL_RUNTIME_F32_VAL_REP.f)

A wildcard value for floating point values that are unknown at a primitive creation time.

#define DNNL_RUNTIME_S32_VAL   DNNL_RUNTIME_S32_VAL_REP

A wildcard value for int32_t values that are unknown at a primitive creation time.

#define DNNL_RUNTIME_SIZE_VAL   ((size_t)DNNL_RUNTIME_DIM_VAL)

A size_t counterpart of the DNNL_RUNTIME_DIM_VAL. For instance, this value is returned by dnnl_memory_desc_get_size() if either of the dimensions or strides equal to DNNL_RUNTIME_DIM_VAL.

Typedef Documentation

typedef const struct dnnl_memory* const_dnnl_memory_t

A constant memory handle.

typedef int64_t dnnl_dim_t

A type to describe tensor dimension.

typedef dnnl_dim_t dnnl_dims_t[DNNL_MAX_NDIMS]

A type to describe tensor dimensions.

typedef struct dnnl_memory* dnnl_memory_t

A memory handle.

Enumeration Type Documentation

Data type specification.

Enumerator
dnnl_data_type_undef 

Undefined data type, used for empty memory descriptors.

dnnl_f16 

16-bit/half-precision floating point.

dnnl_bf16 

non-standard 16-bit (bfloat16 w/ 7 bit mantissa) floating point.

dnnl_f32 

32-bit/single-precision floating point.

dnnl_s32 

32-bit signed integer.

dnnl_s8 

8-bit signed integer.

dnnl_u8 

8-bit unsigned integer.

Memory format kind.

Enumerator
dnnl_format_kind_undef 

Undefined memory format kind, used for empty memory descriptors.

dnnl_format_kind_any 

Unspecified format kind. The primitive selects a format automatically.

dnnl_blocked 

A tensor in a generic format described by the stride and blocking values in each dimension. See dnnl_blocking_desc_t for more information.

dnnl_format_kind_wino 

Weights format used in 8bit Winograd convolution.

dnnl_format_kind_rnn_packed 

Packed weights format used in RNN.

Memory format tag specification.

oneDNN formats describe physical data layout. The physical layout is described as a sequence of the dimensions as they are laid out in the memory (from the outer-most to the inner-most). Note that this order doesn't affect the logical order of the dimensions that is kept in the dims field of the dnnl_memory_desc_t structure. The logical order of the dimensions is specified by the primitive that uses the tensor.

For example, CNN 5D tensor always has its logical dimensions in the order (batch, channels, depth, height, width), while the physical layout might be NCDHW (corresponds to dnnl_ncdhw format tag) or NDHWC (corresponds to dnnl_ndhwc format tag).

int batch = 2, channels = 16, depth = 13, height = 13, width = 13;
int ndims = 5; // 5D tensor
dnnl_dims_t dims = {batch, channels, depth, height, width};
dnnl_memory_desc_t data_in_ncdhw;
&data_in_ncdhw, 5, dims, dnnl_f32, dnnl_ncdhw);
// note that in both cases dims passed are the same
dnnl_memory_desc_t data_in_ndhwc;
&data_in_ndhwc, 5, dims, dnnl_f32, dnnl_ndhwc);

Memory format tags can be further divided into two categories:

  • Domain-agnostic names, i.e. names the do not depend on the tensor usage in the specific primitive. These names use letters from a to l to denote logical dimension from 1 to 12, and form the order in which the dimensions are laid in memory. For instance, dnnl_ab is used to denote 2D tensor where the second logical dimension (aka b) is the innermost, i.e. has stride = 1, and the first logical dimension (a) laid out in memory with stride equal to the size of second dimension. On the other hand, dnnl_ba is just transposed version of the same tensor: the first dimension (a) becomes the innermost one.
  • Domain-specific names, i.e. names that make sense only in the context of a certain domain, such as CNN. This names are just aliases to the corresponding domain-agnostic tags and used mostly for the convenience. For example, dnnl_nc is used to denote 2D CNN activations tensor memory format, where channels are the innermost dimension and batch is an outermost one. Moreover, dnnl_nc is just an alias to dnnl_ab, since for oneDNN CNN primitives the logical dimensions of activations tensors come in order: batch, channels, spatial. In other words, batch corresponds to the first logical dimension (a), channels correspond to the second one (b).

The following domain-specific notation applies to memory format tags:

  • 'n' denotes the mini-batch dimension
  • 'c' denotes a channels dimension
  • When there are multiple channel dimensions (for example, in convolution weights tensor), 'i' and 'o' denote dimensions of input and output channels
  • 'd', 'h', and 'w' denote spatial depth, height, and width respectively

Upper-case letters indicate that the data is laid out in blocks for a particular dimension. In such cases, the format name contains both upper- and lower-case letters for that dimension with a lower-case letter preceded by the block size. For example: dnnl_nChw8c describes a format where the outermost dimension is mini-batch, followed by the channel block number, followed by the spatial height and width, and finally followed by 8-element channel blocks.

See also
dev_guide_understanding_memory_formats
Enumerator
dnnl_format_tag_undef 

Undefined memory format tag.

dnnl_format_tag_any 

Undefined memory format tag. The primitive selects a format automatically.

dnnl_a 

plain 1D tensor

dnnl_ab 

plain 2D tensor

dnnl_abc 

plain 3D tensor

dnnl_abcd 

plain 4D tensor

dnnl_abcde 

plain 5D tensor

dnnl_abcdef 

plain 6D tensor

dnnl_abdc 

permuted 4D tensor

dnnl_abdec 

permuted 5D tensor

dnnl_acb 

permuted 3D tensor

dnnl_acbde 

permuted 5D tensor

dnnl_acbdef 

permuted 6D tensor

dnnl_acdb 

permuted 4D tensor

dnnl_acdeb 

permuted 5D tensor

dnnl_ba 

permuted 2D tensor

dnnl_bac 

permuted 3D tensor

dnnl_bacd 

permuted 4D tensor

dnnl_bacde 

permuted 5D tensor

dnnl_bca 

permuted 3D tensor

dnnl_bcda 

permuted 4D tensor

dnnl_bcdea 

permuted 5D tensor

dnnl_cba 

permuted 3D tensor

dnnl_cdba 

permuted 4D tensor

dnnl_dcab 

permuted 4D tensor

dnnl_cdeba 

permuted 5D tensor

dnnl_decab 

permuted 5D tensor

dnnl_defcab 

permuted 6D tensor

dnnl_Abc16a 
dnnl_ABc16a16b 
dnnl_ABc32a32b 
dnnl_ABc4a4b 
dnnl_aBc16b 

3D tensor blocked by 2nd dimension with block size 16

dnnl_ABc16b16a 
dnnl_Abc4a 
dnnl_aBc32b 

3D tensor blocked by 2nd dimension with block size 32

dnnl_aBc4b 

3D tensor blocked by 2nd dimension with block size 4

dnnl_ABc4b16a4b 
dnnl_ABc2b8a4b 
dnnl_ABc16b16a4b 
dnnl_ABc16b16a2b 
dnnl_ABc4b4a 
dnnl_ABc8a16b2a 
dnnl_ABc8a8b 
dnnl_ABc8a4b 
dnnl_aBc8b 

3D tensor blocked by 2nd dimension with block size 8

dnnl_ABc8b16a2b 
dnnl_BAc8a16b2a 
dnnl_ABc8b8a 
dnnl_Abcd16a 
dnnl_Abcd8a 
dnnl_ABcd16a16b 
dnnl_Abcd32a 
dnnl_ABcd32a32b 
dnnl_aBcd16b 

4D tensor blocked by 2nd dimension with block size 16

dnnl_ABcd16b16a 
dnnl_aBCd16b16c 
dnnl_aBCd16c16b 
dnnl_Abcd4a 
dnnl_aBcd32b 

4D tensor blocked by 2nd dimension with block size 32

dnnl_aBcd4b 

4D tensor blocked by 2nd dimension with block size 4

dnnl_ABcd4b16a4b 
dnnl_ABcd16b16a4b 
dnnl_ABcd16b16a2b 
dnnl_ABcd4b4a 
dnnl_ABcd4a4b 
dnnl_aBCd2c4b2c 
dnnl_aBCd4b8c2b 
dnnl_aBCd4c16b4c 
dnnl_aBCd2c8b4c 
dnnl_aBCd16c16b4c 
dnnl_aBCd16c16b2c 
dnnl_aBCd4c4b 
dnnl_aBCd4b4c 
dnnl_ABcd8a16b2a 
dnnl_ABcd2b8a4b 
dnnl_ABcd8a8b 
dnnl_ABcd8a4b 
dnnl_aBcd8b 

4D tensor blocked by 2nd dimension with block size 8

dnnl_aBCd4c8b2c 
dnnl_ABcd8b16a2b 
dnnl_aBCd8b16c2b 
dnnl_BAcd8a16b2a 
dnnl_ABcd8b8a 

4D tensor blocked by 1st and 2nd dimension with block size 8

dnnl_aBCd8b8c 
dnnl_aBCd8b4c 
dnnl_aBCd8c16b2c 
dnnl_ABcde8a16b2a 
dnnl_aCBd8b16c2b 
dnnl_aBCd8c8b 
dnnl_Abcde16a 
dnnl_Abcde32a 
dnnl_ABcde16a16b 
dnnl_BAcde8a16b2a 
dnnl_aBCd2b4c2b 

4D tensor blocked by 3rd dimension with block size 4

dnnl_ABcde4b16a4b 

5D tensor blocked by 1st dimension with block size 16

dnnl_ABcde2b8a4b 

5D tensor blocked by 1st dimension with block size 8

dnnl_aBcde16b 

5D tensor blocked by 2nd dimension with block size 16

dnnl_ABcde16b16a 
dnnl_aBCde16b16c 
dnnl_aBCde16c16b 
dnnl_aBCde2c8b4c 
dnnl_Abcde4a 
dnnl_aBcde32b 

5D tensor blocked by 2nd dimension with block size 32

dnnl_aBcde4b 

5D tensor blocked by 2nd dimension with block size 4

dnnl_ABcde4b4a 
dnnl_ABcde4a4b 
dnnl_aBCde4b4c 
dnnl_aBCde2c4b2c 
dnnl_aBCde4b8c2b 
dnnl_aBCde4c16b4c 
dnnl_aBCde16c16b4c 
dnnl_aBCde16c16b2c 
dnnl_aBCde4c4b 
dnnl_Abcde8a 
dnnl_ABcde8a8b 
dnnl_ABcde8a4b 
dnnl_BAcde16b16a 
dnnl_aBcde8b 

5D tensor blocked by 2nd dimension with block size 8

dnnl_ABcde8b16a2b 
dnnl_aBCde8b16c2b 
dnnl_aBCde4c8b2c 
dnnl_aCBde8b16c2b 
dnnl_ABcde8b8a 
dnnl_ABcde32a32b 
dnnl_aBCde8b8c 
dnnl_aBCde8b4c 
dnnl_ABc4a8b8a4b 
dnnl_ABcd4a8b8a4b 
dnnl_ABcde4a8b8a4b 
dnnl_BAc4b8a8b4a 
dnnl_BAcd4b8a8b4a 
dnnl_BAcde4b8a8b4a 
dnnl_ABcd2a8b8a2b 
dnnl_aBCd4b8c8b4c 
dnnl_aBCde4b8c8b4c 
dnnl_aBCde2b8c8b2c 
dnnl_aBCde8c16b2c 
dnnl_aBCde8c8b 
dnnl_aBCde2b4c2b 

5D tensor blocked by 3rd dimension with block size 4

dnnl_aBcdef16b 

6D tensor blocked by 2nd dimension with block size 16

dnnl_aBCdef16b16c 
dnnl_aBCdef16c16b 
dnnl_aBCdef4c16b4c 
dnnl_aBCdef2c8b4c 

6D tensor blocked by 2nd dimension with block size 8

dnnl_aBCdef4c8b2c 
dnnl_aBCdef2b4c2b 

6D tensor blocked by 3rd dimension with block size 4

dnnl_aBcdef4b 

6D tensor blocked by 2nd dimension with block size 4

dnnl_aBCdef4c4b 
dnnl_aBCdef4b4c 
dnnl_aBCdef2c4b2c 
dnnl_aBCdef4b8c2b 
dnnl_aBCdef8b8c 
dnnl_aBCdef8b4c 
dnnl_aBCdef8c16b2c 
dnnl_aBCdef4b8c8b4c 
dnnl_aBCdef8b16c2b 
dnnl_aCBdef8b16c2b 
dnnl_aBCdef8c8b 
dnnl_aBdc16b 
dnnl_aBdC16b2c 
dnnl_aBdC16b4c 
dnnl_aBdc4b 
dnnl_aBdc8b 
dnnl_aBdec16b 
dnnl_aBdeC16b2c 
dnnl_aBdeC16b4c 
dnnl_aBdec32b 
dnnl_aBdec4b 
dnnl_aBdec8b 
dnnl_aBdefc16b 
dnnl_aBdefC16b2c 
dnnl_aCBdef16c16b 
dnnl_aBdefc4b 
dnnl_aBdefc8b 
dnnl_Abcdef16a 
dnnl_Abcdef32a 
dnnl_Acb16a 
dnnl_AcB16a2b 
dnnl_AcB16a4b 
dnnl_Acb4a 
dnnl_Acb8a 
dnnl_aCBd16b16c 
dnnl_aCBd16c16b 
dnnl_aCBde16b16c 
dnnl_aCBde16c16b 
dnnl_Acdb16a 
dnnl_AcdB16a2b 
dnnl_AcdB16a4b 
dnnl_Acdb32a 
dnnl_Acdb4a 
dnnl_Acdb8a 
dnnl_Acdeb16a 
dnnl_AcdeB16a2b 
dnnl_Acdeb4a 
dnnl_Acdeb8a 
dnnl_BAc16a16b 
dnnl_BAc16b16a 
dnnl_BAcd16a16b 
dnnl_BAcd16b16a 
dnnl_aCBd4c8b8c4b 
dnnl_aCBde4c8b8c4b 
dnnl_aCBdef4c8b8c4b 
dnnl_BAcde16a16b 
dnnl_aCBdef16b16c 
dnnl_format_tag_last 

Just a sentinel, not real memory format tag. Must be changed after new format tag is added.

dnnl_x 

1D tensor, an alias to dnnl_a

dnnl_nc 

2D CNN activations tensor, an alias to dnnl_ab

dnnl_cn 

2D CNN activations tensor, an alias to dnnl_ba

dnnl_tn 

2D RNN statistics tensor, an alias to dnnl_ab

dnnl_nt 

2D RNN statistics tensor, an alias to dnnl_ba

dnnl_ncw 

3D CNN activations tensor, an alias to dnnl_abc

dnnl_nwc 

3D CNN activations tensor, an alias to dnnl_acb

dnnl_nchw 

4D CNN activations tensor, an alias to dnnl_abcd

dnnl_nhwc 

4D CNN activations tensor, an alias to dnnl_acdb

dnnl_chwn 

4D CNN activations tensor, an alias to dnnl_bcda

dnnl_ncdhw 

5D CNN activations tensor, an alias to dnnl_abcde

dnnl_ndhwc 

5D CNN activations tensor, an alias to dnnl_acdeb

dnnl_oi 

2D CNN weights tensor, an alias to dnnl_ab

dnnl_io 

2D CNN weights tensor, an alias to dnnl_ba

dnnl_oiw 

3D CNN weights tensor, an alias to dnnl_abc

dnnl_owi 

3D CNN weights tensor, an alias to dnnl_acb

dnnl_wio 

3D CNN weights tensor, an alias to dnnl_cba

dnnl_iwo 

3D CNN weights tensor, an alias to dnnl_bca

dnnl_oihw 

4D CNN weights tensor, an alias to dnnl_abcd

dnnl_hwio 

4D CNN weights tensor, an alias to dnnl_cdba

dnnl_ohwi 

4D CNN weights tensor, an alias to dnnl_acdb

dnnl_ihwo 

4D CNN weights tensor, an alias to dnnl_bcda

dnnl_iohw 

4D CNN weights tensor, an alias to dnnl_bacd

dnnl_oidhw 

5D CNN weights tensor, an alias to dnnl_abcde

dnnl_iodhw 

5D CNN weights tensor, an alias to dnnl_bacde

dnnl_dhwio 

5D CNN weights tensor, an alias to dnnl_cdeba

dnnl_odhwi 

5D CNN weights tensor, an alias to dnnl_acdeb

dnnl_idhwo 

5D CNN weights tensor, an alias to dnnl_bcdea

dnnl_goiw 

4D CNN weights tensor (incl. groups), an alias to dnnl_abcd

dnnl_wigo 

4D CNN weights tensor (incl. groups), an alias to dnnl_dcab

dnnl_goihw 

5D CNN weights tensor (incl. groups), an alias to dnnl_abcde

dnnl_hwigo 

5D CNN weights tensor (incl. groups), an alias to dnnl_decab

dnnl_giohw 

5D CNN weights tensor (incl. groups), an alias to dnnl_acbde

dnnl_goidhw 

6D CNN weights tensor (incl. groups), an alias to dnnl_abcdef

dnnl_giodhw 

6D CNN weights tensor (incl. groups), an alias to dnnl_acbdef

dnnl_dhwigo 

6D CNN weights tensor (incl. groups), an alias to dnnl_defcab

dnnl_tnc 

3D RNN data tensor in the format (seq_length, batch, input channels).

dnnl_ntc 

3D RNN data tensor in the format (batch, seq_length, input channels).

dnnl_ldnc 

4D RNN states tensor in the format (num_layers, num_directions, batch, state channels).

dnnl_ldigo 

5D RNN weights tensor in the format (num_layers, num_directions, input_channels, num_gates, output_channels).

  • For LSTM cells, the gates order is input, forget, candidate and output gate.
  • For GRU cells, the gates order is update, reset and output gate.
dnnl_ldgoi 

5D RNN weights tensor in the format (num_layers, num_directions, num_gates, output_channels, input_channels).

  • For LSTM cells, the gates order is input, forget, candidate and output gate.
  • For GRU cells, the gates order is update, reset and output gate.
dnnl_ldio 

4D LSTM projection tensor in the format (num_layers, num_directions, num_channels_in_hidden_state, num_channels_in_recurrent_projection).

dnnl_ldoi 

4D LSTM projection tensor in the format (num_layers, num_directions, num_channels_in_recurrent_projection, num_channels_in_hidden_state).

dnnl_ldgo 

4D RNN bias tensor in the format (num_layers, num_directions, num_gates, output_channels).

  • For LSTM cells, the gates order is input, forget, candidate and output gate.
  • For GRU cells, the gates order is update, reset and output gate.
dnnl_nCdhw32c 

5D CNN activations tensor blocked by channels with block size 32, an alias to dnnl_aBcde32b

dnnl_nCdhw16c 

5D CNN activations tensor blocked by channels with block size 16, an alias to dnnl_aBcde16b

dnnl_nCdhw4c 

5D CNN activations tensor blocked by channels with block size 4, an alias to dnnl_aBcde4b

dnnl_nCdhw8c 

5D CNN activations tensor blocked by channels with block size 8, an alias to dnnl_aBcde8b

dnnl_nChw32c 

4D CNN activations tensor blocked by channels with block size 32, an alias to dnnl_aBcd32b

dnnl_nChw16c 

4D CNN activations tensor blocked by channels with block size 16, an alias to dnnl_aBcd16b

dnnl_nChw4c 

4D CNN activations tensor blocked by channels with block size 4, an alias to dnnl_aBcd4b

dnnl_nChw8c 

4D CNN activations tensor blocked by channels with block size 8, an alias to dnnl_aBcd8b

dnnl_nCw32c 

3D CNN activations tensor blocked by channels with block size 32, an alias to dnnl_aBc32b

dnnl_nCw16c 

3D CNN activations tensor blocked by channels with block size 16, an alias to dnnl_aBc16b

dnnl_nCw4c 

3D CNN activations tensor blocked by channels with block size 4, an alias to dnnl_aBc4b

dnnl_nCw8c 

3D CNN activations tensor blocked by channels with block size 8, an alias to dnnl_aBc8b

dnnl_NCw16n16c 
dnnl_NCdhw16n16c 
dnnl_NChw16n16c 
dnnl_NCw32n32c 
dnnl_NChw32n32c 
dnnl_NCdhw32n32c 
dnnl_IOw16o16i 
dnnl_IOw16i16o 
dnnl_OIw16i16o 
dnnl_OIw16o16i 
dnnl_Oiw16o 
dnnl_OIw4i16o4i 
dnnl_OIw2i8o4i 
dnnl_OIw16i16o4i 
dnnl_OIw16i16o2i 
dnnl_OIw4i4o 
dnnl_OIw4o4i 
dnnl_Oiw4o 
dnnl_OIw8i16o2i 
dnnl_OIw8i8o 
dnnl_OIw8o16i2o 
dnnl_IOw8o16i2o 
dnnl_OIw8o8i 
dnnl_OIw8o4i 
dnnl_Owi16o 
dnnl_OwI16o2i 
dnnl_OwI16o4i 
dnnl_Owi4o 
dnnl_Owi8o 
dnnl_IOhw16i16o 
dnnl_IOhw16o16i 
dnnl_Ohwi16o 
dnnl_OhwI16o2i 
dnnl_OhwI16o4i 
dnnl_Ohwi32o 
dnnl_Ohwi4o 
dnnl_Ohwi8o 
dnnl_OIhw16i16o 
dnnl_OIhw16o16i 
dnnl_Oihw16o 
dnnl_OIhw4i16o4i 
dnnl_OIhw16i16o4i 
dnnl_OIhw16i16o2i 
dnnl_OIhw4i4o 
dnnl_OIhw4o4i 
dnnl_Oihw4o 
dnnl_OIhw8i16o2i 
dnnl_OIhw8i8o 
dnnl_OIhw8o16i2o 
dnnl_OIhw2i8o4i 
dnnl_IOhw8o16i2o 
dnnl_OIhw8o8i 
dnnl_OIhw8o4i 
dnnl_Odhwi16o 
dnnl_OdhwI16o2i 
dnnl_Odhwi4o 
dnnl_Odhwi8o 
dnnl_OIdhw16i16o 
dnnl_OIdhw16o16i 
dnnl_Oidhw16o 
dnnl_OIdhw4i4o 
dnnl_OIdhw4o4i 
dnnl_Oidhw4o 
dnnl_OIdhw8i16o2i 
dnnl_OIdhw8i8o 
dnnl_OIdhw8o16i2o 
dnnl_IOdhw8o16i2o 
dnnl_OIdhw4i16o4i 
dnnl_OIdhw2i8o4i 
dnnl_OIdhw8o8i 
dnnl_OIdhw8o4i 
dnnl_IOdhw16i16o 
dnnl_OIdhw4o8i8o4i 
dnnl_IOdhw16o16i 
dnnl_Goiw16g 
dnnl_Goiw8g 
dnnl_gIOw16o16i 
dnnl_gIOw16i16o 
dnnl_gOIw16i16o 
dnnl_gOIw16o16i 
dnnl_gOiw16o 
dnnl_gOIw4i16o4i 
dnnl_gOIw2i8o4i 
dnnl_gOIw16i16o4i 
dnnl_gOIw16i16o2i 
dnnl_gOIw4i4o 
dnnl_gOIw4o4i 
dnnl_gOiw4o 
dnnl_gOIw8i16o2i 
dnnl_gOIw8i8o 
dnnl_gOIw8o16i2o 
dnnl_gIOw8o16i2o 
dnnl_gOIw8o8i 
dnnl_gOIw8o4i 
dnnl_gOwi16o 
dnnl_gOwI16o2i 
dnnl_gOwI16o4i 
dnnl_gOwi4o 
dnnl_gOwi8o 
dnnl_Goiw32g 
dnnl_gOIw2i4o2i 
dnnl_gOIw2o4i2o 
dnnl_gOIw4i8o2i 
dnnl_gOIw4o8i2o 
dnnl_gIOhw16i16o 
dnnl_gIOhw16o16i 
dnnl_gOhwi16o 
dnnl_gOhwI16o2i 
dnnl_gOhwI16o4i 
dnnl_gOhwi32o 
dnnl_gOhwi4o 
dnnl_gOhwi8o 
dnnl_Goihw16g 
dnnl_gOIhw16i16o 
dnnl_gOIhw16o16i 
dnnl_gOihw16o 
dnnl_gOIhw2i8o4i 
dnnl_gOIhw4i16o4i 
dnnl_gOIhw16i16o4i 
dnnl_gOIhw16i16o2i 
dnnl_gOIhw4i4o 
dnnl_gOIhw4o4i 
dnnl_gOihw4o 
dnnl_Goihw8g 
dnnl_gOIhw8i16o2i 
dnnl_gOIhw8i8o 
dnnl_gOIhw8o16i2o 
dnnl_gIOhw8o16i2o 
dnnl_gOIhw8o8i 
dnnl_gOIhw8o4i 
dnnl_Goihw32g 
dnnl_OIw4o8i8o4i 
dnnl_OIhw4o8i8o4i 
dnnl_IOw4i8o8i4o 
dnnl_IOhw4i8o8i4o 
dnnl_IOdhw4i8o8i4o 
dnnl_OIhw2o8i8o2i 
dnnl_gOIw4o8i8o4i 
dnnl_gOIhw4o8i8o4i 
dnnl_gOIdhw4o8i8o4i 
dnnl_gIOw4i8o8i4o 
dnnl_gIOhw4i8o8i4o 
dnnl_gIOdhw4i8o8i4o 
dnnl_gOIhw2o8i8o2i 
dnnl_gOIhw2i4o2i 
dnnl_gOIhw2o4i2o 
dnnl_gOIhw4i8o2i 
dnnl_gOIhw4o8i2o 
dnnl_gIOdhw16i16o 
dnnl_gIOdhw16o16i 
dnnl_gOdhwi16o 
dnnl_gOdhwI16o2i 
dnnl_gOdhwi4o 
dnnl_gOdhwi8o 
dnnl_gOIdhw16i16o 
dnnl_gOIdhw4i16o4i 
dnnl_gOIdhw2i8o4i 
dnnl_gOIdhw16o16i 
dnnl_gOidhw16o 
dnnl_gOIdhw4i4o 
dnnl_gOIdhw4o4i 
dnnl_gOidhw4o 
dnnl_gOIdhw8i16o2i 
dnnl_gOIdhw8i8o 
dnnl_gOIdhw8o16i2o 
dnnl_gIOdhw8o16i2o 
dnnl_gOIdhw8o8i 
dnnl_gOIdhw8o4i 
dnnl_Goidhw16g 
dnnl_Goidhw32g 
dnnl_gOIdhw2i4o2i 
dnnl_gOIdhw4i8o2i 
dnnl_gOIdhw2o4i2o 
dnnl_gOIdhw4o8i2o 

Flags for memory special features.

Enumerator
dnnl_memory_extra_flag_none 
dnnl_memory_extra_flag_compensation_conv_s8s8 

Indicates the weights have an additional buffer, that depends on the compensation_mask.

For instance, in 4D case with the compensation mask equals (1 << 0) the additional buffer would consist of OC values: O[oc : 0,OC] = -128 * SUM(ic : 0,IC; kh : 0,KH; kw : 0,KW){ weights(oc, ic, kh, kw) }

dnnl_memory_extra_flag_scale_adjust 
dnnl_memory_extra_flag_gpu_rnn_u8s8_compensation 
Enumerator
dnnl_packed_format_undef 
dnnl_ldigo_p 
dnnl_ldgoi_p 

Winograd-specific formats.

Enumerator
dnnl_wino_undef 

Undefined memory format, used for empty memory descriptors.

dnnl_wino_wei_aaOIoi 

Internal weights format for 2x3 Winograd.

dnnl_wino_wei_aaOio 

Internal weights format for 2x3 Winograd.

dnnl_wino_wei_aaOBiOo 

Internal weights format for 2x3 Winograd.

dnnl_wino_wei_OBaaIBOIio 

Internal weights format for 4x3 Winograd.

Function Documentation

dnnl_status_t DNNL_API dnnl_memory_create ( dnnl_memory_t memory,
const dnnl_memory_desc_t memory_desc,
dnnl_engine_t  engine,
void *  handle 
)

Creates a memory object.

Unless handle is equal to DNNL_MEMORY_NONE, the constructed memory object will have the underlying buffer set. In this case, the buffer will be initialized as if dnnl_memory_set_data_handle() had been called.

See also
dnnl_memory_set_data_handle()
Parameters
memoryOutput memory object.
memory_descMemory descriptor.
engineEngine to use.
handleHandle of the memory buffer to use as an underlying storage.
  • A pointer to the user-allocated buffer. In this case the library doesn't own the buffer.
  • The DNNL_MEMORY_ALLOCATE special value. Instructs the library to allocate the buffer for the memory object. In this case the library owns the buffer.
  • DNNL_MEMORY_NONE to create dnnl_memory without an underlying buffer.
Returns
dnnl_success on success and a status describing the error otherwise.
int DNNL_API dnnl_memory_desc_equal ( const dnnl_memory_desc_t lhs,
const dnnl_memory_desc_t rhs 
)

Compares two memory descriptors.

Use this function to identify whether a reorder is required between the two memories

Parameters
lhsLeft-hand side of the comparison.
rhsRight-hand side of the comparison.
Returns
1 if the descriptors are the same.
0 if the descriptors are different.
size_t DNNL_API dnnl_memory_desc_get_size ( const dnnl_memory_desc_t memory_desc)

Returns the size of a memory descriptor.

Parameters
memory_descMemory descriptor.
Returns
The number of bytes required for memory described by a memory descriptor.
dnnl_status_t DNNL_API dnnl_memory_desc_init_by_strides ( dnnl_memory_desc_t memory_desc,
int  ndims,
const dnnl_dims_t  dims,
dnnl_data_type_t  data_type,
const dnnl_dims_t  strides 
)

Initializes a memory descriptor using dimensions and strides.

Note
As always, the logical order of dimensions corresponds to the abc... format tag, and the physical meaning of the dimensions depends on both the primitive that consumes the memory and the context of that consumption.
Parameters
memory_descOutput memory descriptor.
ndimsNumber of dimensions
dimsArray of dimensions.
data_typeElements data type.
stridesStrides in each dimension.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_desc_init_by_tag ( dnnl_memory_desc_t memory_desc,
int  ndims,
const dnnl_dims_t  dims,
dnnl_data_type_t  data_type,
dnnl_format_tag_t  tag 
)

Initializes a memory descriptor using dimensions and memory format tag.

Note
As always, the logical order of dimensions corresponds to the abc... format tag, and the physical meaning of the dimensions depends on both the primitive that consumes the memory and the context of that consumption.
Parameters
memory_descOutput memory descriptor.
ndimsNumber of dimensions
dimsArray of dimensions.
data_typeElements data type.
tagMemory format tag. Can be dnnl_format_tag_any which would allow a primitive to chose the final memory format. In this case the format_kind field of the memory descriptor would be set to dnnl_format_kind_any.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_desc_init_submemory ( dnnl_memory_desc_t memory_desc,
const dnnl_memory_desc_t parent_memory_desc,
const dnnl_dims_t  dims,
const dnnl_dims_t  offsets 
)

Initializes a memory descriptor for a region inside an area described by an existing memory descriptor.

Warning
Some combinations of physical memory layout and/or offsets or dims may result in a failure to create a submemory.
Parameters
memory_descOutput memory descriptor.
parent_memory_descAn existing memory descriptor.
dimsSizes of the region.
offsetsOffsets to the region from the encompassing memory object in each dimension
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_desc_permute_axes ( dnnl_memory_desc_t out_memory_desc,
const dnnl_memory_desc_t in_memory_desc,
const int *  permutation 
)

Initializes a memory descriptor by permuting axes in an existing one.

The physical memory layout representation is adjusted accordingly to maintain the consistency between the logical and physical parts of the memory descriptor.

The new memory descriptor inherits the data type. This operation is valid only for memory descriptors that have format_kind set to dnnl_blocked or dnnl_format_kind_any.

The logical axes will be permuted in the following manner:

1 for (i: 0 .. in_memory_desc->ndims)
2  out_memory_desc->dims[permutation[i]] = in_memory_desc->dims[i];

Example:

1 dnnl_memory_desc_t in_md, out_md, expect_out_md;
2 
3 const int permutation[] = {1, 0}; // swap the first and the second axes
4 
5 dnnl_dims_t in_dims = {2, 3}, out_dims = {3, 2};
6 dnnl_format_tag_t in_tag = dnnl_ab, out_tag = dnnl_ba;
7 
8 dnnl_memory_desc_init_by_tag(
9  &in_md, 2, in_dims, data_type, in_tag);
10 dnnl_memory_desc_init_by_tag(
11  &expect_out_md, 2, out_dims, data_type, out_tag);
12 
13 dnnl_memory_desc_permute_axes(&out_md, in_md, permutation);
14 assert(dnnl_memory_desc_equal(&out_md, &expect_out_md));
Parameters
out_memory_descOutput memory descriptor.
in_memory_descAn existing memory descriptor. Must have format_kind set to dnnl_blocked or dnnl_format_kind_any.
permutationAxes permutation (of size in_memory_desc->ndims).
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_desc_reshape ( dnnl_memory_desc_t out_memory_desc,
const dnnl_memory_desc_t in_memory_desc,
int  ndims,
const dnnl_dims_t  dims 
)

Initializes a memory descriptor by reshaping an existing one. The new memory descriptor inherits the data type. This operation is valid only for memory descriptors that have format_kind set to dnnl_blocked or dnnl_format_kind_any.

The operation ensures the transformation of the physical memory format corresponds to the transformation of the logical dimensions. If such transformation is impossible, the function returns dnnl_invalid_arguments.

The reshape operation can be described as a combination of the following basic operations:

  1. Add a dimension of size 1. This is always possible.
  2. Remove a dimension of size 1. This is possible only if the dimension has no padding (i.e. padded_dims[dim] == dims[dim] && dims[dim] == 1).
  3. Split a dimension into multiple ones. This is possible only if the size of the dimension is exactly equal to the product of the split ones and the dimension does not have padding (i.e. padded_dims[dim] = dims[dim]).
  4. Joining multiple consecutive dimensions into a single one. As in the cases above, this requires that the dimensions do not have padding and that the memory format is such that in physical memory these dimensions are dense and have the same order as their logical counterparts. This also assumes that these dimensions are not blocked.
    • Here, dense means: stride for dim[i] == (stride for dim[i + 1]) * dim[i + 1];
    • And same order means: i < j if and only if stride for dim[j] <= stride for dim[i].
Warning
Some combinations of physical memory layout and/or offsets or dimensions may result in a failure to make a reshape.
Parameters
out_memory_descOutput memory descriptor.
in_memory_descAn existing memory descriptor. Must have format_kind set to dnnl_blocked or dnnl_format_kind_any.
ndimsNumber of dimensions for the output memory descriptor.
dimsDimensions for the output memory descriptor.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_destroy ( dnnl_memory_t  memory)

Destroys a memory object.

Parameters
memoryMemory object to destroy.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_get_data_handle ( const_dnnl_memory_t  memory,
void **  handle 
)

Returns memory object's data handle.

Parameters
memoryMemory object.
handleOutput data handle. For the CPU engine, the data handle is a pointer to the actual data. For OpenCL it is a cl_mem.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_get_engine ( const_dnnl_memory_t  memory,
dnnl_engine_t engine 
)

Returns the engine of a memory object.

Parameters
memoryMemory object.
engineOutput engine on which the memory is located.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_get_memory_desc ( const_dnnl_memory_t  memory,
const dnnl_memory_desc_t **  memory_desc 
)

Returns the memory descriptor for a memory object.

Parameters
memoryMemory object.
memory_descOutput memory descriptor (a copy).
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_map_data ( const_dnnl_memory_t  memory,
void **  mapped_ptr 
)

Maps a memory object and returns a host-side pointer to a memory buffer with a copy of its contents.

Mapping enables explicit direct access to memory contents for the engines that do not support it implicitly.

Mapping is an exclusive operation - a memory object cannot be used in other operations until this memory object is unmapped.

Note
Any primitives working with memory should be completed before the memory is mapped. Use dnnl_stream_wait to synchronize the corresponding execution stream.
The dnnl_memory_map_data() and dnnl_memory_unmap_data() functions are mainly provided for debug and testing purposes, and their performance may be suboptimal.
Parameters
memoryMemory object.
mapped_ptrOutput pointer to the mapped buffer.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_set_data_handle ( dnnl_memory_t  memory,
void *  handle 
)

Sets the underlying memory buffer.

See the description of dnnl_memory_set_data_handle_v2() for more details.

Parameters
memoryMemory object.
handleData handle. For the CPU engine, the data handle is a pointer to the actual data. For OpenCL it is a cl_mem.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_set_data_handle_v2 ( dnnl_memory_t  memory,
void *  handle,
dnnl_stream_t  stream 
)

Sets the underlying memory buffer.

This function may write zero values to the memory specified by the handle if the memory object has a zero padding area. This may be time consuming and happens each time this function is called. The operation is always blocking and the stream parameter is a hint.

Note
The zero padding is required by memory objects created with blocked memory format tags like dnnl_aBcd8b when any of the dimensions is not a multiple of the corresponding block size. For "plain" formats like dnnl_nchw or dnnl_nhwc zero padding area needs to be set up explicitly when creating the corresponding memory descriptors. See dev_guide_understanding_memory_formats for more details.
Even when the memory object is used to hold values that stay constant during the execution of the program (pre-packed weights during inference, for example), the function will still write zeroes to the padding area if it exists. Hence, the handle parameter cannot and does not have a const qualifier.
Parameters
memoryMemory object.
handleData handle. For the CPU engine, the data handle is a pointer to the actual data. For OpenCL it is a cl_mem.
streamStream to use to execute padding in.
Returns
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_memory_unmap_data ( const_dnnl_memory_t  memory,
void *  mapped_ptr 
)

Unmaps a memory object and writes back any changes made to the previously mapped memory buffer. The pointer to the mapped buffer must be obtained via the dnnl_memory_map_data() call.

Note
The dnnl_memory_map_data() and dnnl_memory_unmap_data() functions are mainly provided for debug and testing purposes, and their performance may be suboptimal.
Parameters
memoryMemory object.
mapped_ptrPointer to the mapped buffer that must have been obtained using the dnnl_memory_map_data() function.
Returns
dnnl_success on success and a status describing the error otherwise.