Deep Neural Network Library (DNNL)  1.1.3
Performance library for Deep Learning
dnnl.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 DNNL_H
21 #define DNNL_H
22 
23 #include "dnnl_config.h"
24 #include "dnnl_types.h"
25 #include "dnnl_version.h"
26 
28 #if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
29 #include <CL/cl.h>
30 #endif
31 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
39 
42 
45 
53  const_dnnl_primitive_desc_t hint_forward_primitive_desc);
54 
59 
67 
71 
77  dnnl_primitive_desc_t *primitive_desc, const_dnnl_op_desc_t op_desc,
79  const_dnnl_primitive_desc_t hint_forward_primitive_desc);
80 
83  dnnl_primitive_desc_t *primitive_desc,
84  const_dnnl_primitive_desc_t existing_primitive_desc);
85 
96  const_dnnl_primitive_desc_t primitive_desc,
98 
101  dnnl_primitive_desc_t primitive_desc);
102 
133  const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what,
134  int index, void *result);
135 
143  const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what,
144  int index);
145 
154 int DNNL_API dnnl_primitive_desc_query_s32(
155  const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what,
156  int index);
157 
160  const_dnnl_primitive_desc_t primitive_desc);
161 
165  dnnl_stream_t stream, int nargs, const dnnl_exec_arg_t *args);
166 
174  const_dnnl_primitive_t primitive,
175  const_dnnl_primitive_desc_t *primitive_desc);
176 
179 
181 
185 
192 
196 
199 
203 
210 
223  const_dnnl_primitive_attr_t attr, dnnl_dim_t *count, int *mask,
224  const float **scales);
225 
265  dnnl_primitive_attr_t attr, dnnl_dim_t count, int mask,
266  const float *scales);
267 
277 
288 
292 
295 
298 
300 int DNNL_API dnnl_post_ops_len(const_dnnl_post_ops_t post_ops);
301 
305  const_dnnl_post_ops_t post_ops, int index);
306 
328  dnnl_post_ops_t post_ops, float scale);
329 
337  const_dnnl_post_ops_t post_ops, int index, float *scale);
338 
350  float scale, dnnl_alg_kind_t alg, float alpha, float beta);
351 
355  const_dnnl_post_ops_t post_ops, int index, float *scale,
356  dnnl_alg_kind_t *alg, float *alpha, float *beta);
357 
359 
361 
435 
445  dnnl_memory_desc_t *memory_desc, int ndims, const dnnl_dims_t dims,
446  dnnl_data_type_t data_type, const dnnl_dims_t strides);
447 
455  dnnl_memory_desc_t *memory_desc, int ndims, const dnnl_dims_t dims,
456  dnnl_data_type_t data_type, dnnl_format_tag_t tag);
457 
463  dnnl_memory_desc_t *memory_desc,
464  const dnnl_memory_desc_t *parent_memory_desc, const dnnl_dims_t dims,
465  const dnnl_dims_t offsets);
466 
476  dnnl_memory_desc_t *out_memory_desc,
477  const dnnl_memory_desc_t *in_memory_desc, int ndims,
478  const dnnl_dims_t dims);
479 
486 int DNNL_API dnnl_memory_desc_equal(
487  const dnnl_memory_desc_t *lhs, const dnnl_memory_desc_t *rhs);
488 
490 size_t DNNL_API dnnl_memory_desc_get_size(
491  const dnnl_memory_desc_t *memory_desc);
492 
501  const dnnl_memory_desc_t *memory_desc, dnnl_engine_t engine,
502  void *handle);
503 
506  const_dnnl_memory_t memory, const dnnl_memory_desc_t **memory_desc);
507 
510  const_dnnl_memory_t memory, dnnl_engine_t *engine);
511 
527  const_dnnl_memory_t memory, void **mapped_ptr);
528 
538  const_dnnl_memory_t memory, void *mapped_ptr);
539 
544  const_dnnl_memory_t memory, void **handle);
545 
548  dnnl_memory_t memory, void *handle);
549 
550 #if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
553  const_dnnl_memory_t memory, cl_mem *mem_object);
554 
557  dnnl_memory_t memory, cl_mem mem_object);
558 #endif
559 
562 
564 
571 
582  dnnl_primitive_desc_t *reorder_primitive_desc,
583  const dnnl_memory_desc_t *src_md, dnnl_engine_t src_engine,
584  const dnnl_memory_desc_t *dst_md, dnnl_engine_t dst_engine,
586 
588 
595 
611  dnnl_primitive_desc_t *concat_primitive_desc,
612  const dnnl_memory_desc_t *dst_md, int n, int concat_dimension,
613  const dnnl_memory_desc_t *src_mds, const_dnnl_primitive_attr_t attr,
614  dnnl_engine_t engine);
615 
617 
624 
640  dnnl_primitive_desc_t *sum_primitive_desc,
641  const dnnl_memory_desc_t *dst_mds, int n, const float *scales,
642  const dnnl_memory_desc_t *src_mds, const_dnnl_primitive_attr_t attr,
643  dnnl_engine_t engine);
644 
646 
653 
672  dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src0_desc,
673  const dnnl_memory_desc_t *src1_desc,
674  const dnnl_memory_desc_t *dst_desc);
675 
677 
685 
707  dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc,
708  const dnnl_memory_desc_t *weights_desc,
709  const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc,
710  const dnnl_dims_t strides, const dnnl_dims_t padding_l,
711  const dnnl_dims_t padding_r);
712 
735  dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc,
736  const dnnl_memory_desc_t *weights_desc,
737  const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc,
738  const dnnl_dims_t strides, const dnnl_dims_t dilates,
739  const dnnl_dims_t padding_l, const dnnl_dims_t padding_r);
740 
755  dnnl_convolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind,
756  const dnnl_memory_desc_t *diff_src_desc,
757  const dnnl_memory_desc_t *weights_desc,
758  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
759  const dnnl_dims_t padding_l, const dnnl_dims_t padding_r);
760 
775  dnnl_convolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind,
776  const dnnl_memory_desc_t *diff_src_desc,
777  const dnnl_memory_desc_t *weights_desc,
778  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
779  const dnnl_dims_t dilates, const dnnl_dims_t padding_l,
780  const dnnl_dims_t padding_r);
781 
797  dnnl_convolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind,
798  const dnnl_memory_desc_t *src_desc,
799  const dnnl_memory_desc_t *diff_weights_desc,
800  const dnnl_memory_desc_t *diff_bias_desc,
801  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
802  const dnnl_dims_t padding_l, const dnnl_dims_t padding_r);
803 
819  dnnl_convolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind,
820  const dnnl_memory_desc_t *src_desc,
821  const dnnl_memory_desc_t *diff_weights_desc,
822  const dnnl_memory_desc_t *diff_bias_desc,
823  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
824  const dnnl_dims_t dilates, const dnnl_dims_t padding_l,
825  const dnnl_dims_t padding_r);
826 
828 
833 
855  dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc,
856  const dnnl_memory_desc_t *weights_desc,
857  const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc,
858  const dnnl_dims_t strides, const dnnl_dims_t padding_l,
859  const dnnl_dims_t padding_r);
860 
883  dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc,
884  const dnnl_memory_desc_t *weights_desc,
885  const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc,
886  const dnnl_dims_t strides, const dnnl_dims_t dilates,
887  const dnnl_dims_t padding_l, const dnnl_dims_t padding_r);
888 
903  dnnl_deconvolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind,
904  const dnnl_memory_desc_t *diff_src_desc,
905  const dnnl_memory_desc_t *weights_desc,
906  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
907  const dnnl_dims_t padding_l, const dnnl_dims_t padding_r);
908 
923  dnnl_deconvolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind,
924  const dnnl_memory_desc_t *diff_src_desc,
925  const dnnl_memory_desc_t *weights_desc,
926  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
927  const dnnl_dims_t dilates, const dnnl_dims_t padding_l,
928  const dnnl_dims_t padding_r);
929 
945  dnnl_deconvolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind,
946  const dnnl_memory_desc_t *src_desc,
947  const dnnl_memory_desc_t *diff_weights_desc,
948  const dnnl_memory_desc_t *diff_bias_desc,
949  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
950  const dnnl_dims_t padding_l, const dnnl_dims_t padding_r);
951 
967  dnnl_deconvolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind,
968  const dnnl_memory_desc_t *src_desc,
969  const dnnl_memory_desc_t *diff_weights_desc,
970  const dnnl_memory_desc_t *diff_bias_desc,
971  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
972  const dnnl_dims_t dilates, const dnnl_dims_t padding_l,
973  const dnnl_dims_t padding_r);
974 
976 
983 
995  const dnnl_memory_desc_t *data_desc, int axis, dnnl_dim_t group_size);
996 
1008  dnnl_shuffle_desc_t *shuffle_desc,
1009  const dnnl_memory_desc_t *diff_data_desc, int axis,
1010  dnnl_dim_t group_size);
1011 
1013 
1032 
1047  dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *data_desc,
1048  float alpha, float beta);
1049 
1063  dnnl_eltwise_desc_t *eltwise_desc, dnnl_alg_kind_t alg_kind,
1064  const dnnl_memory_desc_t *diff_data_desc,
1065  const dnnl_memory_desc_t *data_desc, float alpha, float beta);
1066 
1068 
1075 
1087  const dnnl_memory_desc_t *data_desc, int softmax_axis);
1088 
1099  dnnl_softmax_desc_t *softmax_desc, const dnnl_memory_desc_t *diff_desc,
1100  const dnnl_memory_desc_t *data_desc, int softmax_axis);
1101 
1103 
1111 
1130  dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc,
1131  const dnnl_memory_desc_t *dst_desc, const dnnl_dims_t strides,
1132  const dnnl_dims_t kernel, const dnnl_dims_t padding_l,
1133  const dnnl_dims_t padding_r);
1134 
1149  dnnl_pooling_desc_t *pool_desc, dnnl_alg_kind_t alg_kind,
1150  const dnnl_memory_desc_t *diff_src_desc,
1151  const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides,
1152  const dnnl_dims_t kernel, const dnnl_dims_t padding_l,
1153  const dnnl_dims_t padding_r);
1154 
1156 
1167 
1182  const dnnl_memory_desc_t *data_desc, dnnl_dim_t local_size, float alpha,
1183  float beta, float k);
1184 
1198  dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_data_desc,
1199  const dnnl_memory_desc_t *data_desc, dnnl_dim_t local_size, float alpha,
1200  float beta, float k);
1201 
1203 
1223 
1257  const dnnl_memory_desc_t *data_desc, float epsilon, unsigned flags);
1258 
1287  const dnnl_memory_desc_t *diff_data_desc,
1288  const dnnl_memory_desc_t *data_desc, float epsilon, unsigned flags);
1289 
1291 
1310 
1341  const dnnl_memory_desc_t *data_desc,
1342  const dnnl_memory_desc_t *stat_desc, float epsilon, unsigned flags);
1343 
1370  const dnnl_memory_desc_t *diff_data_desc,
1371  const dnnl_memory_desc_t *data_desc,
1372  const dnnl_memory_desc_t *stat_desc, float epsilon, unsigned flags);
1373 
1375 
1382 
1402  const dnnl_memory_desc_t *src_desc,
1403  const dnnl_memory_desc_t *weights_desc,
1404  const dnnl_memory_desc_t *bias_desc,
1405  const dnnl_memory_desc_t *dst_desc);
1406 
1420  dnnl_inner_product_desc_t *ip_desc,
1421  const dnnl_memory_desc_t *diff_src_desc,
1422  const dnnl_memory_desc_t *weights_desc,
1423  const dnnl_memory_desc_t *diff_dst_desc);
1424 
1439  dnnl_inner_product_desc_t *ip_desc, const dnnl_memory_desc_t *src_desc,
1440  const dnnl_memory_desc_t *diff_weights_desc,
1441  const dnnl_memory_desc_t *diff_bias_desc,
1442  const dnnl_memory_desc_t *diff_dst_desc);
1443 
1445 
1452 
1481  dnnl_primitive_attr_t attr, const float scale, const float shift);
1482 
1526  dnnl_primitive_attr_t attr, dnnl_dim_t count, int mask,
1527  const float *weights_scales);
1528 
1561  const dnnl_alg_kind_t activation, const dnnl_rnn_direction_t direction,
1562  const dnnl_memory_desc_t *src_layer_desc,
1563  const dnnl_memory_desc_t *src_iter_desc,
1564  const dnnl_memory_desc_t *weights_layer_desc,
1565  const dnnl_memory_desc_t *weights_iter_desc,
1566  const dnnl_memory_desc_t *bias_desc,
1567  const dnnl_memory_desc_t *dst_layer_desc,
1568  const dnnl_memory_desc_t *dst_iter_desc, unsigned flags, float alpha,
1569  float beta);
1570 
1609  const dnnl_alg_kind_t activation, const dnnl_rnn_direction_t direction,
1610  const dnnl_memory_desc_t *src_layer_desc,
1611  const dnnl_memory_desc_t *src_iter_desc,
1612  const dnnl_memory_desc_t *weights_layer_desc,
1613  const dnnl_memory_desc_t *weights_iter_desc,
1614  const dnnl_memory_desc_t *bias_desc,
1615  const dnnl_memory_desc_t *dst_layer_desc,
1616  const dnnl_memory_desc_t *dst_iter_desc,
1617  const dnnl_memory_desc_t *diff_src_layer_desc,
1618  const dnnl_memory_desc_t *diff_src_iter_desc,
1619  const dnnl_memory_desc_t *diff_weights_layer_desc,
1620  const dnnl_memory_desc_t *diff_weights_iter_desc,
1621  const dnnl_memory_desc_t *diff_bias_desc,
1622  const dnnl_memory_desc_t *diff_dst_layer_desc,
1623  const dnnl_memory_desc_t *diff_dst_iter_desc, unsigned flags,
1624  float alpha, float beta);
1625 
1657  const dnnl_memory_desc_t *src_layer_desc,
1658  const dnnl_memory_desc_t *src_iter_desc,
1659  const dnnl_memory_desc_t *src_iter_c_desc,
1660  const dnnl_memory_desc_t *weights_layer_desc,
1661  const dnnl_memory_desc_t *weights_iter_desc,
1662  const dnnl_memory_desc_t *bias_desc,
1663  const dnnl_memory_desc_t *dst_layer_desc,
1664  const dnnl_memory_desc_t *dst_iter_desc,
1665  const dnnl_memory_desc_t *dst_iter_c_desc, unsigned flags);
1666 
1706  const dnnl_memory_desc_t *src_layer_desc,
1707  const dnnl_memory_desc_t *src_iter_desc,
1708  const dnnl_memory_desc_t *src_iter_c_desc,
1709  const dnnl_memory_desc_t *weights_layer_desc,
1710  const dnnl_memory_desc_t *weights_iter_desc,
1711  const dnnl_memory_desc_t *bias_desc,
1712  const dnnl_memory_desc_t *dst_layer_desc,
1713  const dnnl_memory_desc_t *dst_iter_desc,
1714  const dnnl_memory_desc_t *dst_iter_c_desc,
1715  const dnnl_memory_desc_t *diff_src_layer_desc,
1716  const dnnl_memory_desc_t *diff_src_iter_desc,
1717  const dnnl_memory_desc_t *diff_src_iter_c_desc,
1718  const dnnl_memory_desc_t *diff_weights_layer_desc,
1719  const dnnl_memory_desc_t *diff_weights_iter_desc,
1720  const dnnl_memory_desc_t *diff_bias_desc,
1721  const dnnl_memory_desc_t *diff_dst_layer_desc,
1722  const dnnl_memory_desc_t *diff_dst_iter_desc,
1723  const dnnl_memory_desc_t *diff_dst_iter_c_desc, unsigned flags);
1724 
1754  const dnnl_memory_desc_t *src_layer_desc,
1755  const dnnl_memory_desc_t *src_iter_desc,
1756  const dnnl_memory_desc_t *weights_layer_desc,
1757  const dnnl_memory_desc_t *weights_iter_desc,
1758  const dnnl_memory_desc_t *bias_desc,
1759  const dnnl_memory_desc_t *dst_layer_desc,
1760  const dnnl_memory_desc_t *dst_iter_desc, unsigned flags);
1761 
1797  const dnnl_memory_desc_t *src_layer_desc,
1798  const dnnl_memory_desc_t *src_iter_desc,
1799  const dnnl_memory_desc_t *weights_layer_desc,
1800  const dnnl_memory_desc_t *weights_iter_desc,
1801  const dnnl_memory_desc_t *bias_desc,
1802  const dnnl_memory_desc_t *dst_layer_desc,
1803  const dnnl_memory_desc_t *dst_iter_desc,
1804  const dnnl_memory_desc_t *diff_src_layer_desc,
1805  const dnnl_memory_desc_t *diff_src_iter_desc,
1806  const dnnl_memory_desc_t *diff_weights_layer_desc,
1807  const dnnl_memory_desc_t *diff_weights_iter_desc,
1808  const dnnl_memory_desc_t *diff_bias_desc,
1809  const dnnl_memory_desc_t *diff_dst_layer_desc,
1810  const dnnl_memory_desc_t *diff_dst_iter_desc, unsigned flags);
1811 
1841  const dnnl_memory_desc_t *src_layer_desc,
1842  const dnnl_memory_desc_t *src_iter_desc,
1843  const dnnl_memory_desc_t *weights_layer_desc,
1844  const dnnl_memory_desc_t *weights_iter_desc,
1845  const dnnl_memory_desc_t *bias_desc,
1846  const dnnl_memory_desc_t *dst_layer_desc,
1847  const dnnl_memory_desc_t *dst_iter_desc, unsigned flags);
1848 
1884  dnnl_rnn_direction_t direction,
1885  const dnnl_memory_desc_t *src_layer_desc,
1886  const dnnl_memory_desc_t *src_iter_desc,
1887  const dnnl_memory_desc_t *weights_layer_desc,
1888  const dnnl_memory_desc_t *weights_iter_desc,
1889  const dnnl_memory_desc_t *bias_desc,
1890  const dnnl_memory_desc_t *dst_layer_desc,
1891  const dnnl_memory_desc_t *dst_iter_desc,
1892  const dnnl_memory_desc_t *diff_src_layer_desc,
1893  const dnnl_memory_desc_t *diff_src_iter_desc,
1894  const dnnl_memory_desc_t *diff_weights_layer_desc,
1895  const dnnl_memory_desc_t *diff_weights_iter_desc,
1896  const dnnl_memory_desc_t *diff_bias_desc,
1897  const dnnl_memory_desc_t *diff_dst_layer_desc,
1898  const dnnl_memory_desc_t *diff_dst_iter_desc, unsigned flags);
1899 
1901 
1903 
1906 
1908 size_t DNNL_API dnnl_engine_get_count(dnnl_engine_kind_t kind);
1909 
1912  dnnl_engine_t *engine, dnnl_engine_kind_t kind, size_t index);
1913 
1914 #if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
1918  dnnl_engine_kind_t kind, cl_device_id device, cl_context context);
1919 #endif
1920 
1923  dnnl_engine_t engine, dnnl_engine_kind_t *kind);
1924 
1925 #if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
1928  dnnl_engine_t engine, cl_context *context);
1929 
1932  dnnl_engine_t engine, cl_device_id *device);
1933 #endif
1934 
1937  dnnl_engine_t engine, dnnl_engine_kind_t *kind);
1938 
1941 
1943 
1946 
1949  dnnl_stream_t *stream, dnnl_engine_t engine, unsigned flags);
1950 
1951 #if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
1955  dnnl_stream_t *stream, dnnl_engine_t engine, cl_command_queue queue);
1956 
1960  dnnl_stream_t stream, cl_command_queue *queue);
1961 #endif
1962 
1965 
1968 
1970 
1973 
1983 dnnl_status_t DNNL_API dnnl_set_verbose(int level);
1984 
1992 dnnl_status_t DNNL_API dnnl_set_jit_dump(int enable);
1993 
2000 const dnnl_version_t DNNL_API *dnnl_version();
2001 
2003 
2008 
2027 dnnl_status_t DNNL_API dnnl_sgemm(char transa, char transb, dnnl_dim_t M,
2028  dnnl_dim_t N, dnnl_dim_t K, float alpha, const float *A, dnnl_dim_t lda,
2029  const float *B, dnnl_dim_t ldb, float beta, float *C, dnnl_dim_t ldc);
2030 
2068 dnnl_status_t DNNL_API dnnl_gemm_u8s8s32(char transa, char transb, char offsetc,
2069  dnnl_dim_t M, dnnl_dim_t N, dnnl_dim_t K, float alpha, const uint8_t *A,
2070  dnnl_dim_t lda, uint8_t ao, const int8_t *B, dnnl_dim_t ldb, int8_t bo,
2071  float beta, int32_t *C, dnnl_dim_t ldc, const int32_t *co);
2072 
2084 dnnl_status_t DNNL_API dnnl_gemm_s8s8s32(char transa, char transb, char offsetc,
2085  dnnl_dim_t M, dnnl_dim_t N, dnnl_dim_t K, float alpha, const int8_t *A,
2086  dnnl_dim_t lda, int8_t ao, const int8_t *B, dnnl_dim_t ldb, int8_t bo,
2087  float beta, int32_t *C, dnnl_dim_t ldc, const int32_t *co);
2089 
2091 
2092 #ifdef __cplusplus
2093 }
2094 #endif
2095 
2096 #endif
dnnl_status_t DNNL_API dnnl_softmax_forward_desc_init(dnnl_softmax_desc_t *softmax_desc, dnnl_prop_kind_t prop_kind, const dnnl_memory_desc_t *data_desc, int softmax_axis)
Initializes a softmax_desc for forward propagation using prop_kind (possible values are dnnl_forward_...
dnnl_data_type_t
Data type specification.
Definition: dnnl_types.h:68
dnnl_status_t DNNL_API dnnl_primitive_attr_destroy(dnnl_primitive_attr_t attr)
Deletes an attr.
A descriptor for an RNN operation.
Definition: dnnl_types.h:1235
dnnl_status_t DNNL_API dnnl_inner_product_backward_weights_desc_init(dnnl_inner_product_desc_t *ip_desc, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *diff_weights_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_desc)
Initializes an inner product descriptor ip_desc for backward propagation with respect to weights usin...
An opaque structure to describe a primitive.
dnnl_status_t DNNL_API dnnl_layer_normalization_backward_desc_init(dnnl_layer_normalization_desc_t *lnrm_desc, dnnl_prop_kind_t prop_kind, const dnnl_memory_desc_t *diff_data_desc, const dnnl_memory_desc_t *data_desc, const dnnl_memory_desc_t *stat_desc, float epsilon, unsigned flags)
Initializes a layer normalization descriptor lnrm_desc for backward propagation with respect to data ...
dnnl_dim_t dnnl_dims_t[DNNL_MAX_NDIMS]
A type to describe tensor dimensions.
Definition: dnnl_types.h:781
dnnl_query_t
Primitive descriptor query specification.
Definition: dnnl_types.h:1558
C API types definitions.
dnnl_status_t DNNL_API dnnl_engine_create_ocl(dnnl_engine_t *engine, dnnl_engine_kind_t kind, cl_device_id device, cl_context context)
Creates an engine of particular kind associated with a given OpenCL device and context objects...
An opaque structure for primitive descriptor attributes.
int64_t dnnl_dim_t
A type to describe tensor dimension.
Definition: dnnl_types.h:778
An opaque structure to describe a memory.
dnnl_status_t DNNL_API dnnl_primitive_execute(const_dnnl_primitive_t primitive, dnnl_stream_t stream, int nargs, const dnnl_exec_arg_t *args)
Executes a primitive using a stream, and nargs arguments args.
dnnl_status_t DNNL_API dnnl_primitive_attr_create(dnnl_primitive_attr_t *attr)
Creates an empty (default) attr attribute.
dnnl_status_t DNNL_API dnnl_set_verbose(int level)
Sets verbosity level (print information to stdout).
dnnl_status_t DNNL_API dnnl_stream_destroy(dnnl_stream_t stream)
Destroys an execution stream.
dnnl_status_t DNNL_API dnnl_primitive_attr_get_scratchpad_mode(const_dnnl_primitive_attr_t attr, dnnl_scratchpad_mode_t *mode)
Returns the scratchpad mode set in the attribute attr.
const dnnl_version_t DNNL_API * dnnl_version()
Gets library version information.
dnnl_status_t DNNL_API dnnl_dilated_convolution_forward_desc_init(dnnl_convolution_desc_t *conv_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc, const dnnl_dims_t strides, const dnnl_dims_t dilates, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a dilated convolution descriptor conv_desc for forward propagation using prop_kind (possi...
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_desc for a given parent_memory_desc, with dims sizes and offsets.
A descriptor of a pooling operation.
Definition: dnnl_types.h:1069
dnnl_status_t DNNL_API dnnl_gru_backward_desc_init(dnnl_rnn_desc_t *rnn_desc, dnnl_prop_kind_t prop_kind, dnnl_rnn_direction_t direction, const dnnl_memory_desc_t *src_layer_desc, const dnnl_memory_desc_t *src_iter_desc, const dnnl_memory_desc_t *weights_layer_desc, const dnnl_memory_desc_t *weights_iter_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_layer_desc, const dnnl_memory_desc_t *dst_iter_desc, const dnnl_memory_desc_t *diff_src_layer_desc, const dnnl_memory_desc_t *diff_src_iter_desc, const dnnl_memory_desc_t *diff_weights_layer_desc, const dnnl_memory_desc_t *diff_weights_iter_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_layer_desc, const dnnl_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.
dnnl_status_t DNNL_API dnnl_primitive_desc_destroy(dnnl_primitive_desc_t primitive_desc)
Deletes a primitive_desc.
const dnnl_memory_desc_t DNNL_API * dnnl_primitive_desc_query_md(const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what, int index)
Queries primitive descriptor for memory descriptor.
dnnl_status_t DNNL_API dnnl_post_ops_get_params_eltwise(const_dnnl_post_ops_t post_ops, int index, float *scale, dnnl_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...
An opaque structure to describe a primitive descriptor iterator.
dnnl_status_t DNNL_API dnnl_lrn_forward_desc_init(dnnl_lrn_desc_t *lrn_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *data_desc, dnnl_dim_t local_size, float alpha, float beta, float k)
Initializes an lrn_desc for forward propagation using prop_kind (possible values are dnnl_forward_tra...
dnnl_status_t DNNL_API dnnl_post_ops_append_sum(dnnl_post_ops_t post_ops, float scale)
Appends accumulation (sum) post operation to the post_ops.
dnnl_status_t DNNL_API dnnl_batch_normalization_backward_desc_init(dnnl_batch_normalization_desc_t *bnrm_desc, dnnl_prop_kind_t prop_kind, const dnnl_memory_desc_t *diff_data_desc, const dnnl_memory_desc_t *data_desc, float epsilon, unsigned flags)
Initializes a batch normalization descriptor bnrm_desc for backward propagation with respect to data ...
dnnl_status_t DNNL_API dnnl_convolution_backward_data_desc_init(dnnl_convolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a convolution descriptor conv_desc for backward propagation with respect to data using al...
dnnl_status_t DNNL_API dnnl_primitive_create(dnnl_primitive_t *primitive, const_dnnl_primitive_desc_t primitive_desc)
Creates a primitive using a primitive_desc descriptor.
int DNNL_API dnnl_memory_desc_equal(const dnnl_memory_desc_t *lhs, const dnnl_memory_desc_t *rhs)
Compares two memory descriptors.
dnnl_primitive_kind_t DNNL_API dnnl_post_ops_get_kind(const_dnnl_post_ops_t post_ops, int index)
Returns the kind of post operation with index index in given post_ops.
dnnl_status_t DNNL_API dnnl_primitive_desc_create(dnnl_primitive_desc_t *primitive_desc, const_dnnl_op_desc_t op_desc, const_dnnl_primitive_attr_t attr, dnnl_engine_t engine, const_dnnl_primitive_desc_t hint_forward_primitive_desc)
Creates a primitive_desc using op_desc, attr, engine, and optionally a hint primitive descriptor from...
dnnl_status_t DNNL_API dnnl_primitive_desc_get_attr(const_dnnl_primitive_desc_t primitive_desc, const_dnnl_primitive_attr_t *attr)
Returns a constant reference to the attribute of a primitive_desc.
dnnl_status_t DNNL_API dnnl_layer_normalization_forward_desc_init(dnnl_layer_normalization_desc_t *lnrm_desc, dnnl_prop_kind_t prop_kind, const dnnl_memory_desc_t *data_desc, const dnnl_memory_desc_t *stat_desc, float epsilon, unsigned flags)
Initializes a layer normalization descriptor lnrm_desc for forward propagation using prop_kind (possi...
dnnl_status_t DNNL_API dnnl_dilated_convolution_backward_data_desc_init(dnnl_convolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t dilates, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a dilated convolution descriptor conv_desc for backward propagation with respect to data ...
A descriptor of a binary operation.
Definition: dnnl_types.h:1302
Version type.
Definition: dnnl_types.h:42
A descriptor of a convolution operation.
Definition: dnnl_types.h:957
dnnl_status_t DNNL_API dnnl_memory_destroy(dnnl_memory_t memory)
Deletes a memory.
dnnl_status_t DNNL_API dnnl_engine_get_ocl_device(dnnl_engine_t engine, cl_device_id *device)
Returns an OpenCL device associated with an engine.
dnnl_status_t DNNL_API dnnl_memory_set_data_handle(dnnl_memory_t memory, void *handle)
For a memory, sets the data handle.
dnnl_primitive_kind_t
Kinds of primitives.
Definition: dnnl_types.h:615
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_desc memory descriptor using ndims, dims, data_type, and strides.
dnnl_status_t DNNL_API dnnl_sgemm(char transa, char transb, dnnl_dim_t M, dnnl_dim_t N, dnnl_dim_t K, float alpha, const float *A, dnnl_dim_t lda, const float *B, dnnl_dim_t ldb, float beta, float *C, dnnl_dim_t ldc)
SGEMM performs a matrix-matrix multiplication operation defined as.
dnnl_status_t DNNL_API dnnl_primitive_attr_set_scratchpad_mode(dnnl_primitive_attr_t attr, dnnl_scratchpad_mode_t mode)
Sets scratchpad mode.
dnnl_status_t DNNL_API dnnl_stream_get_ocl_command_queue(dnnl_stream_t stream, cl_command_queue *queue)
Returns the OpenCL command queue associated with an execution stream.
An opaque structure to describe an engine.
dnnl_status_t DNNL_API dnnl_primitive_attr_get_output_scales(const_dnnl_primitive_attr_t attr, dnnl_dim_t *count, int *mask, const float **scales)
Returns count, correspondence scale mask, and a pointer to a constant floating point array of output ...
dnnl_status_t DNNL_API dnnl_inner_product_forward_desc_init(dnnl_inner_product_desc_t *ip_desc, dnnl_prop_kind_t prop_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc)
Initializes an inner product descriptor ip_desc for forward propagation using prop_kind (possible val...
dnnl_status_t DNNL_API dnnl_vanilla_rnn_backward_desc_init(dnnl_rnn_desc_t *rnn_desc, dnnl_prop_kind_t prop_kind, const dnnl_alg_kind_t activation, const dnnl_rnn_direction_t direction, const dnnl_memory_desc_t *src_layer_desc, const dnnl_memory_desc_t *src_iter_desc, const dnnl_memory_desc_t *weights_layer_desc, const dnnl_memory_desc_t *weights_iter_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_layer_desc, const dnnl_memory_desc_t *dst_iter_desc, const dnnl_memory_desc_t *diff_src_layer_desc, const dnnl_memory_desc_t *diff_src_iter_desc, const dnnl_memory_desc_t *diff_weights_layer_desc, const dnnl_memory_desc_t *diff_weights_iter_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_layer_desc, const dnnl_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.
A descriptor of a element-wise operation.
Definition: dnnl_types.h:1017
A descriptor of a Softmax operation.
Definition: dnnl_types.h:1053
dnnl_status_t DNNL_API dnnl_primitive_destroy(dnnl_primitive_t primitive)
Deletes a primitive.
An opaque structure for a chain of post operations.
A descriptor of an inner product operation.
Definition: dnnl_types.h:1188
dnnl_status_t DNNL_API dnnl_engine_destroy(dnnl_engine_t engine)
Destroys an engine.
dnnl_status_t DNNL_API dnnl_binary_desc_init(dnnl_binary_desc_t *binary_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src0_desc, const dnnl_memory_desc_t *src1_desc, const dnnl_memory_desc_t *dst_desc)
Initializes a binary descriptor binary_desc, alg_kind (possible values are dnnl_binary_add and dnnl_b...
dnnl_status_t DNNL_API dnnl_post_ops_destroy(dnnl_post_ops_t post_ops)
Deletes a post_ops sequence.
dnnl_status_t DNNL_API dnnl_sum_primitive_desc_create(dnnl_primitive_desc_t *sum_primitive_desc, const dnnl_memory_desc_t *dst_mds, int n, const float *scales, const dnnl_memory_desc_t *src_mds, const_dnnl_primitive_attr_t attr, dnnl_engine_t engine)
Creates out-of-place sum_primitive_desc for sum of n inputs multiplied by scale with resulting output...
dnnl_status_t DNNL_API dnnl_lrn_backward_desc_init(dnnl_lrn_desc_t *lrn_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_data_desc, const dnnl_memory_desc_t *data_desc, dnnl_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...
dnnl_status_t DNNL_API dnnl_primitive_desc_clone(dnnl_primitive_desc_t *primitive_desc, const_dnnl_primitive_desc_t existing_primitive_desc)
Makes a copy of a primitive_desc.
dnnl_format_tag_t
Memory format tag specification.
Definition: dnnl_types.h:170
dnnl_status_t DNNL_API dnnl_inner_product_backward_data_desc_init(dnnl_inner_product_desc_t *ip_desc, const dnnl_memory_desc_t *diff_src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *diff_dst_desc)
Initializes an inner product descriptor ip_desc for backward propagation with respect to data using m...
dnnl_status_t DNNL_API dnnl_lstm_backward_desc_init(dnnl_rnn_desc_t *rnn_desc, dnnl_prop_kind_t prop_kind, dnnl_rnn_direction_t direction, const dnnl_memory_desc_t *src_layer_desc, const dnnl_memory_desc_t *src_iter_desc, const dnnl_memory_desc_t *src_iter_c_desc, const dnnl_memory_desc_t *weights_layer_desc, const dnnl_memory_desc_t *weights_iter_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_layer_desc, const dnnl_memory_desc_t *dst_iter_desc, const dnnl_memory_desc_t *dst_iter_c_desc, const dnnl_memory_desc_t *diff_src_layer_desc, const dnnl_memory_desc_t *diff_src_iter_desc, const dnnl_memory_desc_t *diff_src_iter_c_desc, const dnnl_memory_desc_t *diff_weights_layer_desc, const dnnl_memory_desc_t *diff_weights_iter_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_layer_desc, const dnnl_memory_desc_t *diff_dst_iter_desc, const dnnl_memory_desc_t *diff_dst_iter_c_desc, unsigned flags)
Initializes an LSTM descriptor rnn_desc for backward propagation using prop_kind, direction...
dnnl_status_t
Status values returned by the library functions.
Definition: dnnl_types.h:50
const void * const_dnnl_op_desc_t
A pointer to any of the operation descriptors (constant variant).
Definition: dnnl_types.h:954
dnnl_status_t DNNL_API dnnl_primitive_get_primitive_desc(const_dnnl_primitive_t primitive, const_dnnl_primitive_desc_t *primitive_desc)
Retrieves a reference to the primitive_desc descriptor of given primitive.
dnnl_status_t DNNL_API dnnl_pooling_backward_desc_init(dnnl_pooling_desc_t *pool_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_src_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t kernel, const dnnl_dims_t padding_l, const dnnl_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.
int DNNL_API dnnl_primitive_desc_query_s32(const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what, int index)
Queries primitive descriptor for signed 32bit int.
dnnl_status_t DNNL_API dnnl_reorder_primitive_desc_create(dnnl_primitive_desc_t *reorder_primitive_desc, const dnnl_memory_desc_t *src_md, dnnl_engine_t src_engine, const dnnl_memory_desc_t *dst_md, dnnl_engine_t dst_engine, const_dnnl_primitive_attr_t attr)
Initializes a reorder_primitive_desc using the description of the source (src_engine and src_md) and ...
dnnl_status_t DNNL_API dnnl_primitive_attr_set_rnn_weights_qparams(dnnl_primitive_attr_t attr, dnnl_dim_t count, int mask, const float *weights_scales)
Sets quantization scales weights_scales for RNN weights tensors.
dnnl_rnn_direction_t
A direction of RNN primitive execution.
Definition: dnnl_types.h:1220
dnnl_status_t DNNL_API dnnl_memory_get_memory_desc(const_dnnl_memory_t memory, const dnnl_memory_desc_t **memory_desc)
Returns a memory_desc associated with memory.
dnnl_status_t DNNL_API dnnl_memory_get_engine(const_dnnl_memory_t memory, dnnl_engine_t *engine)
Returns an engine associated with memory.
dnnl_status_t DNNL_API dnnl_stream_wait(dnnl_stream_t stream)
Waits for all primitives in the execution stream to finish.
dnnl_status_t DNNL_API dnnl_engine_get_ocl_context(dnnl_engine_t engine, cl_context *context)
Returns an OpenCL context associated with an engine.
dnnl_status_t DNNL_API dnnl_deconvolution_backward_weights_desc_init(dnnl_deconvolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *diff_weights_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a deconvolution descriptor conv_desc for backward propagation with respect to weights usi...
dnnl_alg_kind_t
Kinds of algorithms.
Definition: dnnl_types.h:653
dnnl_status_t DNNL_API dnnl_engine_create(dnnl_engine_t *engine, dnnl_engine_kind_t kind, size_t index)
Creates an engine of particular kind and index.
dnnl_status_t DNNL_API dnnl_dilated_deconvolution_forward_desc_init(dnnl_deconvolution_desc_t *conv_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc, const dnnl_dims_t strides, const dnnl_dims_t dilates, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a dilated deconvolution descriptor deconv_desc for forward propagation using prop_kind (p...
dnnl_status_t DNNL_API dnnl_memory_map_data(const_dnnl_memory_t memory, void **mapped_ptr)
For a memory, maps the data of the memory to mapped_ptr.
dnnl_status_t DNNL_API dnnl_primitive_attr_clone(dnnl_primitive_attr_t *attr, const_dnnl_primitive_attr_t existing_attr)
Makes a copy of an existing_attr.
dnnl_status_t DNNL_API dnnl_engine_get_kind(dnnl_engine_t engine, dnnl_engine_kind_t *kind)
Returns the kind of an engine.
dnnl_status_t DNNL_API dnnl_primitive_desc_query(const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what, int index, void *result)
Queries primitive descriptor.
A descriptor of a shuffle operation.
Definition: dnnl_types.h:1000
dnnl_status_t DNNL_API dnnl_dilated_deconvolution_backward_weights_desc_init(dnnl_deconvolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *diff_weights_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t dilates, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a dilated deconvolution descriptor conv_desc for backward propagation with respect to wei...
int DNNL_API dnnl_post_ops_len(const_dnnl_post_ops_t post_ops)
Returns the length of post operations for given post_ops.
dnnl_status_t DNNL_API dnnl_dilated_deconvolution_backward_data_desc_init(dnnl_deconvolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t dilates, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a dilated deconvolution descriptor conv_desc for backward propagation with respect to dat...
dnnl_status_t DNNL_API dnnl_set_jit_dump(int enable)
Enables or disables dumping of JIT-generated code.
dnnl_status_t DNNL_API dnnl_lbr_gru_backward_desc_init(dnnl_rnn_desc_t *rnn_desc, dnnl_prop_kind_t prop_kind, dnnl_rnn_direction_t direction, const dnnl_memory_desc_t *src_layer_desc, const dnnl_memory_desc_t *src_iter_desc, const dnnl_memory_desc_t *weights_layer_desc, const dnnl_memory_desc_t *weights_iter_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_layer_desc, const dnnl_memory_desc_t *dst_iter_desc, const dnnl_memory_desc_t *diff_src_layer_desc, const dnnl_memory_desc_t *diff_src_iter_desc, const dnnl_memory_desc_t *diff_weights_layer_desc, const dnnl_memory_desc_t *diff_weights_iter_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_layer_desc, const dnnl_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.
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_desc memory descriptor using ndims, dims, data_type, and format tag...
dnnl_status_t DNNL_API dnnl_post_ops_create(dnnl_post_ops_t *post_ops)
Creates an empty sequence of post operations post_ops.
dnnl_status_t DNNL_API dnnl_concat_primitive_desc_create(dnnl_primitive_desc_t *concat_primitive_desc, const dnnl_memory_desc_t *dst_md, int n, int concat_dimension, const dnnl_memory_desc_t *src_mds, const_dnnl_primitive_attr_t attr, dnnl_engine_t engine)
Creates out-of-place concat_primitive_desc for concatenation of n inputs by concat_dimension with res...
A descriptor of a Layer Normalization operation.
Definition: dnnl_types.h:1156
dnnl_status_t DNNL_API dnnl_primitive_desc_iterator_next(dnnl_primitive_desc_iterator_t iterator)
Iterates over primitive descriptors.
dnnl_status_t DNNL_API dnnl_primitive_desc_iterator_create(dnnl_primitive_desc_iterator_t *iterator, const_dnnl_op_desc_t op_desc, const_dnnl_primitive_attr_t attr, dnnl_engine_t engine, const_dnnl_primitive_desc_t hint_forward_primitive_desc)
Creates a primitive descriptor iterator for given op_desc, attr, engine, and optionally a hint primit...
dnnl_scratchpad_mode_t
Scratchpad mode.
Definition: dnnl_types.h:1378
dnnl_status_t DNNL_API dnnl_primitive_attr_get_post_ops(const_dnnl_primitive_attr_t attr, const_dnnl_post_ops_t *post_ops)
Returns post_ops for given attr.
dnnl_status_t DNNL_API dnnl_shuffle_backward_desc_init(dnnl_shuffle_desc_t *shuffle_desc, const dnnl_memory_desc_t *diff_data_desc, int axis, dnnl_dim_t group_size)
Initializes a shuffle_desc for backward propagation using memory descriptor diff_data_desc, axis, and group_size.
dnnl_status_t DNNL_API dnnl_dilated_convolution_backward_weights_desc_init(dnnl_convolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *diff_weights_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t dilates, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a convolution descriptor conv_desc for backward propagation with respect to weights using...
dnnl_status_t DNNL_API dnnl_deconvolution_forward_desc_init(dnnl_deconvolution_desc_t *conv_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc, const dnnl_dims_t strides, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a deconvolution descriptor deconv_desc for forward propagation using prop_kind (possible ...
dnnl_status_t DNNL_API dnnl_memory_unmap_data(const_dnnl_memory_t memory, void *mapped_ptr)
For a memory, unmaps a mapped pointer to the data of the memory.
dnnl_primitive_desc_t DNNL_API dnnl_primitive_desc_iterator_fetch(const_dnnl_primitive_desc_iterator_t iterator)
Fetches the current primitive descriptor.
dnnl_status_t DNNL_API dnnl_convolution_backward_weights_desc_init(dnnl_convolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *diff_weights_desc, const dnnl_memory_desc_t *diff_bias_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a convolution descriptor conv_desc for backward propagation with respect to weights using...
dnnl_status_t DNNL_API dnnl_primitive_attr_set_output_scales(dnnl_primitive_attr_t attr, dnnl_dim_t count, int mask, const float *scales)
Sets output scales for primitive operations.
Memory descriptor.
Definition: dnnl_types.h:884
dnnl_status_t DNNL_API dnnl_pooling_forward_desc_init(dnnl_pooling_desc_t *pool_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *dst_desc, const dnnl_dims_t strides, const dnnl_dims_t kernel, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a pooling descriptor pool_desc for forward propagation using prop_kind (possible values a...
dnnl_status_t DNNL_API dnnl_convolution_forward_desc_init(dnnl_convolution_desc_t *conv_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_desc, const dnnl_dims_t strides, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a convolution descriptor conv_desc for forward propagation using prop_kind (possible valu...
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 for given memory_desc and engine.
dnnl_status_t DNNL_API dnnl_lbr_gru_forward_desc_init(dnnl_rnn_desc_t *rnn_desc, dnnl_prop_kind_t prop_kind, dnnl_rnn_direction_t direction, const dnnl_memory_desc_t *src_layer_desc, const dnnl_memory_desc_t *src_iter_desc, const dnnl_memory_desc_t *weights_layer_desc, const dnnl_memory_desc_t *weights_iter_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_layer_desc, const dnnl_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.
dnnl_status_t DNNL_API dnnl_stream_create(dnnl_stream_t *stream, dnnl_engine_t engine, unsigned flags)
Creates an execution stream for engine and with flags.
dnnl_status_t DNNL_API dnnl_gemm_s8s8s32(char transa, char transb, char offsetc, dnnl_dim_t M, dnnl_dim_t N, dnnl_dim_t K, float alpha, const int8_t *A, dnnl_dim_t lda, int8_t ao, const int8_t *B, dnnl_dim_t ldb, int8_t bo, float beta, int32_t *C, dnnl_dim_t ldc, const int32_t *co)
dnnl_gemm_u8s8s32() and dnnl_gemm_s8s8s32() perform a matrix-matrix multiplication operation and add ...
dnnl_status_t DNNL_API dnnl_deconvolution_backward_data_desc_init(dnnl_deconvolution_desc_t *conv_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_src_desc, const dnnl_memory_desc_t *weights_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
Initializes a deconvolution descriptor conv_desc for backward propagation with respect to data using ...
dnnl_status_t DNNL_API dnnl_primitive_attr_set_rnn_data_qparams(dnnl_primitive_attr_t attr, const float scale, const float shift)
Sets quantization scale and shift for RNN data tensors.
An auxiliary structure to specify primitive&#39;s inputs/outputs at execution.
Definition: dnnl_types.h:1520
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 an out_memory_desc with new ndims and dims from a in_memory_desc.
dnnl_status_t DNNL_API dnnl_memory_get_data_handle(const_dnnl_memory_t memory, void **handle)
For a memory, returns the data handle.
dnnl_status_t DNNL_API dnnl_memory_get_ocl_mem_object(const_dnnl_memory_t memory, cl_mem *mem_object)
For a memory returns the OpenCL memory object associated with it.
size_t DNNL_API dnnl_engine_get_count(dnnl_engine_kind_t kind)
Returns the number of engines of a particular kind.
dnnl_status_t DNNL_API dnnl_lstm_forward_desc_init(dnnl_rnn_desc_t *rnn_desc, dnnl_prop_kind_t prop_kind, dnnl_rnn_direction_t direction, const dnnl_memory_desc_t *src_layer_desc, const dnnl_memory_desc_t *src_iter_desc, const dnnl_memory_desc_t *src_iter_c_desc, const dnnl_memory_desc_t *weights_layer_desc, const dnnl_memory_desc_t *weights_iter_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_layer_desc, const dnnl_memory_desc_t *dst_iter_desc, const dnnl_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.
prop_kind
Propagation kind.
Definition: dnnl.hpp:265
dnnl_status_t DNNL_API dnnl_softmax_backward_desc_init(dnnl_softmax_desc_t *softmax_desc, const dnnl_memory_desc_t *diff_desc, const dnnl_memory_desc_t *data_desc, int softmax_axis)
Initializes a softmax_desc for backward propagation using memory descriptors diff_desc and data_desc...
A descriptor of a Local Response Normalization (LRN) operation.
Definition: dnnl_types.h:1102
dnnl_status_t DNNL_API dnnl_post_ops_append_eltwise(dnnl_post_ops_t post_ops, float scale, dnnl_alg_kind_t alg, float alpha, float beta)
Appends eltwise post operation to the post_ops with given parameters kind, alpha, and beta (...
dnnl_status_t DNNL_API dnnl_gemm_u8s8s32(char transa, char transb, char offsetc, dnnl_dim_t M, dnnl_dim_t N, dnnl_dim_t K, float alpha, const uint8_t *A, dnnl_dim_t lda, uint8_t ao, const int8_t *B, dnnl_dim_t ldb, int8_t bo, float beta, int32_t *C, dnnl_dim_t ldc, const int32_t *co)
dnnl_gemm_u8s8s32() and dnnl_gemm_s8s8s32() perform a matrix-matrix multiplication operation and add ...
A descriptor of a Batch Normalization operation.
Definition: dnnl_types.h:1128
dnnl_prop_kind_t
Kinds of propagation.
Definition: dnnl_types.h:588
dnnl_status_t DNNL_API dnnl_memory_set_ocl_mem_object(dnnl_memory_t memory, cl_mem mem_object)
For a memory sets the OpenCL memory object associated with it.
An opaque structure to describe a primitive descriptor.
dnnl_status_t DNNL_API dnnl_post_ops_get_params_sum(const_dnnl_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...
dnnl_status_t DNNL_API dnnl_primitive_desc_iterator_destroy(dnnl_primitive_desc_iterator_t iterator)
Deletes a primitive descriptor iterator.
An opaque structure to describe an execution stream.
dnnl_status_t DNNL_API dnnl_primitive_attr_set_post_ops(dnnl_primitive_attr_t attr, const_dnnl_post_ops_t post_ops)
Sets configured post_ops to an attribute attr for future use (when primitive descriptor is being crea...
dnnl_status_t DNNL_API dnnl_stream_create_ocl(dnnl_stream_t *stream, dnnl_engine_t engine, cl_command_queue queue)
Creates an execution stream for a given engine associated with an OpenCL command queue.
dnnl_status_t DNNL_API dnnl_eltwise_backward_desc_init(dnnl_eltwise_desc_t *eltwise_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_data_desc, const dnnl_memory_desc_t *data_desc, float alpha, float beta)
Initializes an eltwise_desc for backward propagation using alg_kind algorithm memory descriptors diff...
dnnl_engine_kind_t
Kinds of engines.
Definition: dnnl_types.h:1321
size_t DNNL_API dnnl_memory_desc_get_size(const dnnl_memory_desc_t *memory_desc)
Returns the size (in bytes) that is required for given memory_desc.
dnnl_status_t DNNL_API dnnl_batch_normalization_forward_desc_init(dnnl_batch_normalization_desc_t *bnrm_desc, dnnl_prop_kind_t prop_kind, const dnnl_memory_desc_t *data_desc, float epsilon, unsigned flags)
Initializes a batch normalization descriptor bnrm_desc for forward propagation using prop_kind (possi...
dnnl_status_t DNNL_API dnnl_gru_forward_desc_init(dnnl_rnn_desc_t *rnn_desc, dnnl_prop_kind_t prop_kind, dnnl_rnn_direction_t direction, const dnnl_memory_desc_t *src_layer_desc, const dnnl_memory_desc_t *src_iter_desc, const dnnl_memory_desc_t *weights_layer_desc, const dnnl_memory_desc_t *weights_iter_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_layer_desc, const dnnl_memory_desc_t *dst_iter_desc, unsigned flags)
Initializes a GRU descriptor rnn_desc for forward propagation using prop_kind, direction, and memory descriptors.
dnnl_status_t DNNL_API dnnl_vanilla_rnn_forward_desc_init(dnnl_rnn_desc_t *rnn_desc, dnnl_prop_kind_t prop_kind, const dnnl_alg_kind_t activation, const dnnl_rnn_direction_t direction, const dnnl_memory_desc_t *src_layer_desc, const dnnl_memory_desc_t *src_iter_desc, const dnnl_memory_desc_t *weights_layer_desc, const dnnl_memory_desc_t *weights_iter_desc, const dnnl_memory_desc_t *bias_desc, const dnnl_memory_desc_t *dst_layer_desc, const dnnl_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.
dnnl_status_t DNNL_API dnnl_eltwise_forward_desc_init(dnnl_eltwise_desc_t *eltwise_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *data_desc, float alpha, float beta)
Initializes an eltwise_desc for forward propagation using prop_kind (possible values are dnnl_forward...
dnnl_status_t DNNL_API dnnl_shuffle_forward_desc_init(dnnl_shuffle_desc_t *shuffle_desc, dnnl_prop_kind_t prop_kind, const dnnl_memory_desc_t *data_desc, int axis, dnnl_dim_t group_size)
Initializes a shuffle_desc for forward propagation using prop_kind, memory descriptor data_desc...