Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN)  1.0.4
Performance library for Deep Learning
mkldnn.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2016-2019 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 MKLDNN_H
21 #define MKLDNN_H
22 
23 #include "mkldnn_config.h"
24 #include "mkldnn_types.h"
25 #include "mkldnn_version.h"
26 
27 #ifndef DOXYGEN_SHOULD_SKIP_THIS
28 #if MKLDNN_GPU_RUNTIME == MKLDNN_RUNTIME_OCL
29 # include <CL/cl.h>
30 #endif
31 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
39 
42 
45 
53  mkldnn_engine_t engine,
54  const_mkldnn_primitive_desc_t hint_forward_primitive_desc);
55 
60 
68 
72 
78  mkldnn_primitive_desc_t *primitive_desc,
80  mkldnn_engine_t engine,
81  const_mkldnn_primitive_desc_t hint_forward_primitive_desc);
82 
85  mkldnn_primitive_desc_t *primitive_desc,
86  const_mkldnn_primitive_desc_t existing_primitive_desc);
87 
98  const_mkldnn_primitive_desc_t primitive_desc,
100 
103  mkldnn_primitive_desc_t primitive_desc);
104 
135  const_mkldnn_primitive_desc_t primitive_desc, mkldnn_query_t what,
136  int index, void *result);
137 
145  const_mkldnn_primitive_desc_t primitive_desc, mkldnn_query_t what,
146  int index);
147 
156 int MKLDNN_API mkldnn_primitive_desc_query_s32(
157  const_mkldnn_primitive_desc_t primitive_desc, mkldnn_query_t what,
158  int index);
159 
162  mkldnn_primitive_t *primitive,
163  const_mkldnn_primitive_desc_t primitive_desc);
164 
168  const_mkldnn_primitive_t primitive, mkldnn_stream_t stream,
169  int nargs, const mkldnn_exec_arg_t *args);
170 
178  const_mkldnn_primitive_t primitive,
179  const_mkldnn_primitive_desc_t *primitive_desc);
180 
183  mkldnn_primitive_t primitive);
184 
186 
190 
198 
202  const_mkldnn_primitive_attr_t existing_attr);
203 
207 
211 
218 
231  const_mkldnn_primitive_attr_t attr, mkldnn_dim_t *count, int *mask,
232  const float **scales);
233 
273  mkldnn_primitive_attr_t attr, mkldnn_dim_t count, int mask,
274  const float *scales);
275 
285 
296 
300 
303 
306 
308 int MKLDNN_API mkldnn_post_ops_len(const_mkldnn_post_ops_t post_ops);
309 
313  const_mkldnn_post_ops_t post_ops, int index);
314 
336  mkldnn_post_ops_t post_ops, float scale);
337 
345  const_mkldnn_post_ops_t post_ops, int index, float *scale);
346 
358  mkldnn_post_ops_t post_ops, float scale, mkldnn_alg_kind_t alg,
359  float alpha, float beta);
360 
364  const_mkldnn_post_ops_t post_ops, int index, float *scale,
365  mkldnn_alg_kind_t *alg, float *alpha, float *beta);
366 
368 
370 
444 
454  mkldnn_memory_desc_t *memory_desc, int ndims, const mkldnn_dims_t dims,
455  mkldnn_data_type_t data_type, const mkldnn_dims_t strides);
456 
464  mkldnn_memory_desc_t *memory_desc, int ndims, const mkldnn_dims_t dims,
465  mkldnn_data_type_t data_type, mkldnn_format_tag_t tag);
466 
472  mkldnn_memory_desc_t *memory_desc,
473  const mkldnn_memory_desc_t *parent_memory_desc,
474  const mkldnn_dims_t dims, const mkldnn_dims_t offsets);
475 
482 int MKLDNN_API mkldnn_memory_desc_equal(
483  const mkldnn_memory_desc_t *lhs,
484  const mkldnn_memory_desc_t *rhs);
485 
487 size_t MKLDNN_API mkldnn_memory_desc_get_size(
488  const mkldnn_memory_desc_t *memory_desc);
489 
498  const mkldnn_memory_desc_t *memory_desc, mkldnn_engine_t engine,
499  void *handle);
500 
503  const_mkldnn_memory_t memory,
504  const mkldnn_memory_desc_t **memory_desc);
505 
508  const_mkldnn_memory_t memory, mkldnn_engine_t *engine);
509 
525  const_mkldnn_memory_t memory, void **mapped_ptr);
526 
536  const_mkldnn_memory_t memory, void *mapped_ptr);
537 
542  const_mkldnn_memory_t memory, void **handle);
543 
546  mkldnn_memory_t memory, void *handle);
547 
548 #if MKLDNN_GPU_RUNTIME == MKLDNN_RUNTIME_OCL
549 mkldnn_status_t MKLDNN_API mkldnn_memory_get_ocl_mem_object(
551  const_mkldnn_memory_t memory, cl_mem *mem_object);
552 
554 mkldnn_status_t MKLDNN_API mkldnn_memory_set_ocl_mem_object(
555  mkldnn_memory_t memory, cl_mem mem_object);
556 #endif
557 
560 
562 
569 
580  mkldnn_primitive_desc_t *reorder_primitive_desc,
581  const mkldnn_memory_desc_t *src_md, mkldnn_engine_t src_engine,
582  const mkldnn_memory_desc_t *dst_md, mkldnn_engine_t dst_engine,
584 
586 
593 
609  mkldnn_primitive_desc_t *concat_primitive_desc,
610  const mkldnn_memory_desc_t *dst_md,
611  int n, int concat_dimension,
612  const mkldnn_memory_desc_t *src_mds,
614  mkldnn_engine_t engine);
615 
617 
624 
640  mkldnn_primitive_desc_t *sum_primitive_desc,
641  const mkldnn_memory_desc_t *dst_mds,
642  int n, const float *scales,
643  const mkldnn_memory_desc_t *src_mds,
645  mkldnn_engine_t engine);
646 
648 
656 
678  mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc,
679  const mkldnn_memory_desc_t *weights_desc,
680  const mkldnn_memory_desc_t *bias_desc,
681  const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides,
682  const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r);
683 
706  mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc,
707  const mkldnn_memory_desc_t *weights_desc,
708  const mkldnn_memory_desc_t *bias_desc,
709  const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides,
710  const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l,
711  const mkldnn_dims_t padding_r);
712 
727  mkldnn_convolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind,
728  const mkldnn_memory_desc_t *diff_src_desc,
729  const mkldnn_memory_desc_t *weights_desc,
730  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
731  const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r);
732 
747  mkldnn_convolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind,
748  const mkldnn_memory_desc_t *diff_src_desc,
749  const mkldnn_memory_desc_t *weights_desc,
750  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
751  const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l,
752  const mkldnn_dims_t padding_r);
753 
769  mkldnn_convolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind,
770  const mkldnn_memory_desc_t *src_desc,
771  const mkldnn_memory_desc_t *diff_weights_desc,
772  const mkldnn_memory_desc_t *diff_bias_desc,
773  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
774  const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r);
775 
790 mkldnn_status_t MKLDNN_API
792  mkldnn_convolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind,
793  const mkldnn_memory_desc_t *src_desc,
794  const mkldnn_memory_desc_t *diff_weights_desc,
795  const mkldnn_memory_desc_t *diff_bias_desc,
796  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
797  const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l,
798  const mkldnn_dims_t padding_r);
799 
801 
806 
807 
829  mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc,
830  const mkldnn_memory_desc_t *weights_desc,
831  const mkldnn_memory_desc_t *bias_desc,
832  const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides,
833  const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r);
834 
857  mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc,
858  const mkldnn_memory_desc_t *weights_desc,
859  const mkldnn_memory_desc_t *bias_desc,
860  const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides,
861  const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l,
862  const mkldnn_dims_t padding_r);
863 
878  mkldnn_deconvolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind,
879  const mkldnn_memory_desc_t *diff_src_desc,
880  const mkldnn_memory_desc_t *weights_desc,
881  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
882  const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r);
883 
898  mkldnn_deconvolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind,
899  const mkldnn_memory_desc_t *diff_src_desc,
900  const mkldnn_memory_desc_t *weights_desc,
901  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
902  const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l,
903  const mkldnn_dims_t padding_r);
904 
920  mkldnn_deconvolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind,
921  const mkldnn_memory_desc_t *src_desc,
922  const mkldnn_memory_desc_t *diff_weights_desc,
923  const mkldnn_memory_desc_t *diff_bias_desc,
924  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
925  const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r);
926 
942  mkldnn_deconvolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind,
943  const mkldnn_memory_desc_t *src_desc,
944  const mkldnn_memory_desc_t *diff_weights_desc,
945  const mkldnn_memory_desc_t *diff_bias_desc,
946  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
947  const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l,
948  const mkldnn_dims_t padding_r);
949 
951 
958 
970  const mkldnn_memory_desc_t *data_desc, int axis,
971  mkldnn_dim_t group_size);
972 
984  mkldnn_shuffle_desc_t *shuffle_desc,
985  const mkldnn_memory_desc_t *diff_data_desc, int axis,
986  mkldnn_dim_t group_size);
987 
989 
1008 
1023  mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *data_desc,
1024  float alpha, float beta);
1025 
1039  mkldnn_eltwise_desc_t *eltwise_desc, mkldnn_alg_kind_t alg_kind,
1040  const mkldnn_memory_desc_t *diff_data_desc,
1041  const mkldnn_memory_desc_t *data_desc, float alpha, float beta);
1042 
1044 
1051 
1063  const mkldnn_memory_desc_t *data_desc, int softmax_axis);
1064 
1075  mkldnn_softmax_desc_t *softmax_desc,
1076  const mkldnn_memory_desc_t *diff_desc,
1077  const mkldnn_memory_desc_t *data_desc, int softmax_axis);
1078 
1080 
1088 
1107  mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc,
1108  const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides,
1109  const mkldnn_dims_t kernel, const mkldnn_dims_t padding_l,
1110  const mkldnn_dims_t padding_r);
1111 
1126  mkldnn_pooling_desc_t *pool_desc, mkldnn_alg_kind_t alg_kind,
1127  const mkldnn_memory_desc_t *diff_src_desc,
1128  const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides,
1129  const mkldnn_dims_t kernel, const mkldnn_dims_t padding_l,
1130  const mkldnn_dims_t padding_r);
1131 
1133 
1144 
1159  mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *data_desc,
1160  mkldnn_dim_t local_size, float alpha, float beta, float k);
1161 
1175  mkldnn_lrn_desc_t *lrn_desc, mkldnn_alg_kind_t alg_kind,
1176  const mkldnn_memory_desc_t *diff_data_desc,
1177  const mkldnn_memory_desc_t *data_desc, mkldnn_dim_t local_size,
1178  float alpha, float beta, float k);
1179 
1181 
1201 
1236  float epsilon, unsigned flags);
1237 
1267  const mkldnn_memory_desc_t *diff_data_desc,
1268  const mkldnn_memory_desc_t *data_desc,
1269  float epsilon, unsigned flags);
1270 
1272 
1279 
1299  const mkldnn_memory_desc_t *src_desc,
1300  const mkldnn_memory_desc_t *weights_desc,
1301  const mkldnn_memory_desc_t *bias_desc,
1302  const mkldnn_memory_desc_t *dst_desc);
1303 
1317  mkldnn_inner_product_desc_t *ip_desc,
1318  const mkldnn_memory_desc_t *diff_src_desc,
1319  const mkldnn_memory_desc_t *weights_desc,
1320  const mkldnn_memory_desc_t *diff_dst_desc);
1321 
1336  mkldnn_inner_product_desc_t *ip_desc,
1337  const mkldnn_memory_desc_t *src_desc,
1338  const mkldnn_memory_desc_t *diff_weights_desc,
1339  const mkldnn_memory_desc_t *diff_bias_desc,
1340  const mkldnn_memory_desc_t *diff_dst_desc);
1341 
1343 
1350 
1379  mkldnn_primitive_attr_t attr, const float scale, const float shift);
1380 
1424  mkldnn_primitive_attr_t attr, mkldnn_dim_t count, int mask,
1425  const float *weights_scales);
1426 
1459  const mkldnn_alg_kind_t activation,
1460  const mkldnn_rnn_direction_t direction,
1461  const mkldnn_memory_desc_t *src_layer_desc,
1462  const mkldnn_memory_desc_t *src_iter_desc,
1463  const mkldnn_memory_desc_t *weights_layer_desc,
1464  const mkldnn_memory_desc_t *weights_iter_desc,
1465  const mkldnn_memory_desc_t *bias_desc,
1466  const mkldnn_memory_desc_t *dst_layer_desc,
1467  const mkldnn_memory_desc_t *dst_iter_desc,
1468  unsigned flags,
1469  float alpha, float beta);
1470 
1509  const mkldnn_alg_kind_t activation,
1510  const mkldnn_rnn_direction_t direction,
1511  const mkldnn_memory_desc_t *src_layer_desc,
1512  const mkldnn_memory_desc_t *src_iter_desc,
1513  const mkldnn_memory_desc_t *weights_layer_desc,
1514  const mkldnn_memory_desc_t *weights_iter_desc,
1515  const mkldnn_memory_desc_t *bias_desc,
1516  const mkldnn_memory_desc_t *dst_layer_desc,
1517  const mkldnn_memory_desc_t *dst_iter_desc,
1518  const mkldnn_memory_desc_t *diff_src_layer_desc,
1519  const mkldnn_memory_desc_t *diff_src_iter_desc,
1520  const mkldnn_memory_desc_t *diff_weights_layer_desc,
1521  const mkldnn_memory_desc_t *diff_weights_iter_desc,
1522  const mkldnn_memory_desc_t *diff_bias_desc,
1523  const mkldnn_memory_desc_t *diff_dst_layer_desc,
1524  const mkldnn_memory_desc_t *diff_dst_iter_desc,
1525  unsigned flags,
1526  float alpha, float beta);
1527 
1559  mkldnn_rnn_direction_t direction,
1560  const mkldnn_memory_desc_t *src_layer_desc,
1561  const mkldnn_memory_desc_t *src_iter_desc,
1562  const mkldnn_memory_desc_t *src_iter_c_desc,
1563  const mkldnn_memory_desc_t *weights_layer_desc,
1564  const mkldnn_memory_desc_t *weights_iter_desc,
1565  const mkldnn_memory_desc_t *bias_desc,
1566  const mkldnn_memory_desc_t *dst_layer_desc,
1567  const mkldnn_memory_desc_t *dst_iter_desc,
1568  const mkldnn_memory_desc_t *dst_iter_c_desc,
1569  unsigned flags);
1570 
1610  mkldnn_rnn_direction_t direction,
1611  const mkldnn_memory_desc_t *src_layer_desc,
1612  const mkldnn_memory_desc_t *src_iter_desc,
1613  const mkldnn_memory_desc_t *src_iter_c_desc,
1614  const mkldnn_memory_desc_t *weights_layer_desc,
1615  const mkldnn_memory_desc_t *weights_iter_desc,
1616  const mkldnn_memory_desc_t *bias_desc,
1617  const mkldnn_memory_desc_t *dst_layer_desc,
1618  const mkldnn_memory_desc_t *dst_iter_desc,
1619  const mkldnn_memory_desc_t *dst_iter_c_desc,
1620  const mkldnn_memory_desc_t *diff_src_layer_desc,
1621  const mkldnn_memory_desc_t *diff_src_iter_desc,
1622  const mkldnn_memory_desc_t *diff_src_iter_c_desc,
1623  const mkldnn_memory_desc_t *diff_weights_layer_desc,
1624  const mkldnn_memory_desc_t *diff_weights_iter_desc,
1625  const mkldnn_memory_desc_t *diff_bias_desc,
1626  const mkldnn_memory_desc_t *diff_dst_layer_desc,
1627  const mkldnn_memory_desc_t *diff_dst_iter_desc,
1628  const mkldnn_memory_desc_t *diff_dst_iter_c_desc,
1629  unsigned flags);
1630 
1660  mkldnn_rnn_direction_t direction,
1661  const mkldnn_memory_desc_t *src_layer_desc,
1662  const mkldnn_memory_desc_t *src_iter_desc,
1663  const mkldnn_memory_desc_t *weights_layer_desc,
1664  const mkldnn_memory_desc_t *weights_iter_desc,
1665  const mkldnn_memory_desc_t *bias_desc,
1666  const mkldnn_memory_desc_t *dst_layer_desc,
1667  const mkldnn_memory_desc_t *dst_iter_desc,
1668  unsigned flags);
1669 
1705  mkldnn_rnn_direction_t direction,
1706  const mkldnn_memory_desc_t *src_layer_desc,
1707  const mkldnn_memory_desc_t *src_iter_desc,
1708  const mkldnn_memory_desc_t *weights_layer_desc,
1709  const mkldnn_memory_desc_t *weights_iter_desc,
1710  const mkldnn_memory_desc_t *bias_desc,
1711  const mkldnn_memory_desc_t *dst_layer_desc,
1712  const mkldnn_memory_desc_t *dst_iter_desc,
1713  const mkldnn_memory_desc_t *diff_src_layer_desc,
1714  const mkldnn_memory_desc_t *diff_src_iter_desc,
1715  const mkldnn_memory_desc_t *diff_weights_layer_desc,
1716  const mkldnn_memory_desc_t *diff_weights_iter_desc,
1717  const mkldnn_memory_desc_t *diff_bias_desc,
1718  const mkldnn_memory_desc_t *diff_dst_layer_desc,
1719  const mkldnn_memory_desc_t *diff_dst_iter_desc,
1720  unsigned flags);
1721 
1751  mkldnn_rnn_direction_t direction,
1752  const mkldnn_memory_desc_t *src_layer_desc,
1753  const mkldnn_memory_desc_t *src_iter_desc,
1754  const mkldnn_memory_desc_t *weights_layer_desc,
1755  const mkldnn_memory_desc_t *weights_iter_desc,
1756  const mkldnn_memory_desc_t *bias_desc,
1757  const mkldnn_memory_desc_t *dst_layer_desc,
1758  const mkldnn_memory_desc_t *dst_iter_desc,
1759  unsigned flags);
1760 
1796  mkldnn_rnn_direction_t direction,
1797  const mkldnn_memory_desc_t *src_layer_desc,
1798  const mkldnn_memory_desc_t *src_iter_desc,
1799  const mkldnn_memory_desc_t *weights_layer_desc,
1800  const mkldnn_memory_desc_t *weights_iter_desc,
1801  const mkldnn_memory_desc_t *bias_desc,
1802  const mkldnn_memory_desc_t *dst_layer_desc,
1803  const mkldnn_memory_desc_t *dst_iter_desc,
1804  const mkldnn_memory_desc_t *diff_src_layer_desc,
1805  const mkldnn_memory_desc_t *diff_src_iter_desc,
1806  const mkldnn_memory_desc_t *diff_weights_layer_desc,
1807  const mkldnn_memory_desc_t *diff_weights_iter_desc,
1808  const mkldnn_memory_desc_t *diff_bias_desc,
1809  const mkldnn_memory_desc_t *diff_dst_layer_desc,
1810  const mkldnn_memory_desc_t *diff_dst_iter_desc,
1811  unsigned flags);
1812 
1814 
1816 
1819 
1821 size_t MKLDNN_API mkldnn_engine_get_count(mkldnn_engine_kind_t kind);
1822 
1825  mkldnn_engine_kind_t kind, size_t index);
1826 
1827 #if MKLDNN_GPU_RUNTIME == MKLDNN_RUNTIME_OCL
1828 mkldnn_status_t MKLDNN_API mkldnn_engine_create_ocl(mkldnn_engine_t *engine,
1831  mkldnn_engine_kind_t kind, cl_device_id device, cl_context context);
1832 #endif
1833 
1836  mkldnn_engine_kind_t *kind);
1837 
1838 #if MKLDNN_GPU_RUNTIME == MKLDNN_RUNTIME_OCL
1839 mkldnn_status_t MKLDNN_API mkldnn_engine_get_ocl_context(
1841  mkldnn_engine_t engine, cl_context *context);
1842 
1844 mkldnn_status_t MKLDNN_API mkldnn_engine_get_ocl_device(
1845  mkldnn_engine_t engine, cl_device_id *device);
1846 #endif
1847 
1850  mkldnn_engine_kind_t *kind);
1851 
1854 
1856 
1859 
1862  mkldnn_engine_t engine, unsigned flags);
1863 
1864 #if MKLDNN_GPU_RUNTIME == MKLDNN_RUNTIME_OCL
1865 mkldnn_status_t MKLDNN_API mkldnn_stream_create_ocl(mkldnn_stream_t *stream,
1868  mkldnn_engine_t engine, cl_command_queue queue);
1869 
1872 mkldnn_status_t MKLDNN_API mkldnn_stream_get_ocl_command_queue(
1873  mkldnn_stream_t stream, cl_command_queue *queue);
1874 #endif
1875 
1878 
1881 
1883 
1886 
1896 mkldnn_status_t MKLDNN_API mkldnn_set_verbose(int level);
1897 
1905 mkldnn_status_t MKLDNN_API mkldnn_set_jit_dump(int enable);
1906 
1913 const mkldnn_version_t MKLDNN_API *mkldnn_version();
1914 
1916 
1921 
1940 mkldnn_status_t MKLDNN_API mkldnn_sgemm(
1941  char transa, char transb,
1943  float alpha, const float *A, mkldnn_dim_t lda,
1944  const float *B, mkldnn_dim_t ldb,
1945  float beta, float *C, mkldnn_dim_t ldc);
1946 
1985  char transa, char transb, char offsetc,
1987  float alpha,
1988  const uint8_t *A, mkldnn_dim_t lda, uint8_t ao,
1989  const int8_t *B, mkldnn_dim_t ldb, int8_t bo,
1990  float beta, int32_t *C, mkldnn_dim_t ldc, const int32_t *co);
1991 
2004  char transa, char transb, char offsetc,
2006  float alpha,
2007  const int8_t *A, mkldnn_dim_t lda, int8_t ao,
2008  const int8_t *B, mkldnn_dim_t ldb, int8_t bo,
2009  float beta, int32_t *C, mkldnn_dim_t ldc, const int32_t *co);
2011 
2013 
2014 #ifdef __cplusplus
2015 }
2016 #endif
2017 
2018 #endif
A descriptor of a Local Response Normalization (LRN) operation.
Definition: mkldnn_types.h:1081
mkldnn_status_t MKLDNN_API mkldnn_lbr_gru_backward_desc_init(mkldnn_rnn_desc_t *rnn_desc, mkldnn_prop_kind_t prop_kind, mkldnn_rnn_direction_t direction, const mkldnn_memory_desc_t *src_layer_desc, const mkldnn_memory_desc_t *src_iter_desc, const mkldnn_memory_desc_t *weights_layer_desc, const mkldnn_memory_desc_t *weights_iter_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_layer_desc, const mkldnn_memory_desc_t *dst_iter_desc, const mkldnn_memory_desc_t *diff_src_layer_desc, const mkldnn_memory_desc_t *diff_src_iter_desc, const mkldnn_memory_desc_t *diff_weights_layer_desc, const mkldnn_memory_desc_t *diff_weights_iter_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_layer_desc, const mkldnn_memory_desc_t *diff_dst_iter_desc, unsigned flags)
Initializes an LBR GRU descriptor rnn_desc for backward propagation using prop_kind, direction, and memory descriptors.
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_destroy(mkldnn_primitive_attr_t attr)
Deletes an attr.
mkldnn_status_t MKLDNN_API mkldnn_stream_destroy(mkldnn_stream_t stream)
Destroys an execution stream.
mkldnn_status_t
Status values returned by the library functions.
Definition: mkldnn_types.h:50
mkldnn_status_t MKLDNN_API mkldnn_lstm_forward_desc_init(mkldnn_rnn_desc_t *rnn_desc, mkldnn_prop_kind_t prop_kind, mkldnn_rnn_direction_t direction, const mkldnn_memory_desc_t *src_layer_desc, const mkldnn_memory_desc_t *src_iter_desc, const mkldnn_memory_desc_t *src_iter_c_desc, const mkldnn_memory_desc_t *weights_layer_desc, const mkldnn_memory_desc_t *weights_iter_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_layer_desc, const mkldnn_memory_desc_t *dst_iter_desc, const mkldnn_memory_desc_t *dst_iter_c_desc, unsigned flags)
Initializes an LSTM descriptor rnn_desc for forward propagation using prop_kind, direction, and memory descriptors.
A descriptor of a convolution operation.
Definition: mkldnn_types.h:938
mkldnn_dim_t mkldnn_dims_t[MKLDNN_MAX_NDIMS]
A type to describe tensor dimensions.
Definition: mkldnn_types.h:763
mkldnn_status_t MKLDNN_API mkldnn_dilated_convolution_backward_weights_desc_init(mkldnn_convolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *diff_weights_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a convolution descriptor conv_desc for backward propagation with respect to weights using...
mkldnn_status_t MKLDNN_API mkldnn_post_ops_create(mkldnn_post_ops_t *post_ops)
Creates an empty sequence of post operations post_ops.
mkldnn_status_t MKLDNN_API mkldnn_primitive_desc_destroy(mkldnn_primitive_desc_t primitive_desc)
Deletes a primitive_desc.
int MKLDNN_API mkldnn_memory_desc_equal(const mkldnn_memory_desc_t *lhs, const mkldnn_memory_desc_t *rhs)
Compares two memory descriptors.
An opaque structure to describe an engine.
mkldnn_status_t MKLDNN_API mkldnn_primitive_desc_get_attr(const_mkldnn_primitive_desc_t primitive_desc, const_mkldnn_primitive_attr_t *attr)
Returns a constant reference to the attribute of a primitive_desc.
mkldnn_status_t MKLDNN_API mkldnn_memory_get_memory_desc(const_mkldnn_memory_t memory, const mkldnn_memory_desc_t **memory_desc)
Returns a memory_desc associated with memory.
mkldnn_status_t MKLDNN_API mkldnn_stream_create(mkldnn_stream_t *stream, mkldnn_engine_t engine, unsigned flags)
Creates an execution stream for engine and with flags.
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_clone(mkldnn_primitive_attr_t *attr, const_mkldnn_primitive_attr_t existing_attr)
Makes a copy of an existing_attr.
mkldnn_status_t MKLDNN_API mkldnn_lrn_forward_desc_init(mkldnn_lrn_desc_t *lrn_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *data_desc, mkldnn_dim_t local_size, float alpha, float beta, float k)
Initializes an lrn_desc for forward propagation using prop_kind (possible values are mkldnn_forward_t...
A descriptor of a Softmax operation.
Definition: mkldnn_types.h:1032
mkldnn_status_t MKLDNN_API mkldnn_primitive_desc_clone(mkldnn_primitive_desc_t *primitive_desc, const_mkldnn_primitive_desc_t existing_primitive_desc)
Makes a copy of a primitive_desc.
mkldnn_status_t MKLDNN_API mkldnn_deconvolution_backward_data_desc_init(mkldnn_deconvolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a deconvolution descriptor conv_desc for backward propagation with respect to data using ...
mkldnn_status_t MKLDNN_API mkldnn_memory_unmap_data(const_mkldnn_memory_t memory, void *mapped_ptr)
For a memory, unmaps a mapped pointer to the data of the memory.
A descriptor of an inner product operation.
Definition: mkldnn_types.h:1135
mkldnn_status_t MKLDNN_API mkldnn_post_ops_destroy(mkldnn_post_ops_t post_ops)
Deletes a post_ops sequence.
An opaque structure for a chain of post operations.
An opaque structure to describe a primitive descriptor.
mkldnn_rnn_direction_t
A direction of RNN primitive execution.
Definition: mkldnn_types.h:1169
mkldnn_status_t MKLDNN_API mkldnn_batch_normalization_forward_desc_init(mkldnn_batch_normalization_desc_t *bnrm_desc, mkldnn_prop_kind_t prop_kind, const mkldnn_memory_desc_t *data_desc, float epsilon, unsigned flags)
Initializes a batch normalization descriptor bnrm_desc for forward propagation using prop_kind (possi...
mkldnn_status_t MKLDNN_API mkldnn_vanilla_rnn_backward_desc_init(mkldnn_rnn_desc_t *rnn_desc, mkldnn_prop_kind_t prop_kind, const mkldnn_alg_kind_t activation, const mkldnn_rnn_direction_t direction, const mkldnn_memory_desc_t *src_layer_desc, const mkldnn_memory_desc_t *src_iter_desc, const mkldnn_memory_desc_t *weights_layer_desc, const mkldnn_memory_desc_t *weights_iter_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_layer_desc, const mkldnn_memory_desc_t *dst_iter_desc, const mkldnn_memory_desc_t *diff_src_layer_desc, const mkldnn_memory_desc_t *diff_src_iter_desc, const mkldnn_memory_desc_t *diff_weights_layer_desc, const mkldnn_memory_desc_t *diff_weights_iter_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_layer_desc, const mkldnn_memory_desc_t *diff_dst_iter_desc, unsigned flags, float alpha, float beta)
Initializes an RNN descriptor rnn_desc for backward propagation using prop_kind, activation, direction, and memory descriptors.
mkldnn_status_t MKLDNN_API mkldnn_post_ops_append_eltwise(mkldnn_post_ops_t post_ops, float scale, mkldnn_alg_kind_t alg, float alpha, float beta)
Appends eltwise post operation to the post_ops with given parameters kind, alpha, and beta (...
mkldnn_status_t MKLDNN_API mkldnn_pooling_forward_desc_init(mkldnn_pooling_desc_t *pool_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t kernel, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a pooling descriptor pool_desc for forward propagation using prop_kind (possible values a...
mkldnn_status_t MKLDNN_API mkldnn_softmax_forward_desc_init(mkldnn_softmax_desc_t *softmax_desc, mkldnn_prop_kind_t prop_kind, const mkldnn_memory_desc_t *data_desc, int softmax_axis)
Initializes a softmax_desc for forward propagation using prop_kind (possible values are mkldnn_forwar...
mkldnn_status_t MKLDNN_API mkldnn_memory_desc_init_by_strides(mkldnn_memory_desc_t *memory_desc, int ndims, const mkldnn_dims_t dims, mkldnn_data_type_t data_type, const mkldnn_dims_t strides)
Initializes a memory_desc memory descriptor using ndims, dims, data_type, and strides.
mkldnn_status_t MKLDNN_API mkldnn_primitive_desc_iterator_next(mkldnn_primitive_desc_iterator_t iterator)
Iterates over primitive descriptors.
mkldnn_status_t MKLDNN_API mkldnn_lrn_backward_desc_init(mkldnn_lrn_desc_t *lrn_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_data_desc, const mkldnn_memory_desc_t *data_desc, mkldnn_dim_t local_size, float alpha, float beta, float k)
Initializes an lrn_desc for backward propagation using alg_kind, memory descriptors data_desc and dif...
mkldnn_status_t MKLDNN_API mkldnn_convolution_backward_weights_desc_init(mkldnn_convolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *diff_weights_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a convolution descriptor conv_desc for backward propagation with respect to weights using...
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_create(mkldnn_primitive_attr_t *attr)
Creates an empty (default) attr attribute.
size_t MKLDNN_API mkldnn_memory_desc_get_size(const mkldnn_memory_desc_t *memory_desc)
Returns the size (in bytes) that is required for given memory_desc.
mkldnn_status_t MKLDNN_API mkldnn_pooling_backward_desc_init(mkldnn_pooling_desc_t *pool_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_src_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t kernel, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a pooling descriptor pool_desc for backward propagation using alg_kind, memory descriptors, and pooling parameters in the spatial domain: strides, kernel sizes, padding_l, and padding_r.
mkldnn_status_t MKLDNN_API mkldnn_dilated_convolution_backward_data_desc_init(mkldnn_convolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a dilated convolution descriptor conv_desc for backward propagation with respect to data ...
A descriptor of a element-wise operation.
Definition: mkldnn_types.h:998
mkldnn_status_t MKLDNN_API mkldnn_primitive_execute(const_mkldnn_primitive_t primitive, mkldnn_stream_t stream, int nargs, const mkldnn_exec_arg_t *args)
Executes a primitive using a stream, and nargs arguments args.
mkldnn_status_t MKLDNN_API mkldnn_vanilla_rnn_forward_desc_init(mkldnn_rnn_desc_t *rnn_desc, mkldnn_prop_kind_t prop_kind, const mkldnn_alg_kind_t activation, const mkldnn_rnn_direction_t direction, const mkldnn_memory_desc_t *src_layer_desc, const mkldnn_memory_desc_t *src_iter_desc, const mkldnn_memory_desc_t *weights_layer_desc, const mkldnn_memory_desc_t *weights_iter_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_layer_desc, const mkldnn_memory_desc_t *dst_iter_desc, unsigned flags, float alpha, float beta)
Initializes an RNN descriptor rnn_desc for forward propagation using prop_kind, activation, direction, and memory descriptors.
A descriptor for an RNN operation.
Definition: mkldnn_types.h:1184
mkldnn_status_t MKLDNN_API mkldnn_convolution_backward_data_desc_init(mkldnn_convolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a convolution descriptor conv_desc for backward propagation with respect to data using al...
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_set_rnn_data_qparams(mkldnn_primitive_attr_t attr, const float scale, const float shift)
Sets quantization scale and shift for RNN data tensors.
size_t MKLDNN_API mkldnn_engine_get_count(mkldnn_engine_kind_t kind)
Returns the number of engines of a particular kind.
An opaque structure to describe a memory.
mkldnn_primitive_kind_t MKLDNN_API mkldnn_post_ops_get_kind(const_mkldnn_post_ops_t post_ops, int index)
Returns the kind of post operation with index index in given post_ops.
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_set_output_scales(mkldnn_primitive_attr_t attr, mkldnn_dim_t count, int mask, const float *scales)
Sets output scales for primitive operations.
Memory descriptor.
Definition: mkldnn_types.h:865
mkldnn_status_t MKLDNN_API mkldnn_inner_product_backward_data_desc_init(mkldnn_inner_product_desc_t *ip_desc, const mkldnn_memory_desc_t *diff_src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *diff_dst_desc)
Initializes an inner product descriptor ip_desc for backward propagation with respect to data using m...
prop_kind
Propagation kind.
Definition: mkldnn.hpp:253
mkldnn_format_tag_t
Memory format tag specification.
Definition: mkldnn_types.h:170
mkldnn_status_t MKLDNN_API mkldnn_dilated_deconvolution_backward_weights_desc_init(mkldnn_deconvolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *diff_weights_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a dilated deconvolution descriptor conv_desc for backward propagation with respect to wei...
mkldnn_status_t MKLDNN_API mkldnn_primitive_desc_iterator_create(mkldnn_primitive_desc_iterator_t *iterator, const_mkldnn_op_desc_t op_desc, const_mkldnn_primitive_attr_t attr, mkldnn_engine_t engine, const_mkldnn_primitive_desc_t hint_forward_primitive_desc)
Creates a primitive descriptor iterator for given op_desc, attr, engine, and optionally a hint primit...
mkldnn_status_t MKLDNN_API mkldnn_engine_create(mkldnn_engine_t *engine, mkldnn_engine_kind_t kind, size_t index)
Creates an engine of particular kind and index.
mkldnn_status_t MKLDNN_API mkldnn_lbr_gru_forward_desc_init(mkldnn_rnn_desc_t *rnn_desc, mkldnn_prop_kind_t prop_kind, mkldnn_rnn_direction_t direction, const mkldnn_memory_desc_t *src_layer_desc, const mkldnn_memory_desc_t *src_iter_desc, const mkldnn_memory_desc_t *weights_layer_desc, const mkldnn_memory_desc_t *weights_iter_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_layer_desc, const mkldnn_memory_desc_t *dst_iter_desc, unsigned flags)
Initializes an LBR GRU descriptor rnn_desc for forward propagation using prop_kind, direction, and memory descriptors.
mkldnn_status_t MKLDNN_API mkldnn_memory_create(mkldnn_memory_t *memory, const mkldnn_memory_desc_t *memory_desc, mkldnn_engine_t engine, void *handle)
Creates a memory for given memory_desc and engine.
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_set_post_ops(mkldnn_primitive_attr_t attr, const_mkldnn_post_ops_t post_ops)
Sets configured post_ops to an attribute attr for future use (when primitive descriptor is being crea...
mkldnn_status_t MKLDNN_API mkldnn_eltwise_forward_desc_init(mkldnn_eltwise_desc_t *eltwise_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *data_desc, float alpha, float beta)
Initializes an eltwise_desc for forward propagation using prop_kind (possible values are mkldnn_forwa...
C API types definitions.
mkldnn_status_t MKLDNN_API mkldnn_primitive_desc_query(const_mkldnn_primitive_desc_t primitive_desc, mkldnn_query_t what, int index, void *result)
Queries primitive descriptor.
A descriptor of a shuffle operation.
Definition: mkldnn_types.h:981
An opaque structure to describe an execution stream.
mkldnn_status_t MKLDNN_API mkldnn_eltwise_backward_desc_init(mkldnn_eltwise_desc_t *eltwise_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_data_desc, const mkldnn_memory_desc_t *data_desc, float alpha, float beta)
Initializes an eltwise_desc for backward propagation using alg_kind algorithm memory descriptors diff...
mkldnn_status_t MKLDNN_API mkldnn_primitive_desc_iterator_destroy(mkldnn_primitive_desc_iterator_t iterator)
Deletes a primitive descriptor iterator.
mkldnn_scratchpad_mode_t
Scratchpad mode.
Definition: mkldnn_types.h:1314
mkldnn_status_t MKLDNN_API mkldnn_post_ops_append_sum(mkldnn_post_ops_t post_ops, float scale)
Appends accumulation (sum) post operation to the post_ops.
mkldnn_status_t MKLDNN_API mkldnn_dilated_convolution_forward_desc_init(mkldnn_convolution_desc_t *conv_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a dilated convolution descriptor conv_desc for forward propagation using prop_kind (possi...
mkldnn_prop_kind_t
Kinds of propagation.
Definition: mkldnn_types.h:584
mkldnn_status_t MKLDNN_API mkldnn_memory_destroy(mkldnn_memory_t memory)
Deletes a memory.
mkldnn_status_t MKLDNN_API mkldnn_softmax_backward_desc_init(mkldnn_softmax_desc_t *softmax_desc, const mkldnn_memory_desc_t *diff_desc, const mkldnn_memory_desc_t *data_desc, int softmax_axis)
Initializes a softmax_desc for backward propagation using memory descriptors diff_desc and data_desc...
mkldnn_status_t MKLDNN_API mkldnn_memory_set_data_handle(mkldnn_memory_t memory, void *handle)
For a memory, sets the data handle.
mkldnn_status_t MKLDNN_API mkldnn_memory_map_data(const_mkldnn_memory_t memory, void **mapped_ptr)
For a memory, maps the data of the memory to mapped_ptr.
An opaque structure for primitive descriptor attributes.
mkldnn_status_t MKLDNN_API mkldnn_shuffle_forward_desc_init(mkldnn_shuffle_desc_t *shuffle_desc, mkldnn_prop_kind_t prop_kind, const mkldnn_memory_desc_t *data_desc, int axis, mkldnn_dim_t group_size)
Initializes a shuffle_desc for forward propagation using prop_kind, memory descriptor data_desc...
mkldnn_status_t MKLDNN_API mkldnn_shuffle_backward_desc_init(mkldnn_shuffle_desc_t *shuffle_desc, const mkldnn_memory_desc_t *diff_data_desc, int axis, mkldnn_dim_t group_size)
Initializes a shuffle_desc for backward propagation using memory descriptor diff_data_desc, axis, and group_size.
mkldnn_status_t MKLDNN_API mkldnn_batch_normalization_backward_desc_init(mkldnn_batch_normalization_desc_t *bnrm_desc, mkldnn_prop_kind_t prop_kind, const mkldnn_memory_desc_t *diff_data_desc, const mkldnn_memory_desc_t *data_desc, float epsilon, unsigned flags)
Initializes a batch normalization descriptor bnrm_desc for backward propagation with respect to data ...
mkldnn_status_t MKLDNN_API mkldnn_sgemm(char transa, char transb, mkldnn_dim_t M, mkldnn_dim_t N, mkldnn_dim_t K, float alpha, const float *A, mkldnn_dim_t lda, const float *B, mkldnn_dim_t ldb, float beta, float *C, mkldnn_dim_t ldc)
SGEMM performs a matrix-matrix multiplication operation defined as.
mkldnn_status_t MKLDNN_API mkldnn_primitive_get_primitive_desc(const_mkldnn_primitive_t primitive, const_mkldnn_primitive_desc_t *primitive_desc)
Retrieves a reference to the primitive_desc descriptor of given primitive.
mkldnn_status_t MKLDNN_API mkldnn_post_ops_get_params_eltwise(const_mkldnn_post_ops_t post_ops, int index, float *scale, mkldnn_alg_kind_t *alg, float *alpha, float *beta)
Gets the eltwise parameters of the post operation with index index in the sequence of post_ops...
mkldnn_status_t MKLDNN_API mkldnn_reorder_primitive_desc_create(mkldnn_primitive_desc_t *reorder_primitive_desc, const mkldnn_memory_desc_t *src_md, mkldnn_engine_t src_engine, const mkldnn_memory_desc_t *dst_md, mkldnn_engine_t dst_engine, const_mkldnn_primitive_attr_t attr)
Initializes a reorder_primitive_desc using the description of the source (src_engine and src_md) and ...
mkldnn_status_t MKLDNN_API mkldnn_post_ops_get_params_sum(const_mkldnn_post_ops_t post_ops, int index, float *scale)
Gets the parameters of the accumulation (sum) post operation with index index in the sequence of post...
mkldnn_status_t MKLDNN_API mkldnn_stream_wait(mkldnn_stream_t stream)
Waits for all primitives in the execution stream to finish.
mkldnn_query_t
Primitive descriptor query specification.
Definition: mkldnn_types.h:1494
A descriptor of a Batch Normalization operation.
Definition: mkldnn_types.h:1107
mkldnn_status_t MKLDNN_API mkldnn_dilated_deconvolution_backward_data_desc_init(mkldnn_deconvolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a dilated deconvolution descriptor conv_desc for backward propagation with respect to dat...
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_get_scratchpad_mode(const_mkldnn_primitive_attr_t attr, mkldnn_scratchpad_mode_t *mode)
Returns the scratchpad mode set in the attribute attr.
A descriptor of a pooling operation.
Definition: mkldnn_types.h:1048
mkldnn_status_t MKLDNN_API mkldnn_lstm_backward_desc_init(mkldnn_rnn_desc_t *rnn_desc, mkldnn_prop_kind_t prop_kind, mkldnn_rnn_direction_t direction, const mkldnn_memory_desc_t *src_layer_desc, const mkldnn_memory_desc_t *src_iter_desc, const mkldnn_memory_desc_t *src_iter_c_desc, const mkldnn_memory_desc_t *weights_layer_desc, const mkldnn_memory_desc_t *weights_iter_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_layer_desc, const mkldnn_memory_desc_t *dst_iter_desc, const mkldnn_memory_desc_t *dst_iter_c_desc, const mkldnn_memory_desc_t *diff_src_layer_desc, const mkldnn_memory_desc_t *diff_src_iter_desc, const mkldnn_memory_desc_t *diff_src_iter_c_desc, const mkldnn_memory_desc_t *diff_weights_layer_desc, const mkldnn_memory_desc_t *diff_weights_iter_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_layer_desc, const mkldnn_memory_desc_t *diff_dst_iter_desc, const mkldnn_memory_desc_t *diff_dst_iter_c_desc, unsigned flags)
Initializes an LSTM descriptor rnn_desc for backward propagation using prop_kind, direction...
mkldnn_status_t MKLDNN_API mkldnn_concat_primitive_desc_create(mkldnn_primitive_desc_t *concat_primitive_desc, const mkldnn_memory_desc_t *dst_md, int n, int concat_dimension, const mkldnn_memory_desc_t *src_mds, const_mkldnn_primitive_attr_t attr, mkldnn_engine_t engine)
Creates out-of-place concat_primitive_desc for concatenation of n inputs by concat_dimension with res...
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_set_scratchpad_mode(mkldnn_primitive_attr_t attr, mkldnn_scratchpad_mode_t mode)
Sets scratchpad mode.
mkldnn_primitive_desc_t MKLDNN_API mkldnn_primitive_desc_iterator_fetch(const_mkldnn_primitive_desc_iterator_t iterator)
Fetches the current primitive descriptor.
int MKLDNN_API mkldnn_primitive_desc_query_s32(const_mkldnn_primitive_desc_t primitive_desc, mkldnn_query_t what, int index)
Queries primitive descriptor for signed 32bit int.
mkldnn_primitive_kind_t
Kinds of primitives.
Definition: mkldnn_types.h:611
mkldnn_status_t MKLDNN_API mkldnn_deconvolution_backward_weights_desc_init(mkldnn_deconvolution_desc_t *conv_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *diff_weights_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a deconvolution descriptor conv_desc for backward propagation with respect to weights usi...
mkldnn_status_t MKLDNN_API mkldnn_gemm_s8s8s32(char transa, char transb, char offsetc, mkldnn_dim_t M, mkldnn_dim_t N, mkldnn_dim_t K, float alpha, const int8_t *A, mkldnn_dim_t lda, int8_t ao, const int8_t *B, mkldnn_dim_t ldb, int8_t bo, float beta, int32_t *C, mkldnn_dim_t ldc, const int32_t *co)
mkldnn_gemm_u8s8s32() and mkldnn_gemm_s8s8s32() perform a matrix-matrix multiplication operation and ...
const mkldnn_version_t MKLDNN_API * mkldnn_version()
Gets library version information.
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_get_post_ops(const_mkldnn_primitive_attr_t attr, const_mkldnn_post_ops_t *post_ops)
Returns post_ops for given attr.
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_get_output_scales(const_mkldnn_primitive_attr_t attr, mkldnn_dim_t *count, int *mask, const float **scales)
Returns count, correspondence scale mask, and a pointer to a constant floating point array of output ...
mkldnn_status_t MKLDNN_API mkldnn_engine_get_kind(mkldnn_engine_t engine, mkldnn_engine_kind_t *kind)
Returns the kind of an engine.
mkldnn_status_t MKLDNN_API mkldnn_engine_destroy(mkldnn_engine_t engine)
Destroys an engine.
mkldnn_status_t MKLDNN_API mkldnn_primitive_desc_create(mkldnn_primitive_desc_t *primitive_desc, const_mkldnn_op_desc_t op_desc, const_mkldnn_primitive_attr_t attr, mkldnn_engine_t engine, const_mkldnn_primitive_desc_t hint_forward_primitive_desc)
Creates a primitive_desc using op_desc, attr, engine, and optionally a hint primitive descriptor from...
mkldnn_status_t MKLDNN_API mkldnn_deconvolution_forward_desc_init(mkldnn_deconvolution_desc_t *conv_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a deconvolution descriptor deconv_desc for forward propagation using prop_kind (possible ...
mkldnn_status_t MKLDNN_API mkldnn_memory_get_engine(const_mkldnn_memory_t memory, mkldnn_engine_t *engine)
Returns an engine associated with memory.
mkldnn_status_t MKLDNN_API mkldnn_sum_primitive_desc_create(mkldnn_primitive_desc_t *sum_primitive_desc, const mkldnn_memory_desc_t *dst_mds, int n, const float *scales, const mkldnn_memory_desc_t *src_mds, const_mkldnn_primitive_attr_t attr, mkldnn_engine_t engine)
Creates out-of-place sum_primitive_desc for sum of n inputs multiplied by scale with resulting output...
mkldnn_status_t MKLDNN_API mkldnn_gru_backward_desc_init(mkldnn_rnn_desc_t *rnn_desc, mkldnn_prop_kind_t prop_kind, mkldnn_rnn_direction_t direction, const mkldnn_memory_desc_t *src_layer_desc, const mkldnn_memory_desc_t *src_iter_desc, const mkldnn_memory_desc_t *weights_layer_desc, const mkldnn_memory_desc_t *weights_iter_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_layer_desc, const mkldnn_memory_desc_t *dst_iter_desc, const mkldnn_memory_desc_t *diff_src_layer_desc, const mkldnn_memory_desc_t *diff_src_iter_desc, const mkldnn_memory_desc_t *diff_weights_layer_desc, const mkldnn_memory_desc_t *diff_weights_iter_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_layer_desc, const mkldnn_memory_desc_t *diff_dst_iter_desc, unsigned flags)
Initializes a GRU descriptor rnn_desc for backward propagation using prop_kind, direction, and memory descriptors.
mkldnn_status_t MKLDNN_API mkldnn_gru_forward_desc_init(mkldnn_rnn_desc_t *rnn_desc, mkldnn_prop_kind_t prop_kind, mkldnn_rnn_direction_t direction, const mkldnn_memory_desc_t *src_layer_desc, const mkldnn_memory_desc_t *src_iter_desc, const mkldnn_memory_desc_t *weights_layer_desc, const mkldnn_memory_desc_t *weights_iter_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_layer_desc, const mkldnn_memory_desc_t *dst_iter_desc, unsigned flags)
Initializes a GRU descriptor rnn_desc for forward propagation using prop_kind, direction, and memory descriptors.
mkldnn_status_t MKLDNN_API mkldnn_set_jit_dump(int enable)
Enables or disables dumping of JIT-generated code.
Version type.
Definition: mkldnn_types.h:42
An opaque structure to describe a primitive.
mkldnn_status_t MKLDNN_API mkldnn_gemm_u8s8s32(char transa, char transb, char offsetc, mkldnn_dim_t M, mkldnn_dim_t N, mkldnn_dim_t K, float alpha, const uint8_t *A, mkldnn_dim_t lda, uint8_t ao, const int8_t *B, mkldnn_dim_t ldb, int8_t bo, float beta, int32_t *C, mkldnn_dim_t ldc, const int32_t *co)
mkldnn_gemm_u8s8s32() and mkldnn_gemm_s8s8s32() perform a matrix-matrix multiplication operation and ...
mkldnn_data_type_t
Data type specification.
Definition: mkldnn_types.h:68
mkldnn_status_t MKLDNN_API mkldnn_memory_desc_init_submemory(mkldnn_memory_desc_t *memory_desc, const mkldnn_memory_desc_t *parent_memory_desc, const mkldnn_dims_t dims, const mkldnn_dims_t offsets)
Initializes a memory_desc for a given parent_memory_desc, with dims sizes and offsets.
mkldnn_engine_kind_t
Kinds of engines.
Definition: mkldnn_types.h:1256
const void * const_mkldnn_op_desc_t
A pointer to any of the operation descriptors (constant variant).
Definition: mkldnn_types.h:935
int MKLDNN_API mkldnn_post_ops_len(const_mkldnn_post_ops_t post_ops)
Returns the length of post operations for given post_ops.
mkldnn_alg_kind_t
Kinds of algorithms.
Definition: mkldnn_types.h:645
mkldnn_status_t MKLDNN_API mkldnn_primitive_create(mkldnn_primitive_t *primitive, const_mkldnn_primitive_desc_t primitive_desc)
Creates a primitive using a primitive_desc descriptor.
const mkldnn_memory_desc_t MKLDNN_API * mkldnn_primitive_desc_query_md(const_mkldnn_primitive_desc_t primitive_desc, mkldnn_query_t what, int index)
Queries primitive descriptor for memory descriptor.
mkldnn_status_t MKLDNN_API mkldnn_primitive_destroy(mkldnn_primitive_t primitive)
Deletes a primitive.
An auxiliary structure to specify primitive&#39;s inputs/outputs at execution.
Definition: mkldnn_types.h:1456
mkldnn_status_t MKLDNN_API mkldnn_convolution_forward_desc_init(mkldnn_convolution_desc_t *conv_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a convolution descriptor conv_desc for forward propagation using prop_kind (possible valu...
mkldnn_status_t MKLDNN_API mkldnn_inner_product_backward_weights_desc_init(mkldnn_inner_product_desc_t *ip_desc, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *diff_weights_desc, const mkldnn_memory_desc_t *diff_bias_desc, const mkldnn_memory_desc_t *diff_dst_desc)
Initializes an inner product descriptor ip_desc for backward propagation with respect to weights usin...
mkldnn_status_t MKLDNN_API mkldnn_set_verbose(int level)
Sets verbosity level (print information to stdout).
mkldnn_status_t MKLDNN_API mkldnn_dilated_deconvolution_forward_desc_init(mkldnn_deconvolution_desc_t *conv_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t dilates, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r)
Initializes a dilated deconvolution descriptor deconv_desc for forward propagation using prop_kind (p...
mkldnn_status_t MKLDNN_API mkldnn_primitive_attr_set_rnn_weights_qparams(mkldnn_primitive_attr_t attr, mkldnn_dim_t count, int mask, const float *weights_scales)
Sets quantization scales weights_scales for RNN weights tensors.
int64_t mkldnn_dim_t
A type to describe tensor dimension.
Definition: mkldnn_types.h:760
An opaque structure to describe a primitive descriptor iterator.
mkldnn_status_t MKLDNN_API mkldnn_memory_desc_init_by_tag(mkldnn_memory_desc_t *memory_desc, int ndims, const mkldnn_dims_t dims, mkldnn_data_type_t data_type, mkldnn_format_tag_t tag)
Initializes a memory_desc memory descriptor using ndims, dims, data_type, and format tag...
mkldnn_status_t MKLDNN_API mkldnn_memory_get_data_handle(const_mkldnn_memory_t memory, void **handle)
For a memory, returns the data handle.
mkldnn_status_t MKLDNN_API mkldnn_inner_product_forward_desc_init(mkldnn_inner_product_desc_t *ip_desc, mkldnn_prop_kind_t prop_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *weights_desc, const mkldnn_memory_desc_t *bias_desc, const mkldnn_memory_desc_t *dst_desc)
Initializes an inner product descriptor ip_desc for forward propagation using prop_kind (possible val...