/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.1/include/miopen/miopen.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.1/include/miopen/miopen.h Source File#

MIOpen: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.1/include/miopen/miopen.h Source File
miopen.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * MIT License
4  *
5  * Copyright (c) 2023 Advanced Micro Devices, Inc.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all
15  * copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  *
25  *******************************************************************************/
26 #ifndef MIOPEN_GUARD_MIOPEN_H_
27 #define MIOPEN_GUARD_MIOPEN_H_
28 
29 #ifdef __clang__
30 #pragma clang diagnostic push
31 #pragma clang diagnostic ignored "-Wextern-c-compat"
32 #endif
33 
34 #include <stddef.h>
35 #include <stdbool.h>
36 #include <miopen/config.h>
37 #include <miopen/export.h>
38 
39 #if MIOPEN_BACKEND_OPENCL
40 #define CL_TARGET_OPENCL_VERSION 120
41 #if defined(__APPLE__) || defined(__MACOSX)
42 #include <OpenCL/cl.h>
43 #else
44 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS
45 #include <CL/cl.h>
46 #endif
47 
48 #elif MIOPEN_BACKEND_HIP
49 #include <hip/hip_runtime_api.h>
50 #endif
51 
52 /*
53  * @defgroup convolutions
54  * @defgroup pooling
55  * @defgroup handle
56  * @defgroup layernorm
57  * @defgroup LRN
58  * @defgroup batchnorm
59  * @defgroup activation
60  * @defgroup tensor
61  * @defgroup softmax
62  * @defgroup RNN
63  * @defgroup fusion
64  * @defgroup LossFunction
65  * @defgroup TensorReduce
66  * @defgroup find2
67  * @defgroup sum
68  * @defgroup argmax
69  * @defgroup groupnorm
70  * @defgroup cat
71  *
72  */
73 
75 #define MIOPEN_DECLARE_OBJECT(name) \
76  struct name \
77  { \
78  }; \
79  typedef struct name* name##_t;
80 
81 #ifdef __cplusplus
82 extern "C" {
83 #endif
84 
85 #if MIOPEN_BACKEND_OPENCL
86 typedef cl_command_queue miopenAcceleratorQueue_t;
87 #elif MIOPEN_BACKEND_HIP
88 typedef hipStream_t miopenAcceleratorQueue_t;
89 #endif
90 
94 MIOPEN_DECLARE_OBJECT(miopenHandle);
95 
104 typedef enum
105 {
118 
119 #ifdef MIOPEN_BETA_API
120 typedef enum
121 {
125 #endif
126 
134 MIOPEN_EXPORT const char* miopenGetErrorString(miopenStatus_t error);
135 
144 typedef void* (*miopenAllocatorFunction)(void* context, size_t sizeBytes);
145 
154 typedef void (*miopenDeallocatorFunction)(void* context, void* memory);
155 
169 MIOPEN_EXPORT miopenStatus_t miopenGetVersion(size_t* major, size_t* minor, size_t* patch);
170 
179 MIOPEN_EXPORT miopenStatus_t miopenCreate(miopenHandle_t* handle);
180 
192 MIOPEN_EXPORT miopenStatus_t miopenCreateWithStream(miopenHandle_t* handle,
193  miopenAcceleratorQueue_t stream);
194 
201 MIOPEN_EXPORT miopenStatus_t miopenDestroy(miopenHandle_t handle);
202 
210 MIOPEN_EXPORT miopenStatus_t miopenSetStream(miopenHandle_t handle,
211  miopenAcceleratorQueue_t streamID);
212 
220 MIOPEN_EXPORT miopenStatus_t miopenGetStream(miopenHandle_t handle,
221  miopenAcceleratorQueue_t* streamID);
222 
239 MIOPEN_EXPORT miopenStatus_t miopenSetAllocator(miopenHandle_t handle,
240  miopenAllocatorFunction allocator,
241  miopenDeallocatorFunction deallocator,
242  void* allocatorContext);
243 
255 MIOPEN_EXPORT miopenStatus_t miopenGetKernelTime(miopenHandle_t handle, float* time);
256 
264 MIOPEN_EXPORT miopenStatus_t miopenEnableProfiling(miopenHandle_t handle, bool enable);
266 // CLOSEOUT HANDLE DOXYGEN GROUP
267 
275 MIOPEN_DECLARE_OBJECT(miopenFusionOpDescriptor);
276 
284 MIOPEN_DECLARE_OBJECT(miopenTensorDescriptor);
285 
292 MIOPEN_DECLARE_OBJECT(miopenSeqTensorDescriptor);
293 
301 MIOPEN_DECLARE_OBJECT(miopenConvolutionDescriptor);
302 
310 MIOPEN_DECLARE_OBJECT(miopenPoolingDescriptor);
311 
319 MIOPEN_DECLARE_OBJECT(miopenLRNDescriptor);
320 
327 MIOPEN_DECLARE_OBJECT(miopenActivationDescriptor);
328 
332 MIOPEN_DECLARE_OBJECT(miopenRNNDescriptor);
333 
337 MIOPEN_DECLARE_OBJECT(miopenCTCLossDescriptor);
338 
342 MIOPEN_DECLARE_OBJECT(miopenDropoutDescriptor);
343 
347 MIOPEN_DECLARE_OBJECT(miopenReduceTensorDescriptor);
348 
353 typedef enum
354 {
359  // miopenInt8x4 = 4, /*!< Pack of 4x Int8 in NCHW_VECT_C format (Support discontinued) */
360  miopenBFloat16 = 5,
363 #ifdef MIOPEN_BETA_API
366 #else
367 // miopenReserved1 = 7,
368 // miopenReserved2 = 8,
369 #endif
371 
377 typedef enum
378 {
389 
394 typedef enum
395 {
401 
406 typedef enum
407 {
413 
418 typedef enum
419 {
425 
430 typedef enum
431 {
436 
441 typedef enum
442 {
447 
454 typedef enum
455 {
459 
464 typedef enum
465 {
469 #ifdef MIOPEN_BETA_API
474 typedef enum
475 {
478  1,
480 #endif
485 typedef enum
486 {
490 
495 typedef enum
496 {
505  7,
507  8,
509  9,
512 
517 typedef enum
518 {
523 
528 typedef enum
529 {
532  1,
534 
542 #define MIOPEN_API_VERSION_REDUCE_TENSOR 1
543 
548 typedef enum
549 {
552  1,
554  2,
556  3,
558  4,
560  5,
562  6,
565  // MIOPEN_REDUCE_TENSOR_MUL_NO_ZEROS =
566  // 8, /*!< the operation is same as MUL, but does not have the zero values considered */
568 
573 typedef enum
574 {
578 
583 typedef enum
584 {
588 
593 typedef enum
594 {
600 
605 typedef enum
606 {
608  0,
612  1,
614 #ifdef MIOPEN_BETA_API
616  2,
620 #else
621 // miopenReserved1 = 2,
622 #endif
624 
636 MIOPEN_EXPORT miopenStatus_t miopenCreateTensorDescriptor(miopenTensorDescriptor_t* tensorDesc);
637 
651  miopenTensorDescriptor_t tensorDesc, miopenDataType_t dataType, int n, int c, int h, int w);
652 
663 MIOPEN_EXPORT miopenStatus_t
664 miopenSetNdTensorDescriptorWithLayout(miopenTensorDescriptor_t tensorDesc,
665  miopenDataType_t dataType,
666  miopenTensorLayout_t tensorLayout,
667  const int* lens,
668  int num_lens);
688 MIOPEN_EXPORT miopenStatus_t miopenSet4dTensorDescriptorEx(miopenTensorDescriptor_t tensorDesc,
689  miopenDataType_t dataType,
690  int n,
691  int c,
692  int h,
693  int w,
694  int nStride,
695  int cStride,
696  int hStride,
697  int wStride);
698 
715 MIOPEN_EXPORT miopenStatus_t miopenGet4dTensorDescriptor(miopenTensorDescriptor_t tensorDesc,
716  miopenDataType_t* dataType,
717  int* n,
718  int* c,
719  int* h,
720  int* w,
721  int* nStride,
722  int* cStride,
723  int* hStride,
724  int* wStride);
725 
736 MIOPEN_EXPORT miopenStatus_t miopenSetTensorDescriptor(miopenTensorDescriptor_t tensorDesc,
737  miopenDataType_t dataType,
738  int nbDims,
739  const int* dimsA,
740  const int* stridesA);
741 
742 #ifdef MIOPEN_BETA_API
752 MIOPEN_EXPORT miopenStatus_t miopenSetTensorCastType(miopenTensorDescriptor_t tensorDesc,
753  miopenDataType_t cast_type);
754 #endif
755 
764 MIOPEN_EXPORT miopenStatus_t miopenGetTensorDescriptorSize(miopenTensorDescriptor_t tensorDesc,
765  int* size);
766 
775 MIOPEN_EXPORT miopenStatus_t miopenGetTensorDescriptor(miopenTensorDescriptor_t tensorDesc,
776  miopenDataType_t* dataType,
777  int* dimsA,
778  int* stridesA);
779 
785 MIOPEN_EXPORT miopenStatus_t miopenDestroyTensorDescriptor(miopenTensorDescriptor_t tensorDesc);
786 
793 MIOPEN_EXPORT miopenStatus_t
794 miopenCreateSeqTensorDescriptor(miopenSeqTensorDescriptor_t* tensorDesc);
795 
801 MIOPEN_EXPORT miopenStatus_t
802 miopenDestroySeqTensorDescriptor(miopenSeqTensorDescriptor_t tensorDesc);
803 
823 MIOPEN_EXPORT miopenStatus_t miopenOpTensor(miopenHandle_t handle,
824  miopenTensorOp_t tensorOp,
825  const void* alpha1,
826  const miopenTensorDescriptor_t aDesc,
827  const void* A,
828  const void* alpha2,
829  const miopenTensorDescriptor_t bDesc,
830  const void* B,
831  const void* beta,
832  const miopenTensorDescriptor_t cDesc,
833  void* C);
834 
845 MIOPEN_EXPORT miopenStatus_t miopenSetTensor(miopenHandle_t handle,
846  const miopenTensorDescriptor_t yDesc,
847  void* y,
848  const void* alpha);
849 
860 MIOPEN_EXPORT miopenStatus_t miopenScaleTensor(miopenHandle_t handle,
861  const miopenTensorDescriptor_t yDesc,
862  void* y,
863  const void* alpha);
864 
871 MIOPEN_EXPORT miopenStatus_t miopenGetTensorNumBytes(miopenTensorDescriptor_t tensorDesc,
872  size_t* numBytes);
873 
891 MIOPEN_EXPORT miopenStatus_t miopenTransformTensor(miopenHandle_t handle,
892  const void* alpha,
893  const miopenTensorDescriptor_t xDesc,
894  const void* x,
895  const void* beta,
896  const miopenTensorDescriptor_t yDesc,
897  void* y);
898 
900 // CLOSEOUT TENSOR DOXYGEN GROUP
901 
912 MIOPEN_EXPORT miopenStatus_t
913 miopenCreateConvolutionDescriptor(miopenConvolutionDescriptor_t* convDesc);
914 
930 MIOPEN_EXPORT miopenStatus_t miopenInitConvolutionDescriptor(miopenConvolutionDescriptor_t convDesc,
932  int pad_h,
933  int pad_w,
934  int stride_h,
935  int stride_w,
936  int dilation_h,
937  int dilation_w);
938 
949 MIOPEN_EXPORT miopenStatus_t
950 miopenInitConvolutionNdDescriptor(miopenConvolutionDescriptor_t convDesc,
951  int spatialDim,
952  const int* padA,
953  const int* strideA,
954  const int* dilationA,
955  miopenConvolutionMode_t c_mode);
956 
963 MIOPEN_EXPORT miopenStatus_t miopenGetConvolutionSpatialDim(miopenConvolutionDescriptor_t convDesc,
964  int* spatialDim);
965 
981 MIOPEN_EXPORT miopenStatus_t miopenGetConvolutionDescriptor(miopenConvolutionDescriptor_t convDesc,
982  miopenConvolutionMode_t* c_mode,
983  int* pad_h,
984  int* pad_w,
985  int* stride_h,
986  int* stride_w,
987  int* dilation_h,
988  int* dilation_w);
989 
1001 MIOPEN_EXPORT miopenStatus_t
1002 miopenGetConvolutionNdDescriptor(miopenConvolutionDescriptor_t convDesc,
1003  int requestedSpatialDim,
1004  int* spatialDim,
1005  int* padA,
1006  int* strideA,
1007  int* dilationA,
1008  miopenConvolutionMode_t* c_mode);
1009 
1016 MIOPEN_EXPORT miopenStatus_t miopenGetConvolutionGroupCount(miopenConvolutionDescriptor_t convDesc,
1017  int* groupCount);
1018 
1032 MIOPEN_EXPORT miopenStatus_t miopenSetConvolutionGroupCount(miopenConvolutionDescriptor_t convDesc,
1033  int groupCount);
1034 
1047 MIOPEN_EXPORT miopenStatus_t
1048 miopenSetTransposeConvOutputPadding(miopenConvolutionDescriptor_t convDesc, int adj_h, int adj_w);
1049 
1063  miopenConvolutionDescriptor_t convDesc, int spatialDim, const int* adjA);
1064 
1082 MIOPEN_EXPORT miopenStatus_t
1083 miopenGetConvolutionForwardOutputDim(miopenConvolutionDescriptor_t convDesc,
1084  const miopenTensorDescriptor_t inputTensorDesc,
1085  const miopenTensorDescriptor_t filterDesc,
1086  int* n,
1087  int* c,
1088  int* h,
1089  int* w);
1090 
1104 MIOPEN_EXPORT miopenStatus_t
1105 miopenGetConvolutionNdForwardOutputDim(miopenConvolutionDescriptor_t convDesc,
1106  const miopenTensorDescriptor_t inputTensorDesc,
1107  const miopenTensorDescriptor_t filterDesc,
1108  int* nDim,
1109  int* outputTensorDimA);
1110 
1116 MIOPEN_EXPORT miopenStatus_t
1117 miopenDestroyConvolutionDescriptor(miopenConvolutionDescriptor_t convDesc);
1118 
1125 MIOPEN_EXPORT miopenStatus_t miopenSetConvolutionAttribute(miopenConvolutionDescriptor_t convDesc,
1126  const miopenConvolutionAttrib_t attr,
1127  int value);
1128 
1135 MIOPEN_EXPORT miopenStatus_t miopenGetConvolutionAttribute(miopenConvolutionDescriptor_t convDesc,
1136  const miopenConvolutionAttrib_t attr,
1137  int* value);
1138 
1143 typedef enum
1144 {
1151 
1155 typedef enum
1156 {
1162 
1166 typedef enum
1167 {
1173  4,
1176 
1180 typedef enum
1181 {
1188 
1195 typedef struct
1196 {
1197  union
1198  {
1204  };
1205 
1206  float time;
1207  size_t memory;
1210 
1219 typedef struct
1220 {
1221  float time;
1226  uint64_t solution_id;
1230 
1246 MIOPEN_EXPORT miopenStatus_t
1248  const miopenTensorDescriptor_t wDesc,
1249  const miopenTensorDescriptor_t xDesc,
1250  const miopenConvolutionDescriptor_t convDesc,
1251  const miopenTensorDescriptor_t yDesc,
1252  size_t* solutionCount);
1253 
1277 MIOPEN_EXPORT miopenStatus_t
1279  const miopenTensorDescriptor_t wDesc,
1280  const miopenTensorDescriptor_t xDesc,
1281  const miopenConvolutionDescriptor_t convDesc,
1282  const miopenTensorDescriptor_t yDesc,
1283  const size_t maxSolutionCount,
1284  size_t* solutionCount,
1285  miopenConvSolution_t* solutions);
1286 
1304 MIOPEN_EXPORT miopenStatus_t
1306  const miopenTensorDescriptor_t wDesc,
1307  const miopenTensorDescriptor_t xDesc,
1308  const miopenConvolutionDescriptor_t convDesc,
1309  const miopenTensorDescriptor_t yDesc,
1310  const uint64_t solution_id,
1311  size_t* workSpaceSize);
1312 
1330 MIOPEN_EXPORT miopenStatus_t
1332  const miopenTensorDescriptor_t wDesc,
1333  const miopenTensorDescriptor_t xDesc,
1334  const miopenConvolutionDescriptor_t convDesc,
1335  const miopenTensorDescriptor_t yDesc,
1336  const uint64_t solution_id);
1337 
1355 MIOPEN_EXPORT miopenStatus_t
1357  const miopenTensorDescriptor_t wDesc,
1358  const void* w,
1359  const miopenTensorDescriptor_t xDesc,
1360  const void* x,
1361  const miopenConvolutionDescriptor_t convDesc,
1362  const miopenTensorDescriptor_t yDesc,
1363  void* y,
1364  void* workSpace,
1365  size_t workSpaceSize,
1366  const uint64_t solution_id);
1367 
1385 MIOPEN_EXPORT miopenStatus_t
1387  const miopenTensorDescriptor_t dyDesc,
1388  const miopenTensorDescriptor_t wDesc,
1389  const miopenConvolutionDescriptor_t convDesc,
1390  const miopenTensorDescriptor_t dxDesc,
1391  size_t* solutionCount);
1392 
1417 MIOPEN_EXPORT miopenStatus_t
1419  const miopenTensorDescriptor_t dyDesc,
1420  const miopenTensorDescriptor_t wDesc,
1421  const miopenConvolutionDescriptor_t convDesc,
1422  const miopenTensorDescriptor_t dxDesc,
1423  const size_t maxSolutionCount,
1424  size_t* solutionCount,
1425  miopenConvSolution_t* solutions);
1426 
1444 MIOPEN_EXPORT miopenStatus_t
1446  const miopenTensorDescriptor_t dyDesc,
1447  const miopenTensorDescriptor_t wDesc,
1448  const miopenConvolutionDescriptor_t convDesc,
1449  const miopenTensorDescriptor_t dxDesc,
1450  const uint64_t solution_id,
1451  size_t* workSpaceSize);
1452 
1471 MIOPEN_EXPORT miopenStatus_t
1473  const miopenTensorDescriptor_t dyDesc,
1474  const miopenTensorDescriptor_t wDesc,
1475  const miopenConvolutionDescriptor_t convDesc,
1476  const miopenTensorDescriptor_t dxDesc,
1477  const uint64_t solution_id);
1478 
1496 MIOPEN_EXPORT miopenStatus_t
1498  const miopenTensorDescriptor_t dyDesc,
1499  const void* dy,
1500  const miopenTensorDescriptor_t wDesc,
1501  const void* w,
1502  const miopenConvolutionDescriptor_t convDesc,
1503  const miopenTensorDescriptor_t dxDesc,
1504  void* dx,
1505  void* workSpace,
1506  size_t workSpaceSize,
1507  const uint64_t solution_id);
1508 
1526 MIOPEN_EXPORT miopenStatus_t
1528  const miopenTensorDescriptor_t dyDesc,
1529  const miopenTensorDescriptor_t xDesc,
1530  const miopenConvolutionDescriptor_t convDesc,
1531  const miopenTensorDescriptor_t dwDesc,
1532  size_t* solutionCount);
1533 
1557 MIOPEN_EXPORT miopenStatus_t
1559  const miopenTensorDescriptor_t dyDesc,
1560  const miopenTensorDescriptor_t xDesc,
1561  const miopenConvolutionDescriptor_t convDesc,
1562  const miopenTensorDescriptor_t dwDesc,
1563  const size_t maxSolutionCount,
1564  size_t* solutionCount,
1565  miopenConvSolution_t* solutions);
1566 
1585  miopenHandle_t handle,
1586  const miopenTensorDescriptor_t dyDesc,
1587  const miopenTensorDescriptor_t xDesc,
1588  const miopenConvolutionDescriptor_t convDesc,
1589  const miopenTensorDescriptor_t dwDesc,
1590  const uint64_t solution_id,
1591  size_t* workSpaceSize);
1592 
1610 MIOPEN_EXPORT miopenStatus_t
1612  const miopenTensorDescriptor_t dyDesc,
1613  const miopenTensorDescriptor_t xDesc,
1614  const miopenConvolutionDescriptor_t convDesc,
1615  const miopenTensorDescriptor_t dwDesc,
1616  const uint64_t solution_id);
1617 
1636 MIOPEN_EXPORT miopenStatus_t
1638  const miopenTensorDescriptor_t dyDesc,
1639  const void* dy,
1640  const miopenTensorDescriptor_t xDesc,
1641  const void* x,
1642  const miopenConvolutionDescriptor_t convDesc,
1643  const miopenTensorDescriptor_t dwDesc,
1644  void* dw,
1645  void* workSpace,
1646  size_t workSpaceSize,
1647  const uint64_t solution_id);
1648 
1668 MIOPEN_EXPORT miopenStatus_t
1670  const miopenTensorDescriptor_t wDesc,
1671  const miopenTensorDescriptor_t xDesc,
1672  const miopenConvolutionDescriptor_t convDesc,
1673  const miopenTensorDescriptor_t yDesc,
1674  size_t* workSpaceSize);
1675 
1715 MIOPEN_EXPORT miopenStatus_t
1717  const miopenTensorDescriptor_t xDesc,
1718  const void* x,
1719  const miopenTensorDescriptor_t wDesc,
1720  const void* w,
1721  const miopenConvolutionDescriptor_t convDesc,
1722  const miopenTensorDescriptor_t yDesc,
1723  void* y,
1724  const int requestAlgoCount,
1725  int* returnedAlgoCount,
1726  miopenConvAlgoPerf_t* perfResults,
1727  void* workSpace,
1728  size_t workSpaceSize,
1729  bool exhaustiveSearch);
1730 
1765 MIOPEN_EXPORT miopenStatus_t miopenConvolutionForward(miopenHandle_t handle,
1766  const void* alpha,
1767  const miopenTensorDescriptor_t xDesc,
1768  const void* x,
1769  const miopenTensorDescriptor_t wDesc,
1770  const void* w,
1771  const miopenConvolutionDescriptor_t convDesc,
1773  const void* beta,
1774  const miopenTensorDescriptor_t yDesc,
1775  void* y,
1776  void* workSpace,
1777  size_t workSpaceSize);
1778 
1794 MIOPEN_EXPORT miopenStatus_t miopenConvolutionForwardBias(miopenHandle_t handle,
1795  const void* alpha,
1796  const miopenTensorDescriptor_t bDesc,
1797  const void* b,
1798  const void* beta,
1799  const miopenTensorDescriptor_t yDesc,
1800  void* y);
1801 
1821 MIOPEN_EXPORT miopenStatus_t
1823  const miopenTensorDescriptor_t dyDesc,
1824  const miopenTensorDescriptor_t wDesc,
1825  const miopenConvolutionDescriptor_t convDesc,
1826  const miopenTensorDescriptor_t dxDesc,
1827  size_t* workSpaceSize);
1828 
1868 MIOPEN_EXPORT miopenStatus_t
1870  const miopenTensorDescriptor_t dyDesc,
1871  const void* dy,
1872  const miopenTensorDescriptor_t wDesc,
1873  const void* w,
1874  const miopenConvolutionDescriptor_t convDesc,
1875  const miopenTensorDescriptor_t dxDesc,
1876  void* dx,
1877  const int requestAlgoCount,
1878  int* returnedAlgoCount,
1879  miopenConvAlgoPerf_t* perfResults,
1880  void* workSpace,
1881  size_t workSpaceSize,
1882  bool exhaustiveSearch);
1883 
1917 MIOPEN_EXPORT miopenStatus_t
1918 miopenConvolutionBackwardData(miopenHandle_t handle,
1919  const void* alpha,
1920  const miopenTensorDescriptor_t dyDesc,
1921  const void* dy,
1922  const miopenTensorDescriptor_t wDesc,
1923  const void* w,
1924  const miopenConvolutionDescriptor_t convDesc,
1926  const void* beta,
1927  const miopenTensorDescriptor_t dxDesc,
1928  void* dx,
1929  void* workSpace,
1930  size_t workSpaceSize);
1931 
1953 MIOPEN_EXPORT miopenStatus_t
1955  const miopenTensorDescriptor_t dyDesc,
1956  const miopenTensorDescriptor_t xDesc,
1957  const miopenConvolutionDescriptor_t convDesc,
1958  const miopenTensorDescriptor_t dwDesc,
1959  size_t* workSpaceSize);
1960 
2000 MIOPEN_EXPORT miopenStatus_t
2002  const miopenTensorDescriptor_t dyDesc,
2003  const void* dy,
2004  const miopenTensorDescriptor_t xDesc,
2005  const void* x,
2006  const miopenConvolutionDescriptor_t convDesc,
2007  const miopenTensorDescriptor_t dwDesc,
2008  void* dw,
2009  const int requestAlgoCount,
2010  int* returnedAlgoCount,
2011  miopenConvAlgoPerf_t* perfResults,
2012  void* workSpace,
2013  size_t workSpaceSize,
2014  bool exhaustiveSearch);
2015 
2049 MIOPEN_EXPORT miopenStatus_t
2050 miopenConvolutionBackwardWeights(miopenHandle_t handle,
2051  const void* alpha,
2052  const miopenTensorDescriptor_t dyDesc,
2053  const void* dy,
2054  const miopenTensorDescriptor_t xDesc,
2055  const void* x,
2056  const miopenConvolutionDescriptor_t convDesc,
2058  const void* beta,
2059  const miopenTensorDescriptor_t dwDesc,
2060  void* dw,
2061  void* workSpace,
2062  size_t workSpaceSize);
2063 
2079 MIOPEN_EXPORT miopenStatus_t miopenConvolutionBackwardBias(miopenHandle_t handle,
2080  const void* alpha,
2081  const miopenTensorDescriptor_t dyDesc,
2082  const void* dy,
2083  const void* beta,
2084  const miopenTensorDescriptor_t dbDesc,
2085  void* db);
2086 
2088 // CLOSEOUT CONVOLUTIONS DOXYGEN GROUP
2089 
2090 // Pooling APIs
2101 MIOPEN_EXPORT miopenStatus_t miopenCreatePoolingDescriptor(miopenPoolingDescriptor_t* poolDesc);
2102 
2111 MIOPEN_EXPORT miopenStatus_t miopenSetPoolingIndexType(miopenPoolingDescriptor_t poolDesc,
2112  miopenIndexType_t index_type);
2113 
2121 MIOPEN_EXPORT miopenStatus_t miopenGetPoolingIndexType(miopenPoolingDescriptor_t poolDesc,
2122  miopenIndexType_t* index_type);
2123 
2132  miopenPoolingDescriptor_t poolDesc, miopenPoolingWorkspaceIndexMode_t workspace_index);
2133 
2141  miopenPoolingDescriptor_t poolDesc, miopenPoolingWorkspaceIndexMode_t* workspace_index);
2142 
2157 MIOPEN_EXPORT miopenStatus_t miopenSet2dPoolingDescriptor(miopenPoolingDescriptor_t poolDesc,
2158  miopenPoolingMode_t mode,
2159  int windowHeight,
2160  int windowWidth,
2161  int pad_h,
2162  int pad_w,
2163  int stride_h,
2164  int stride_w);
2165 
2180 MIOPEN_EXPORT miopenStatus_t miopenGet2dPoolingDescriptor(const miopenPoolingDescriptor_t poolDesc,
2181  miopenPoolingMode_t* mode,
2182  int* windowHeight,
2183  int* windowWidth,
2184  int* pad_h,
2185  int* pad_w,
2186  int* stride_h,
2187  int* stride_w);
2188 
2203 MIOPEN_EXPORT miopenStatus_t
2204 miopenGetPoolingForwardOutputDim(const miopenPoolingDescriptor_t poolDesc,
2205  const miopenTensorDescriptor_t tensorDesc,
2206  int* n,
2207  int* c,
2208  int* h,
2209  int* w);
2210 
2226 MIOPEN_EXPORT miopenStatus_t miopenSetNdPoolingDescriptor(miopenPoolingDescriptor_t poolDesc,
2227  const miopenPoolingMode_t mode,
2228  int nbDims,
2229  const int* windowDimA,
2230  const int* padA,
2231  const int* stridesA);
2232 
2249 MIOPEN_EXPORT miopenStatus_t miopenGetNdPoolingDescriptor(const miopenPoolingDescriptor_t poolDesc,
2250  int nbDimsRequested,
2251  miopenPoolingMode_t* mode,
2252  int* nbDims,
2253  int* windowDimA,
2254  int* padA,
2255  int* stridesA);
2256 
2269 MIOPEN_EXPORT miopenStatus_t
2270 miopenGetPoolingNdForwardOutputDim(const miopenPoolingDescriptor_t poolDesc,
2271  const miopenTensorDescriptor_t tensorDesc,
2272  int dims,
2273  int* tensorDimArr);
2274 
2287 MIOPEN_EXPORT miopenStatus_t miopenPoolingGetWorkSpaceSize(const miopenTensorDescriptor_t yDesc,
2288  size_t* workSpaceSize);
2289 
2302 MIOPEN_EXPORT miopenStatus_t
2303 miopenPoolingGetWorkSpaceSizeV2(const miopenPoolingDescriptor_t poolDesc,
2304  const miopenTensorDescriptor_t yDesc,
2305  size_t* workSpaceSize);
2306 
2327 MIOPEN_EXPORT miopenStatus_t miopenPoolingForward(miopenHandle_t handle,
2328  const miopenPoolingDescriptor_t poolDesc,
2329  const void* alpha,
2330  const miopenTensorDescriptor_t xDesc,
2331  const void* x,
2332  const void* beta,
2333  const miopenTensorDescriptor_t yDesc,
2334  void* y,
2335  bool do_backward,
2336  void* workSpace,
2337  size_t workSpaceSize);
2338 
2359 MIOPEN_EXPORT miopenStatus_t miopenPoolingBackward(miopenHandle_t handle,
2360  const miopenPoolingDescriptor_t poolDesc,
2361  const void* alpha,
2362  const miopenTensorDescriptor_t yDesc,
2363  const void* y,
2364  const miopenTensorDescriptor_t dyDesc,
2365  const void* dy,
2366  const miopenTensorDescriptor_t xDesc,
2367  const void* x,
2368  const void* beta,
2369  const miopenTensorDescriptor_t dxDesc,
2370  void* dx,
2371  void* workSpace);
2372 
2378 MIOPEN_EXPORT miopenStatus_t miopenDestroyPoolingDescriptor(miopenPoolingDescriptor_t poolDesc);
2379 
2381 // CLOSEOUT POOLING DOXYGEN GROUP
2382 
2383 // LRN APIs
2393 MIOPEN_EXPORT miopenStatus_t miopenCreateLRNDescriptor(miopenLRNDescriptor_t* lrnDesc);
2394 
2408 MIOPEN_EXPORT miopenStatus_t miopenSetLRNDescriptor(const miopenLRNDescriptor_t lrnDesc,
2409  miopenLRNMode_t mode,
2410  unsigned int lrnN,
2411  double lrnAlpha,
2412  double lrnBeta,
2413  double lrnK);
2414 
2427 MIOPEN_EXPORT miopenStatus_t miopenGetLRNDescriptor(const miopenLRNDescriptor_t lrnDesc,
2428  miopenLRNMode_t* mode,
2429  unsigned int* lrnN,
2430  double* lrnAlpha,
2431  double* lrnBeta,
2432  double* lrnK);
2433 
2443 MIOPEN_EXPORT miopenStatus_t miopenLRNGetWorkSpaceSize(const miopenTensorDescriptor_t yDesc,
2444  size_t* workSpaceSize);
2445 
2464 MIOPEN_EXPORT miopenStatus_t miopenLRNForward(miopenHandle_t handle,
2465  const miopenLRNDescriptor_t lrnDesc,
2466  const void* alpha,
2467  const miopenTensorDescriptor_t xDesc,
2468  const void* x,
2469  const void* beta,
2470  const miopenTensorDescriptor_t yDesc,
2471  void* y,
2472  bool do_backward,
2473  void* workSpace);
2474 
2492 MIOPEN_EXPORT miopenStatus_t miopenLRNBackward(miopenHandle_t handle,
2493  const miopenLRNDescriptor_t lrnDesc,
2494  const void* alpha,
2495  const miopenTensorDescriptor_t yDesc,
2496  const void* y,
2497  const miopenTensorDescriptor_t dyDesc,
2498  const void* dy,
2499  const miopenTensorDescriptor_t xDesc,
2500  const void* x,
2501  const void* beta,
2502  const miopenTensorDescriptor_t dxDesc,
2503  void* dx,
2504  const void* workSpace);
2505 
2511 MIOPEN_EXPORT miopenStatus_t miopenDestroyLRNDescriptor(miopenLRNDescriptor_t lrnDesc);
2512 
2514 // CLOSEOUT LRN DOXYGEN GROUP
2515 
2516 #ifdef MIOPEN_BETA_API
2517 // LayerNorm APIs
2542 MIOPEN_EXPORT miopenStatus_t miopenLayerNormForward(miopenHandle_t handle,
2543  miopenNormMode_t mode,
2544  const miopenTensorDescriptor_t xDesc,
2545  const void* x,
2546  const miopenTensorDescriptor_t weightDesc,
2547  const void* weight,
2548  const miopenTensorDescriptor_t biasDesc,
2549  const void* bias,
2550  const float epsilon,
2551  const int32_t normalized_dim,
2552  const miopenTensorDescriptor_t yDesc,
2553  void* y,
2554  const miopenTensorDescriptor_t meanDesc,
2555  void* mean,
2556  const miopenTensorDescriptor_t rstdDesc,
2557  void* rstd);
2558 
2560 // CLOSEOUT LAYERNORM DOXYGEN GROUP
2561 #endif
2562 
2563 #ifdef MIOPEN_BETA_API
2564 // Cat APIs
2580 MIOPEN_EXPORT miopenStatus_t miopenCatForward(miopenHandle_t handle,
2581  const int32_t xCount,
2582  const miopenTensorDescriptor_t* xDescs,
2583  const void* const* xs,
2584  const miopenTensorDescriptor_t yDesc,
2585  void* y,
2586  const int32_t dim);
2587 
2589 // CLOSEOUT CAT DOXYGEN GROUP
2590 #endif
2591 
2592 // Batch-Normalization APIs
2614 MIOPEN_EXPORT miopenStatus_t miopenDeriveBNTensorDescriptor(miopenTensorDescriptor_t derivedBnDesc,
2615  const miopenTensorDescriptor_t xDesc,
2616  miopenBatchNormMode_t bn_mode);
2617 
2656 MIOPEN_EXPORT miopenStatus_t
2658  miopenBatchNormMode_t bn_mode,
2659  void* alpha,
2660  void* beta,
2661  const miopenTensorDescriptor_t xDesc,
2662  const void* x,
2663  const miopenTensorDescriptor_t yDesc,
2664  void* y,
2665  const miopenTensorDescriptor_t bnScaleBiasMeanVarDesc,
2666  void* bnScale,
2667  void* bnBias,
2668  double expAvgFactor,
2669  void* resultRunningMean,
2670  void* resultRunningVariance,
2671  double epsilon,
2672  void* resultSaveMean,
2673  void* resultSaveInvVariance);
2674 
2704 MIOPEN_EXPORT miopenStatus_t
2706  miopenBatchNormMode_t bn_mode,
2707  void* alpha,
2708  void* beta,
2709  const miopenTensorDescriptor_t xDesc,
2710  const void* x,
2711  const miopenTensorDescriptor_t yDesc,
2712  void* y,
2713  const miopenTensorDescriptor_t bnScaleBiasMeanVarDesc,
2714  void* bnScale,
2715  void* bnBias,
2716  void* estimatedMean,
2717  void* estimatedVariance,
2718  double epsilon);
2719 
2754 MIOPEN_EXPORT miopenStatus_t
2755 miopenBatchNormalizationBackward(miopenHandle_t handle,
2756  miopenBatchNormMode_t bn_mode,
2757  const void* alphaDataDiff,
2758  const void* betaDataDiff,
2759  const void* alphaParamDiff,
2760  const void* betaParamDiff,
2761  const miopenTensorDescriptor_t xDesc,
2762  const void* x,
2763  const miopenTensorDescriptor_t dyDesc,
2764  const void* dy,
2765  const miopenTensorDescriptor_t dxDesc,
2766  void* dx,
2767  const miopenTensorDescriptor_t bnScaleBiasDiffDesc,
2768  const void* bnScale,
2769  void* resultBnScaleDiff,
2770  void* resultBnBiasDiff,
2771  double epsilon,
2772  const void* savedMean,
2773  const void* savedInvVariance);
2774 
2776 // CLOSEOUT BATCHNORM DOXYGEN GROUP
2777 
2778 // Activation APIs
2788 MIOPEN_EXPORT miopenStatus_t
2789 miopenCreateActivationDescriptor(miopenActivationDescriptor_t* activDesc);
2790 
2802 MIOPEN_EXPORT miopenStatus_t
2803 miopenSetActivationDescriptor(const miopenActivationDescriptor_t activDesc,
2805  double activAlpha,
2806  double activBeta,
2807  double activGamma);
2808 
2820 MIOPEN_EXPORT miopenStatus_t
2821 miopenGetActivationDescriptor(const miopenActivationDescriptor_t activDesc,
2822  miopenActivationMode_t* mode,
2823  double* activAlpha,
2824  double* activBeta,
2825  double* activGamma);
2826 
2839 MIOPEN_EXPORT miopenStatus_t miopenActivationForward(miopenHandle_t handle,
2840  const miopenActivationDescriptor_t activDesc,
2841  const void* alpha,
2842  const miopenTensorDescriptor_t xDesc,
2843  const void* x,
2844  const void* beta,
2845  const miopenTensorDescriptor_t yDesc,
2846  void* y);
2847 
2864 MIOPEN_EXPORT miopenStatus_t miopenActivationBackward(miopenHandle_t handle,
2865  const miopenActivationDescriptor_t activDesc,
2866  const void* alpha,
2867  const miopenTensorDescriptor_t yDesc,
2868  const void* y,
2869  const miopenTensorDescriptor_t dyDesc,
2870  const void* dy,
2871  const miopenTensorDescriptor_t xDesc,
2872  const void* x,
2873  const void* beta,
2874  const miopenTensorDescriptor_t dxDesc,
2875  void* dx);
2876 
2882 MIOPEN_EXPORT miopenStatus_t
2883 miopenDestroyActivationDescriptor(miopenActivationDescriptor_t activDesc);
2884 
2886 // CLOSEOUT ACTIVATION DOXYGEN GROUP
2887 
2888 // Softmax APIs
2906 MIOPEN_EXPORT miopenStatus_t miopenSoftmaxForward(miopenHandle_t handle,
2907  const void* alpha,
2908  const miopenTensorDescriptor_t xDesc,
2909  const void* x,
2910  const void* beta,
2911  const miopenTensorDescriptor_t yDesc,
2912  void* y);
2913 
2929 MIOPEN_EXPORT miopenStatus_t miopenSoftmaxBackward(miopenHandle_t handle,
2930  const void* alpha,
2931  const miopenTensorDescriptor_t yDesc,
2932  const void* y,
2933  const miopenTensorDescriptor_t dyDesc,
2934  const void* dy,
2935  const void* beta,
2936  const miopenTensorDescriptor_t dxDesc,
2937  void* dx);
2938 
2952 MIOPEN_EXPORT miopenStatus_t miopenSoftmaxForward_V2(miopenHandle_t handle,
2953  const void* alpha,
2954  const miopenTensorDescriptor_t xDesc,
2955  const void* x,
2956  const void* beta,
2957  const miopenTensorDescriptor_t yDesc,
2958  void* y,
2959  miopenSoftmaxAlgorithm_t algorithm,
2960  miopenSoftmaxMode_t mode);
2961 
2977 MIOPEN_EXPORT miopenStatus_t miopenSoftmaxBackward_V2(miopenHandle_t handle,
2978  const void* alpha,
2979  const miopenTensorDescriptor_t yDesc,
2980  const void* y,
2981  const miopenTensorDescriptor_t dyDesc,
2982  const void* dy,
2983  const void* beta,
2984  const miopenTensorDescriptor_t dxDesc,
2985  void* dx,
2986  miopenSoftmaxAlgorithm_t algorithm,
2987  miopenSoftmaxMode_t mode);
2988 
2990 // CLOSEOUT SOFTMAX DOXYGEN GROUP
2991 
2995 MIOPEN_DECLARE_OBJECT(miopenFusionPlanDescriptor);
2996 MIOPEN_DECLARE_OBJECT(miopenOperatorDescriptor);
2997 MIOPEN_DECLARE_OBJECT(miopenOperatorArgs);
2998 
3007 typedef enum
3008 {
3012 
3020 MIOPEN_EXPORT miopenStatus_t miopenCreateFusionPlan(miopenFusionPlanDescriptor_t* fusePlanDesc,
3021  const miopenFusionDirection_t fuseDirection,
3022  const miopenTensorDescriptor_t inputDesc);
3023 
3029 MIOPEN_EXPORT miopenStatus_t miopenDestroyFusionPlan(miopenFusionPlanDescriptor_t fusePlanDesc);
3030 
3037 MIOPEN_EXPORT miopenStatus_t miopenCompileFusionPlan(miopenHandle_t handle,
3038  miopenFusionPlanDescriptor_t fusePlanDesc);
3039 
3050 MIOPEN_EXPORT miopenStatus_t miopenFusionPlanGetOp(miopenFusionPlanDescriptor_t fusePlanDesc,
3051  const int op_idx,
3052  miopenFusionOpDescriptor_t* op);
3053 
3061 MIOPEN_EXPORT miopenStatus_t
3062 miopenFusionPlanGetWorkSpaceSize(miopenHandle_t handle,
3063  miopenFusionPlanDescriptor_t fusePlanDesc,
3064  size_t* workSpaceSize,
3066 
3084 MIOPEN_EXPORT miopenStatus_t
3085 miopenFusionPlanConvolutionGetAlgo(miopenFusionPlanDescriptor_t fusePlanDesc,
3086  const int requestAlgoCount,
3087  int* returnedAlgoCount,
3088  miopenConvFwdAlgorithm_t* returnedAlgos);
3089 
3100  miopenFusionPlanDescriptor_t fusePlanDesc, miopenConvFwdAlgorithm_t algo);
3101 
3110 MIOPEN_EXPORT miopenStatus_t miopenCreateOpConvForward(miopenFusionPlanDescriptor_t fusePlanDesc,
3111  miopenFusionOpDescriptor_t* convOp,
3112  miopenConvolutionDescriptor_t convDesc,
3113  const miopenTensorDescriptor_t wDesc);
3114 
3115 //---
3116 
3117 // Activation forward create ops ---
3125 MIOPEN_EXPORT miopenStatus_t
3126 miopenCreateOpActivationForward(miopenFusionPlanDescriptor_t fusePlanDesc,
3127  miopenFusionOpDescriptor_t* activFwdOp,
3128  miopenActivationMode_t mode);
3129 
3130 // Activation backward create ops ---
3138 MIOPEN_EXPORT miopenStatus_t
3139 miopenCreateOpActivationBackward(miopenFusionPlanDescriptor_t fusePlanDesc,
3140  miopenFusionOpDescriptor_t* activBwdOp,
3141  miopenActivationMode_t mode);
3142 
3143 // Bias create ops ---
3151 MIOPEN_EXPORT miopenStatus_t miopenCreateOpBiasForward(miopenFusionPlanDescriptor_t fusePlanDesc,
3152  miopenFusionOpDescriptor_t* biasOp,
3153  const miopenTensorDescriptor_t bDesc);
3154 
3155 // Batch normalization create ops ---
3164 MIOPEN_EXPORT miopenStatus_t
3165 miopenCreateOpBatchNormInference(miopenFusionPlanDescriptor_t fusePlanDesc,
3166  miopenFusionOpDescriptor_t* bnOp,
3167  const miopenBatchNormMode_t bn_mode,
3168  const miopenTensorDescriptor_t bnScaleBiasMeanVarDesc);
3169 
3179 MIOPEN_EXPORT miopenStatus_t
3180 miopenCreateOpBatchNormForward(miopenFusionPlanDescriptor_t fusePlanDesc,
3181  miopenFusionOpDescriptor_t* bnFwdOp,
3182  const miopenBatchNormMode_t bn_mode,
3183  bool runningMeanVariance);
3184 
3192 MIOPEN_EXPORT miopenStatus_t
3193 miopenCreateOpBatchNormBackward(miopenFusionPlanDescriptor_t fusePlanDesc,
3194  miopenFusionOpDescriptor_t* bnBwdOp,
3195  const miopenBatchNormMode_t bn_mode);
3196 
3197 //---
3203 MIOPEN_EXPORT miopenStatus_t miopenCreateOperatorArgs(miopenOperatorArgs_t* args);
3204 
3210 MIOPEN_EXPORT miopenStatus_t miopenDestroyOperatorArgs(miopenOperatorArgs_t args);
3211 
3212 // Convolution set arguments ---
3222 MIOPEN_EXPORT miopenStatus_t miopenSetOpArgsConvForward(miopenOperatorArgs_t args,
3223  const miopenFusionOpDescriptor_t convOp,
3224  const void* alpha,
3225  const void* beta,
3226  const void* w);
3227 // Activation set arguments ---
3239 MIOPEN_EXPORT miopenStatus_t
3240 miopenSetOpArgsActivForward(miopenOperatorArgs_t args,
3241  const miopenFusionOpDescriptor_t activFwdOp,
3242  const void* alpha,
3243  const void* beta,
3244  double activAlpha,
3245  double activBeta,
3246  double activGamma);
3247 
3261 MIOPEN_EXPORT miopenStatus_t
3262 miopenSetOpArgsActivBackward(miopenOperatorArgs_t args,
3263  const miopenFusionOpDescriptor_t activBwdOp,
3264  const void* alpha,
3265  const void* beta,
3266  const void* y,
3267  const void* reserved,
3268  double activAlpha,
3269  double activBeta,
3270  double activGamma);
3271 
3272 // Batch Normalization set arguments ---
3286 MIOPEN_EXPORT miopenStatus_t
3287 miopenSetOpArgsBatchNormInference(miopenOperatorArgs_t args,
3288  const miopenFusionOpDescriptor_t bnOp,
3289  const void* alpha,
3290  const void* beta,
3291  const void* bnScale,
3292  const void* bnBias,
3293  const void* estimatedMean,
3294  const void* estimatedVariance,
3295  double epsilon);
3296 
3313 MIOPEN_EXPORT miopenStatus_t miopenSetOpArgsBatchNormForward(miopenOperatorArgs_t args,
3314  const miopenFusionOpDescriptor_t bnOp,
3315  const void* alpha,
3316  const void* beta,
3317  const void* bnScale,
3318  const void* bnBias,
3319  void* savedMean,
3320  void* savedInvVariance,
3321  void* runningMean,
3322  void* runningVariance,
3323  double expAvgFactor,
3324  double epsilon);
3325 
3341 MIOPEN_EXPORT miopenStatus_t miopenSetOpArgsBatchNormBackward(miopenOperatorArgs_t args,
3342  const miopenFusionOpDescriptor_t bnOp,
3343  const void* alpha,
3344  const void* beta,
3345  const void* x,
3346  const void* bnScale,
3347  const void* bnBias,
3348  void* resultBnScaleDiff,
3349  void* resultBnBiasDiff,
3350  const void* savedMean,
3351  const void* savedInvVariance);
3352 
3353 // Bias forward set arguments ---
3363 MIOPEN_EXPORT miopenStatus_t miopenSetOpArgsBiasForward(miopenOperatorArgs_t args,
3364  const miopenFusionOpDescriptor_t biasOp,
3365  const void* alpha,
3366  const void* beta,
3367  const void* bias);
3380 MIOPEN_EXPORT miopenStatus_t
3381 miopenExecuteFusionPlan(const miopenHandle_t handle,
3382  const miopenFusionPlanDescriptor_t fusePlanDesc,
3383  const miopenTensorDescriptor_t inputDesc,
3384  const void* input,
3385  const miopenTensorDescriptor_t outputDesc,
3386  void* output,
3387  miopenOperatorArgs_t args);
3388 
3412 MIOPEN_EXPORT miopenStatus_t
3414  const void* alpha1,
3415  const miopenTensorDescriptor_t xDesc,
3416  const void* x,
3417  const miopenTensorDescriptor_t wDesc,
3418  const void* w,
3419  const miopenConvolutionDescriptor_t convDesc,
3421  void* workspace,
3422  size_t workspaceSizeInBytes,
3423  const void* alpha2,
3424  const miopenTensorDescriptor_t zDesc,
3425  const void* z,
3426  const miopenTensorDescriptor_t biasDesc,
3427  const void* bias,
3428  const miopenActivationDescriptor_t activationDesc,
3429  const miopenTensorDescriptor_t yDesc,
3430  void* y);
3432 // CLOSEOUT FUSION DOXYGEN GROUP
3433 
3442 typedef enum
3443 {
3448 } miopenRNNMode_t;
3449 
3453 typedef enum
3454 {
3458 
3462 typedef enum
3463 {
3464  miopenRNNdefault = 0,
3467  1,
3468 } miopenRNNAlgo_t;
3469 
3473 typedef enum
3474 {
3478 
3482 typedef enum
3483 {
3487 
3491 typedef enum
3492 {
3495 
3499 typedef enum
3500 {
3504 
3508 typedef enum
3509 {
3513 
3517 typedef enum
3518 {
3524 
3531 MIOPEN_EXPORT miopenStatus_t miopenCreateRNNDescriptor(miopenRNNDescriptor_t* rnnDesc);
3532 
3545 MIOPEN_EXPORT miopenStatus_t miopenGetRNNDescriptor(miopenRNNDescriptor_t rnnDesc,
3546  miopenRNNMode_t* rnnMode,
3547  miopenRNNAlgo_t* algoMode,
3548  miopenRNNInputMode_t* inputMode,
3549  miopenRNNDirectionMode_t* dirMode,
3550  miopenRNNBiasMode_t* biasMode,
3551  int* hiddenSize,
3552  int* layer);
3553 
3570 MIOPEN_EXPORT miopenStatus_t miopenGetRNNDescriptor_V2(miopenRNNDescriptor_t rnnDesc,
3571  int* hiddenSize,
3572  int* layer,
3573  miopenDropoutDescriptor_t* dropoutDesc,
3574  miopenRNNInputMode_t* inputMode,
3575  miopenRNNDirectionMode_t* dirMode,
3576  miopenRNNMode_t* rnnMode,
3577  miopenRNNBiasMode_t* biasMode,
3578  miopenRNNAlgo_t* algoMode,
3579  miopenDataType_t* dataType);
3580 
3586 MIOPEN_EXPORT miopenStatus_t miopenDestroyRNNDescriptor(miopenRNNDescriptor_t rnnDesc);
3587 
3603 MIOPEN_EXPORT miopenStatus_t miopenSetRNNDescriptor(miopenRNNDescriptor_t rnnDesc,
3604  const int hsize,
3605  const int nlayers,
3606  miopenRNNInputMode_t inMode,
3607  miopenRNNDirectionMode_t direction,
3608  miopenRNNMode_t rnnMode,
3609  miopenRNNBiasMode_t biasMode,
3610  miopenRNNAlgo_t algo,
3611  miopenDataType_t dataType);
3612 
3631 MIOPEN_EXPORT miopenStatus_t miopenSetRNNDescriptor_V2(miopenRNNDescriptor_t rnnDesc,
3632  const int hsize,
3633  const int nlayers,
3634  miopenDropoutDescriptor_t dropoutDesc,
3635  miopenRNNInputMode_t inMode,
3636  miopenRNNDirectionMode_t direction,
3637  miopenRNNMode_t rnnMode,
3638  miopenRNNBiasMode_t biasMode,
3639  miopenRNNAlgo_t algo,
3640  miopenDataType_t dataType);
3641 
3656 MIOPEN_EXPORT miopenStatus_t
3657 miopenSetRNNDataSeqTensorDescriptor(miopenSeqTensorDescriptor_t seqTensorDesc,
3658  miopenDataType_t dataType,
3659  miopenRNNBaseLayout_t layout,
3660  int maxSequenceLen,
3661  int batchSize,
3662  int vectorSize,
3663  const int* sequenceLenArray,
3664  void* paddingMarker);
3665 
3684 MIOPEN_EXPORT miopenStatus_t
3685 miopenGetRNNDataSeqTensorDescriptor(miopenSeqTensorDescriptor_t seqTensorDesc,
3686  miopenDataType_t* dataType,
3687  miopenRNNBaseLayout_t* layout,
3688  int* maxSequenceLen,
3689  int* batchSize,
3690  int* vectorSize,
3691  int sequenceLenArrayLimit,
3692  int* sequenceLenArray,
3693  void* paddingMarker);
3694 
3711 MIOPEN_EXPORT miopenStatus_t miopenGetRNNWorkspaceSize(miopenHandle_t handle,
3712  const miopenRNNDescriptor_t rnnDesc,
3713  const int sequenceLen,
3714  const miopenTensorDescriptor_t* xDesc,
3715  size_t* numBytes);
3716 
3733 MIOPEN_EXPORT miopenStatus_t miopenGetRNNTrainingReserveSize(miopenHandle_t handle,
3734  miopenRNNDescriptor_t rnnDesc,
3735  const int sequenceLen,
3736  const miopenTensorDescriptor_t* xDesc,
3737  size_t* numBytes);
3738 
3755 MIOPEN_EXPORT miopenStatus_t miopenGetRNNTempSpaceSizes(miopenHandle_t handle,
3756  miopenRNNDescriptor_t rnnDesc,
3757  miopenSeqTensorDescriptor_t xDesc,
3758  miopenRNNFWDMode_t fwdMode,
3759  size_t* workSpaceSize,
3760  size_t* reserveSpaceSize);
3761 
3774 MIOPEN_EXPORT miopenStatus_t miopenGetRNNParamsSize(miopenHandle_t handle,
3775  miopenRNNDescriptor_t rnnDesc,
3776  miopenTensorDescriptor_t xDesc,
3777  size_t* numBytes,
3778  miopenDataType_t dtype);
3779 
3792 MIOPEN_EXPORT miopenStatus_t miopenGetRNNParamsDescriptor(miopenHandle_t handle,
3793  miopenRNNDescriptor_t rnnDesc,
3794  miopenTensorDescriptor_t xDesc,
3795  miopenTensorDescriptor_t wDesc,
3796  miopenDataType_t dtype);
3797 
3815 MIOPEN_EXPORT miopenStatus_t miopenGetRNNInputTensorSize(miopenHandle_t handle,
3816  miopenRNNDescriptor_t rnnDesc,
3817  const int seqLen,
3818  miopenTensorDescriptor_t* xDesc,
3819  size_t* numBytes);
3820 
3833 MIOPEN_EXPORT miopenStatus_t miopenGetRNNHiddenTensorSize(miopenHandle_t handle,
3834  miopenRNNDescriptor_t rnnDesc,
3835  const int seqLen,
3836  miopenTensorDescriptor_t* xDesc,
3837  size_t* numBytes);
3838 
3879 MIOPEN_EXPORT miopenStatus_t miopenGetRNNLayerParamSize(miopenHandle_t handle,
3880  miopenRNNDescriptor_t rnnDesc,
3881  const int layer,
3882  miopenTensorDescriptor_t xDesc,
3883  const int paramID,
3884  size_t* numBytes);
3885 
3923 MIOPEN_EXPORT miopenStatus_t miopenGetRNNLayerBiasSize(miopenHandle_t handle,
3924  miopenRNNDescriptor_t rnnDesc,
3925  const int layer,
3926  const int biasID,
3927  size_t* numBytes);
3928 
3987 MIOPEN_EXPORT miopenStatus_t miopenGetRNNLayerParam(miopenHandle_t handle,
3988  miopenRNNDescriptor_t rnnDesc,
3989  const int layer,
3990  miopenTensorDescriptor_t xDesc,
3991  miopenTensorDescriptor_t wDesc,
3992  const void* w,
3993  const int paramID,
3994  miopenTensorDescriptor_t paramDesc,
3995  void* layerParam);
3996 
4054 MIOPEN_EXPORT miopenStatus_t miopenGetRNNLayerBias(miopenHandle_t handle,
4055  miopenRNNDescriptor_t rnnDesc,
4056  const int layer,
4057  miopenTensorDescriptor_t xDesc,
4058  miopenTensorDescriptor_t wDesc,
4059  const void* w,
4060  const int biasID,
4061  miopenTensorDescriptor_t biasDesc,
4062  void* layerBias);
4063 
4118 MIOPEN_EXPORT miopenStatus_t miopenGetRNNLayerParamOffset(miopenRNNDescriptor_t rnnDesc,
4119  const int layer,
4120  miopenTensorDescriptor_t xDesc,
4121  const int paramID,
4122  miopenTensorDescriptor_t paramDesc,
4123  size_t* layerParamOffset);
4124 
4175 MIOPEN_EXPORT miopenStatus_t miopenGetRNNLayerBiasOffset(miopenRNNDescriptor_t rnnDesc,
4176  const int layer,
4177  miopenTensorDescriptor_t xDesc,
4178  const int biasID,
4179  miopenTensorDescriptor_t biasDesc,
4180  size_t* layerBiasOffset);
4181 
4234 MIOPEN_EXPORT miopenStatus_t miopenSetRNNLayerParam(miopenHandle_t handle,
4235  miopenRNNDescriptor_t rnnDesc,
4236  const int layer,
4237  miopenTensorDescriptor_t xDesc,
4238  miopenTensorDescriptor_t wDesc,
4239  void* w,
4240  const int paramID,
4241  miopenTensorDescriptor_t paramDesc,
4242  const void* layerParam);
4243 
4294 MIOPEN_EXPORT miopenStatus_t miopenSetRNNLayerBias(miopenHandle_t handle,
4295  miopenRNNDescriptor_t rnnDesc,
4296  const int layer,
4297  miopenTensorDescriptor_t xDesc,
4298  miopenTensorDescriptor_t wDesc,
4299  void* w,
4300  const int biasID,
4301  miopenTensorDescriptor_t biasDesc,
4302  const void* layerBias);
4303 
4315 MIOPEN_EXPORT miopenStatus_t miopenSetRNNPaddingMode(miopenRNNDescriptor_t rnnDesc,
4316  miopenRNNPaddingMode_t paddingMode);
4317 
4325 MIOPEN_EXPORT miopenStatus_t miopenGetRNNPaddingMode(miopenRNNDescriptor_t rnnDesc,
4326  miopenRNNPaddingMode_t* paddingMode);
4327 
4378 MIOPEN_EXPORT miopenStatus_t miopenRNNForward(miopenHandle_t handle,
4379  const miopenRNNDescriptor_t rnnDesc,
4380  miopenRNNFWDMode_t fwdMode,
4381  const miopenSeqTensorDescriptor_t xDesc,
4382  const void* x,
4383  const miopenTensorDescriptor_t hDesc,
4384  const void* hx,
4385  void* hy,
4386  const miopenTensorDescriptor_t cDesc,
4387  const void* cx,
4388  void* cy,
4389  const miopenSeqTensorDescriptor_t yDesc,
4390  void* y,
4391  const void* w,
4392  size_t weightSpaceSize,
4393  void* workSpace,
4394  size_t workSpaceNumBytes,
4395  void* reserveSpace,
4396  size_t reserveSpaceNumBytes);
4397 
4447 MIOPEN_EXPORT miopenStatus_t miopenRNNBackwardSeqData(miopenHandle_t handle,
4448  const miopenRNNDescriptor_t rnnDesc,
4449  const miopenSeqTensorDescriptor_t yDesc,
4450  const void* y,
4451  const void* dy,
4452  const miopenTensorDescriptor_t hDesc,
4453  const void* hx,
4454  const void* dhy,
4455  void* dhx,
4456  const miopenTensorDescriptor_t cDesc,
4457  const void* cx,
4458  const void* dcy,
4459  void* dcx,
4460  const miopenSeqTensorDescriptor_t xDesc,
4461  void* dx,
4462  const void* w,
4463  size_t weightSpaceSize,
4464  void* workSpace,
4465  size_t workSpaceNumBytes,
4466  void* reserveSpace,
4467  size_t reserveSpaceNumBytes);
4468 
4502 MIOPEN_EXPORT miopenStatus_t
4504  const miopenRNNDescriptor_t rnnDesc,
4505  const miopenSeqTensorDescriptor_t xDesc,
4506  const void* x,
4507  const miopenTensorDescriptor_t hDesc,
4508  const void* hx,
4509  const miopenSeqTensorDescriptor_t yDesc,
4510  const void* y,
4511  void* dw,
4512  size_t weightSpaceSize,
4513  void* workSpace,
4514  size_t workSpaceNumBytes,
4515  const void* reserveSpace,
4516  size_t reserveSpaceNumBytes);
4517 
4575 MIOPEN_EXPORT miopenStatus_t miopenRNNForwardTraining(miopenHandle_t handle,
4576  const miopenRNNDescriptor_t rnnDesc,
4577  const int sequenceLen,
4578  const miopenTensorDescriptor_t* xDesc,
4579  const void* x,
4580  const miopenTensorDescriptor_t hxDesc,
4581  const void* hx,
4582  const miopenTensorDescriptor_t cxDesc,
4583  const void* cx,
4584  const miopenTensorDescriptor_t wDesc,
4585  const void* w,
4586  const miopenTensorDescriptor_t* yDesc,
4587  void* y,
4588  const miopenTensorDescriptor_t hyDesc,
4589  void* hy,
4590  const miopenTensorDescriptor_t cyDesc,
4591  void* cy,
4592  void* workSpace,
4593  size_t workSpaceNumBytes,
4594  void* reserveSpace,
4595  size_t reserveSpaceNumBytes);
4596 
4669 MIOPEN_EXPORT miopenStatus_t miopenRNNBackwardData(miopenHandle_t handle,
4670  const miopenRNNDescriptor_t rnnDesc,
4671  const int sequenceLen,
4672  const miopenTensorDescriptor_t* yDesc,
4673  const void* y,
4674  const miopenTensorDescriptor_t* dyDesc,
4675  const void* dy,
4676  const miopenTensorDescriptor_t dhyDesc,
4677  const void* dhy,
4678  const miopenTensorDescriptor_t dcyDesc,
4679  const void* dcy,
4680  const miopenTensorDescriptor_t wDesc,
4681  const void* w,
4682  const miopenTensorDescriptor_t hxDesc,
4683  const void* hx,
4684  const miopenTensorDescriptor_t cxDesc,
4685  const void* cx,
4686  const miopenTensorDescriptor_t* dxDesc,
4687  void* dx,
4688  const miopenTensorDescriptor_t dhxDesc,
4689  void* dhx,
4690  const miopenTensorDescriptor_t dcxDesc,
4691  void* dcx,
4692  void* workSpace,
4693  size_t workSpaceNumBytes,
4694  void* reserveSpace,
4695  size_t reserveSpaceNumBytes);
4696 
4733 MIOPEN_EXPORT miopenStatus_t miopenRNNBackwardWeights(miopenHandle_t handle,
4734  const miopenRNNDescriptor_t rnnDesc,
4735  const int sequenceLen,
4736  const miopenTensorDescriptor_t* xDesc,
4737  const void* x,
4738  const miopenTensorDescriptor_t hxDesc,
4739  const void* hx,
4740  const miopenTensorDescriptor_t* yDesc,
4741  const void* y,
4742  const miopenTensorDescriptor_t dwDesc,
4743  void* dw,
4744  void* workSpace,
4745  size_t workSpaceNumBytes,
4746  const void* reserveSpace,
4747  size_t reserveSpaceNumBytes);
4748 
4804 MIOPEN_EXPORT miopenStatus_t miopenRNNForwardInference(miopenHandle_t handle,
4805  miopenRNNDescriptor_t rnnDesc,
4806  const int sequenceLen,
4807  const miopenTensorDescriptor_t* xDesc,
4808  const void* x,
4809  const miopenTensorDescriptor_t hxDesc,
4810  const void* hx,
4811  const miopenTensorDescriptor_t cxDesc,
4812  const void* cx,
4813  const miopenTensorDescriptor_t wDesc,
4814  const void* w,
4815  const miopenTensorDescriptor_t* yDesc,
4816  void* y,
4817  const miopenTensorDescriptor_t hyDesc,
4818  void* hy,
4819  const miopenTensorDescriptor_t cyDesc,
4820  void* cy,
4821  void* workSpace,
4822  size_t workSpaceNumBytes);
4823 
4825 // CLOSEOUT RNN DOXYGEN GROUP
4826 
4835 typedef enum
4836 {
4839 
4846 MIOPEN_EXPORT miopenStatus_t miopenCreateCTCLossDescriptor(miopenCTCLossDescriptor_t* ctcLossDesc);
4847 
4857 MIOPEN_EXPORT miopenStatus_t miopenGetCTCLossDescriptor(miopenCTCLossDescriptor_t ctcLossDesc,
4858  miopenDataType_t* dataType,
4859  int* blank_label_id,
4860  bool* apply_softmax_layer);
4861 
4867 MIOPEN_EXPORT miopenStatus_t miopenDestroyCTCLossDescriptor(miopenCTCLossDescriptor_t ctcLossDesc);
4868 
4878 MIOPEN_EXPORT miopenStatus_t miopenSetCTCLossDescriptor(miopenCTCLossDescriptor_t ctcLossDesc,
4879  miopenDataType_t dataType,
4880  const int blank_label_id,
4881  bool apply_softmax_layer);
4882 
4899 MIOPEN_EXPORT miopenStatus_t
4900 miopenGetCTCLossWorkspaceSize(miopenHandle_t handle,
4901  const miopenTensorDescriptor_t probsDesc,
4902  const miopenTensorDescriptor_t gradientsDesc,
4903  const int* labels,
4904  const int* labelLengths,
4905  const int* inputLengths,
4906  miopenCTCLossAlgo_t algo,
4907  const miopenCTCLossDescriptor_t ctcLossDesc,
4908  size_t* workSpaceSize);
4909 
4929 MIOPEN_EXPORT miopenStatus_t miopenCTCLoss(miopenHandle_t handle,
4930  const miopenTensorDescriptor_t probsDesc,
4931  const void* probs,
4932  const int* labels,
4933  const int* labelLengths,
4934  const int* inputLengths,
4935  void* losses,
4936  const miopenTensorDescriptor_t gradientsDesc,
4937  void* gradients,
4938  miopenCTCLossAlgo_t algo,
4939  const miopenCTCLossDescriptor_t ctcLossDesc,
4940  void* workSpace,
4941  size_t workSpaceSize);
4942 
4944 // CLOSEOUT LossFunction DOXYGEN GROUP
4945 
4946 // Dropout APIs
4955 typedef enum
4956 {
4958 } miopenRNGType_t;
4959 
4965 MIOPEN_EXPORT miopenStatus_t miopenCreateDropoutDescriptor(miopenDropoutDescriptor_t* dropoutDesc);
4966 
4972 MIOPEN_EXPORT miopenStatus_t miopenDestroyDropoutDescriptor(miopenDropoutDescriptor_t dropoutDesc);
4973 
4982 MIOPEN_EXPORT miopenStatus_t miopenDropoutGetReserveSpaceSize(const miopenTensorDescriptor_t xDesc,
4983  size_t* reserveSpaceSizeInBytes);
4984 
4993 MIOPEN_EXPORT miopenStatus_t miopenDropoutGetStatesSize(miopenHandle_t handle,
4994  size_t* stateSizeInBytes);
4995 
5012 MIOPEN_EXPORT miopenStatus_t miopenGetDropoutDescriptor(miopenDropoutDescriptor_t dropoutDesc,
5013  miopenHandle_t handle,
5014  float* dropout,
5015  void** states,
5016  unsigned long long* seed,
5017  bool* use_mask,
5018  bool* state_evo,
5019  miopenRNGType_t* rng_mode);
5020 
5043 MIOPEN_EXPORT miopenStatus_t miopenRestoreDropoutDescriptor(miopenDropoutDescriptor_t dropoutDesc,
5044  miopenHandle_t handle,
5045  float dropout,
5046  void* states,
5047  size_t stateSizeInBytes,
5048  unsigned long long seed,
5049  bool use_mask,
5050  bool state_evo,
5051  miopenRNGType_t rng_mode);
5052 
5072 MIOPEN_EXPORT miopenStatus_t miopenSetDropoutDescriptor(miopenDropoutDescriptor_t dropoutDesc,
5073  miopenHandle_t handle,
5074  float dropout,
5075  void* states,
5076  size_t stateSizeInBytes,
5077  unsigned long long seed,
5078  bool use_mask,
5079  bool state_evo,
5080  miopenRNGType_t rng_mode);
5081 
5099 MIOPEN_EXPORT miopenStatus_t miopenDropoutForward(miopenHandle_t handle,
5100  const miopenDropoutDescriptor_t dropoutDesc,
5101  const miopenTensorDescriptor_t noise_shape,
5102  const miopenTensorDescriptor_t xDesc,
5103  const void* x,
5104  const miopenTensorDescriptor_t yDesc,
5105  void* y,
5106  void* reserveSpace,
5107  size_t reserveSpaceSizeInBytes);
5108 
5126 MIOPEN_EXPORT miopenStatus_t miopenDropoutBackward(miopenHandle_t handle,
5127  const miopenDropoutDescriptor_t dropoutDesc,
5128  const miopenTensorDescriptor_t noise_shape,
5129  const miopenTensorDescriptor_t dyDesc,
5130  const void* dy,
5131  const miopenTensorDescriptor_t dxDesc,
5132  void* dx,
5133  void* reserveSpace,
5134  size_t reserveSpaceSizeInBytes);
5135 
5137 // CLOSEOUT DROPOUT DOXYGEN GROUP
5138 
5139 // TensorReduce APIs
5150 MIOPEN_EXPORT miopenStatus_t
5151 miopenCreateReduceTensorDescriptor(miopenReduceTensorDescriptor_t* reduceTensorDesc);
5152 
5158 MIOPEN_EXPORT miopenStatus_t
5159 miopenDestroyReduceTensorDescriptor(miopenReduceTensorDescriptor_t reduceTensorDesc);
5160 
5173 MIOPEN_EXPORT miopenStatus_t
5174 miopenSetReduceTensorDescriptor(miopenReduceTensorDescriptor_t reduceTensorDesc,
5175  miopenReduceTensorOp_t reduceTensorOp,
5176  miopenDataType_t reduceTensorCompType,
5177  miopenNanPropagation_t reduceTensorNanOpt,
5178  miopenReduceTensorIndices_t reduceTensorIndices,
5179  miopenIndicesType_t reduceTensorIndicesType);
5180 
5196 MIOPEN_EXPORT miopenStatus_t
5197 miopenGetReduceTensorDescriptor(const miopenReduceTensorDescriptor_t reduceTensorDesc,
5198  miopenReduceTensorOp_t* reduceTensorOp,
5199  miopenDataType_t* reduceTensorCompType,
5200  miopenNanPropagation_t* reduceTensorNanOpt,
5201  miopenReduceTensorIndices_t* reduceTensorIndices,
5202  miopenIndicesType_t* reduceTensorIndicesType);
5203 
5213 MIOPEN_EXPORT miopenStatus_t
5214 miopenGetReductionIndicesSize(miopenHandle_t handle,
5215  const miopenReduceTensorDescriptor_t reduceTensorDesc,
5216  const miopenTensorDescriptor_t aDesc,
5217  const miopenTensorDescriptor_t cDesc,
5218  size_t* sizeInBytes);
5219 
5229 MIOPEN_EXPORT miopenStatus_t
5230 miopenGetReductionWorkspaceSize(miopenHandle_t handle,
5231  const miopenReduceTensorDescriptor_t reduceTensorDesc,
5232  const miopenTensorDescriptor_t aDesc,
5233  const miopenTensorDescriptor_t cDesc,
5234  size_t* sizeInBytes);
5235 
5259 MIOPEN_EXPORT miopenStatus_t
5260 miopenReduceTensor(miopenHandle_t handle,
5261  const miopenReduceTensorDescriptor_t reduceTensorDesc,
5262  void* indices,
5263  size_t indicesSizeInBytes,
5264  void* workspace,
5265  size_t workspaceSizeInBytes,
5266  const void* alpha,
5267  const miopenTensorDescriptor_t aDesc,
5268  const void* A,
5269  const void* beta,
5270  const miopenTensorDescriptor_t cDesc,
5271  void* C);
5272 
5274 // CLOSEOUT TensorReduce DOXYGEN GROUP
5275 
5276 // Find 2.0 API
5287 MIOPEN_DECLARE_OBJECT(miopenProblem);
5288 
5292 typedef enum
5293 {
5298 
5302 typedef enum
5303 {
5308 #ifdef MIOPEN_BETA_API
5316 #endif
5318 
5322 typedef enum
5323 {
5327 
5335 MIOPEN_EXPORT miopenStatus_t miopenCreateConvProblem(miopenProblem_t* problem,
5336  miopenConvolutionDescriptor_t operatorDesc,
5337  miopenProblemDirection_t direction);
5338 
5344 MIOPEN_EXPORT miopenStatus_t miopenDestroyProblem(miopenProblem_t problem);
5345 
5353 MIOPEN_EXPORT miopenStatus_t
5354 miopenSetProblemTensorDescriptor(miopenProblem_t problem,
5356  const miopenTensorDescriptor_t descriptor);
5357 
5360 MIOPEN_DECLARE_OBJECT(miopenFindOptions);
5361 
5367 MIOPEN_EXPORT miopenStatus_t miopenCreateFindOptions(miopenFindOptions_t* options);
5368 
5374 MIOPEN_EXPORT miopenStatus_t miopenDestroyFindOptions(miopenFindOptions_t options);
5375 
5382 MIOPEN_EXPORT miopenStatus_t miopenSetFindOptionTuning(miopenFindOptions_t options, int value);
5383 
5390 MIOPEN_EXPORT miopenStatus_t miopenSetFindOptionResultsOrder(miopenFindOptions_t options,
5391  miopenFindResultsOrder_t value);
5392 
5400 MIOPEN_EXPORT miopenStatus_t miopenSetFindOptionWorkspaceLimit(miopenFindOptions_t options,
5401  size_t value);
5402 
5410 MIOPEN_EXPORT miopenStatus_t miopenSetFindOptionPreallocatedWorkspace(miopenFindOptions_t options,
5411  void* buffer,
5412  size_t size);
5413 
5422 MIOPEN_EXPORT miopenStatus_t miopenSetFindOptionPreallocatedTensor(miopenFindOptions_t options,
5424  void* buffer);
5425 
5428 MIOPEN_DECLARE_OBJECT(miopenSolution);
5429 
5441 MIOPEN_EXPORT miopenStatus_t miopenFindSolutions(miopenHandle_t handle,
5442  miopenProblem_t problem,
5443  miopenFindOptions_t options,
5444  miopenSolution_t* solutions,
5445  size_t* numSolutions,
5446  size_t maxSolutions);
5447 
5451 {
5452  /* @brief Identifier of the tensor argument.
5453  */
5455  /* @brief Tensor descriptor to override the value stored in the solution.
5456  *
5457  * Some solvers may support overriding input and output tensor descriptors, but right now there
5458  * is no way to tell from the API. Intended for the future use.
5459  */
5460  miopenTensorDescriptor_t* descriptor;
5461  /* @brief Pointer to the device memory buffer to use for the operation.
5462  */
5463  void* buffer;
5464 };
5465 
5477 MIOPEN_EXPORT miopenStatus_t miopenRunSolution(miopenHandle_t handle,
5478  miopenSolution_t solution,
5479  size_t nInputs,
5480  const miopenTensorArgument_t* tensors,
5481  void* workspace,
5482  size_t workspaceSize);
5483 
5489 MIOPEN_EXPORT miopenStatus_t miopenDestroySolution(miopenSolution_t solution);
5490 
5498 MIOPEN_EXPORT miopenStatus_t miopenLoadSolution(miopenSolution_t* solution,
5499  const char* data,
5500  size_t size);
5501 
5508 MIOPEN_EXPORT miopenStatus_t miopenSaveSolution(miopenSolution_t solution, char* data);
5509 
5516 MIOPEN_EXPORT miopenStatus_t miopenGetSolutionSize(miopenSolution_t solution, size_t* size);
5517 
5524 MIOPEN_EXPORT miopenStatus_t miopenGetSolutionWorkspaceSize(miopenSolution_t solution,
5525  size_t* workspaceSize);
5526 
5533 MIOPEN_EXPORT miopenStatus_t miopenGetSolutionTime(miopenSolution_t solution, float* time);
5534 
5541 MIOPEN_EXPORT miopenStatus_t miopenGetSolutionSolverId(miopenSolution_t solution,
5542  uint64_t* solverId);
5543 
5550 MIOPEN_EXPORT miopenStatus_t miopenGetSolverIdConvAlgorithm(uint64_t solverId,
5551  miopenConvAlgorithm_t* result);
5552 
5553 #ifdef MIOPEN_BETA_API
5554 
5563 MIOPEN_EXPORT miopenStatus_t
5564 miopenCreateActivationProblem(miopenProblem_t* problem,
5565  miopenActivationDescriptor_t operatorDesc,
5566  miopenProblemDirection_t direction);
5567 
5587 MIOPEN_EXPORT miopenStatus_t miopenFuseProblems(miopenProblem_t problem1, miopenProblem_t problem2);
5588 
5596 MIOPEN_EXPORT miopenStatus_t miopenCreateBiasProblem(miopenProblem_t* problem,
5597  miopenProblemDirection_t direction);
5598 
5599 #endif
5600 
5602 // CLOSEOUT find2 DOXYGEN GROUP
5603 
5604 #ifdef MIOPEN_BETA_API
5605 
5610 typedef enum
5611 {
5615 
5616 // Sum APIs
5631 MIOPEN_EXPORT miopenStatus_t miopenGetSumWorkspaceSize(miopenHandle_t handle,
5632  const miopenTensorDescriptor_t xDesc,
5633  const int32_t dim,
5634  const miopenTensorDescriptor_t yDesc,
5635  size_t* sizeInBytes);
5636 
5650 MIOPEN_EXPORT miopenStatus_t miopenSumForward(miopenHandle_t handle,
5651  miopenSumNanPropagation_t nanPropagation,
5652  void* workspace,
5653  size_t workspaceSizeInBytes,
5654  const miopenTensorDescriptor_t xDesc,
5655  const void* x,
5656  const int32_t dim,
5657  const miopenTensorDescriptor_t yDesc,
5658  void* y);
5659 
5661 // CLOSEOUT SUM DOXYGEN GROUP
5662 #endif
5663 
5664 #ifdef MIOPEN_BETA_API
5665 // Argmax APIs
5681 MIOPEN_EXPORT miopenStatus_t miopenArgmaxForward(miopenHandle_t handle,
5682  const miopenTensorDescriptor_t xDesc,
5683  const void* x,
5684  const int32_t dim,
5685  const miopenTensorDescriptor_t yDesc,
5686  void* y);
5688 #endif
5689 
5690 #ifdef MIOPEN_BETA_API
5691 // GroupNorm APIs
5716 MIOPEN_EXPORT miopenStatus_t miopenGroupNormForward(miopenHandle_t handle,
5717  miopenNormMode_t mode,
5718  const miopenTensorDescriptor_t xDesc,
5719  const void* x,
5720  const miopenTensorDescriptor_t weightDesc,
5721  const void* weight,
5722  const miopenTensorDescriptor_t biasDesc,
5723  const void* bias,
5724  const uint64_t num_groups,
5725  const float epsilon,
5726  const miopenTensorDescriptor_t yDesc,
5727  void* y,
5728  const miopenTensorDescriptor_t meanDesc,
5729  void* mean,
5730  const miopenTensorDescriptor_t rstdDesc,
5731  void* rstd);
5732 
5734 // CLOSEOUT groupnorm DOXYGEN GROUP
5735 #endif
5736 
5737 #ifdef __cplusplus
5738 }
5739 #endif
5740 
5741 #ifdef __clang__
5742 #pragma clang diagnostic pop
5743 #endif
5744 
5745 #endif // MIOPEN_GUARD_MIOPEN_H_
miopenStatus_t miopenCreateOpActivationBackward(miopenFusionPlanDescriptor_t fusePlanDesc, miopenFusionOpDescriptor_t *activBwdOp, miopenActivationMode_t mode)
Creates a backward activation operator.
miopenStatus_t miopenCreateOpBatchNormForward(miopenFusionPlanDescriptor_t fusePlanDesc, miopenFusionOpDescriptor_t *bnFwdOp, const miopenBatchNormMode_t bn_mode, bool runningMeanVariance)
Creates a forward training batch normalization operator.
miopenStatus_t miopenFusionPlanConvolutionGetAlgo(miopenFusionPlanDescriptor_t fusePlanDesc, const int requestAlgoCount, int *returnedAlgoCount, miopenConvFwdAlgorithm_t *returnedAlgos)
Returns the supported algorithms for the convolution operator in the Fusion Plan.
miopenStatus_t miopenFusionPlanGetWorkSpaceSize(miopenHandle_t handle, miopenFusionPlanDescriptor_t fusePlanDesc, size_t *workSpaceSize, miopenConvFwdAlgorithm_t algo)
Query the workspace size required for the fusion plan.
miopenStatus_t miopenFusionPlanConvolutionSetAlgo(miopenFusionPlanDescriptor_t fusePlanDesc, miopenConvFwdAlgorithm_t algo)
Requests the fusion runtime to choose a particular algorithm for the added convolution operation.
miopenStatus_t miopenCreateOpBatchNormInference(miopenFusionPlanDescriptor_t fusePlanDesc, miopenFusionOpDescriptor_t *bnOp, const miopenBatchNormMode_t bn_mode, const miopenTensorDescriptor_t bnScaleBiasMeanVarDesc)
Creates a forward inference batch normalization operator.
miopenStatus_t miopenSetOpArgsBiasForward(miopenOperatorArgs_t args, const miopenFusionOpDescriptor_t biasOp, const void *alpha, const void *beta, const void *bias)
Sets the arguments for forward bias op.
miopenStatus_t miopenCreateOpConvForward(miopenFusionPlanDescriptor_t fusePlanDesc, miopenFusionOpDescriptor_t *convOp, miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t wDesc)
Creates forward convolution operator.
miopenStatus_t miopenSetOpArgsBatchNormInference(miopenOperatorArgs_t args, const miopenFusionOpDescriptor_t bnOp, const void *alpha, const void *beta, const void *bnScale, const void *bnBias, const void *estimatedMean, const void *estimatedVariance, double epsilon)
Sets the arguments for inference batch normalization op.
miopenStatus_t miopenSetOpArgsBatchNormForward(miopenOperatorArgs_t args, const miopenFusionOpDescriptor_t bnOp, const void *alpha, const void *beta, const void *bnScale, const void *bnBias, void *savedMean, void *savedInvVariance, void *runningMean, void *runningVariance, double expAvgFactor, double epsilon)
Sets the arguments for forward batch normalization op.
miopenStatus_t miopenExecuteFusionPlan(const miopenHandle_t handle, const miopenFusionPlanDescriptor_t fusePlanDesc, const miopenTensorDescriptor_t inputDesc, const void *input, const miopenTensorDescriptor_t outputDesc, void *output, miopenOperatorArgs_t args)
Executes the fusion plan.
miopenStatus_t miopenFusionPlanGetOp(miopenFusionPlanDescriptor_t fusePlanDesc, const int op_idx, miopenFusionOpDescriptor_t *op)
Allows access to the operators in a fusion plan.
miopenStatus_t miopenDestroyFusionPlan(miopenFusionPlanDescriptor_t fusePlanDesc)
Destroy the fusion plan descriptor object.
miopenStatus_t miopenCreateOpActivationForward(miopenFusionPlanDescriptor_t fusePlanDesc, miopenFusionOpDescriptor_t *activFwdOp, miopenActivationMode_t mode)
Creates a forward activation operator.
miopenFusionDirection_t
Kernel fusion direction in the network.
Definition: miopen.h:3008
miopenStatus_t miopenSetOpArgsActivBackward(miopenOperatorArgs_t args, const miopenFusionOpDescriptor_t activBwdOp, const void *alpha, const void *beta, const void *y, const void *reserved, double activAlpha, double activBeta, double activGamma)
Sets the arguments for backward activation op.
miopenStatus_t miopenCompileFusionPlan(miopenHandle_t handle, miopenFusionPlanDescriptor_t fusePlanDesc)
Compiles the fusion plan.
miopenStatus_t miopenSetOpArgsBatchNormBackward(miopenOperatorArgs_t args, const miopenFusionOpDescriptor_t bnOp, const void *alpha, const void *beta, const void *x, const void *bnScale, const void *bnBias, void *resultBnScaleDiff, void *resultBnBiasDiff, const void *savedMean, const void *savedInvVariance)
Sets the arguments for backward batch normalization op.
miopenStatus_t miopenSetOpArgsActivForward(miopenOperatorArgs_t args, const miopenFusionOpDescriptor_t activFwdOp, const void *alpha, const void *beta, double activAlpha, double activBeta, double activGamma)
Sets the arguments for forward activation op.
miopenStatus_t miopenDestroyOperatorArgs(miopenOperatorArgs_t args)
Destroys an operator argument object.
miopenStatus_t miopenCreateOpBatchNormBackward(miopenFusionPlanDescriptor_t fusePlanDesc, miopenFusionOpDescriptor_t *bnBwdOp, const miopenBatchNormMode_t bn_mode)
Creates a back propagation batch normalization operator.
miopenStatus_t miopenCreateOperatorArgs(miopenOperatorArgs_t *args)
Creates an operator argument object.
miopenStatus_t miopenSetOpArgsConvForward(miopenOperatorArgs_t args, const miopenFusionOpDescriptor_t convOp, const void *alpha, const void *beta, const void *w)
Sets the arguments for forward convolution op.
miopenStatus_t miopenConvolutionBiasActivationForward(miopenHandle_t handle, const void *alpha1, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t wDesc, const void *w, const miopenConvolutionDescriptor_t convDesc, miopenConvFwdAlgorithm_t algo, void *workspace, size_t workspaceSizeInBytes, const void *alpha2, const miopenTensorDescriptor_t zDesc, const void *z, const miopenTensorDescriptor_t biasDesc, const void *bias, const miopenActivationDescriptor_t activationDesc, const miopenTensorDescriptor_t yDesc, void *y)
Prepares and executes the Convlution+Bias+Activation Fusion.
miopenStatus_t miopenCreateFusionPlan(miopenFusionPlanDescriptor_t *fusePlanDesc, const miopenFusionDirection_t fuseDirection, const miopenTensorDescriptor_t inputDesc)
Creates the kenrel fusion plan descriptor object.
miopenStatus_t miopenCreateOpBiasForward(miopenFusionPlanDescriptor_t fusePlanDesc, miopenFusionOpDescriptor_t *biasOp, const miopenTensorDescriptor_t bDesc)
Creates a forward bias operator.
@ miopenHorizontalFusion
Definition: miopen.h:3010
@ miopenVerticalFusion
Definition: miopen.h:3009
miopenStatus_t miopenSetLRNDescriptor(const miopenLRNDescriptor_t lrnDesc, miopenLRNMode_t mode, unsigned int lrnN, double lrnAlpha, double lrnBeta, double lrnK)
Sets a LRN layer descriptor details.
miopenStatus_t miopenCreateLRNDescriptor(miopenLRNDescriptor_t *lrnDesc)
Creates a local response normalization (LRN) layer descriptor.
miopenStatus_t miopenGetLRNDescriptor(const miopenLRNDescriptor_t lrnDesc, miopenLRNMode_t *mode, unsigned int *lrnN, double *lrnAlpha, double *lrnBeta, double *lrnK)
Gets a LRN layer descriptor details.
miopenStatus_t miopenLRNBackward(miopenHandle_t handle, const miopenLRNDescriptor_t lrnDesc, const void *alpha, const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx, const void *workSpace)
Execute a LRN backward layer.
miopenStatus_t miopenLRNGetWorkSpaceSize(const miopenTensorDescriptor_t yDesc, size_t *workSpaceSize)
Determine the workspace requirements.
miopenLRNMode_t
Definition: miopen.h:465
miopenStatus_t miopenLRNForward(miopenHandle_t handle, const miopenLRNDescriptor_t lrnDesc, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y, bool do_backward, void *workSpace)
Execute a LRN forward layer.
miopenStatus_t miopenDestroyLRNDescriptor(miopenLRNDescriptor_t lrnDesc)
Destroys the LRN descriptor object.
miopenStatus_t miopenGetCTCLossWorkspaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t probsDesc, const miopenTensorDescriptor_t gradientsDesc, const int *labels, const int *labelLengths, const int *inputLengths, miopenCTCLossAlgo_t algo, const miopenCTCLossDescriptor_t ctcLossDesc, size_t *workSpaceSize)
Query the amount of memory required to execute miopenCTCLoss.
miopenCTCLossAlgo_t
Definition: miopen.h:4836
miopenStatus_t miopenSetCTCLossDescriptor(miopenCTCLossDescriptor_t ctcLossDesc, miopenDataType_t dataType, const int blank_label_id, bool apply_softmax_layer)
Set the details of a CTC loss function descriptor.
miopenStatus_t miopenCTCLoss(miopenHandle_t handle, const miopenTensorDescriptor_t probsDesc, const void *probs, const int *labels, const int *labelLengths, const int *inputLengths, void *losses, const miopenTensorDescriptor_t gradientsDesc, void *gradients, miopenCTCLossAlgo_t algo, const miopenCTCLossDescriptor_t ctcLossDesc, void *workSpace, size_t workSpaceSize)
Execute forward inference for CTCLoss layer.
miopenStatus_t miopenGetCTCLossDescriptor(miopenCTCLossDescriptor_t ctcLossDesc, miopenDataType_t *dataType, int *blank_label_id, bool *apply_softmax_layer)
Retrieves a CTC loss function descriptor's details.
miopenStatus_t miopenCreateCTCLossDescriptor(miopenCTCLossDescriptor_t *ctcLossDesc)
Create a CTC loss function Descriptor.
miopenStatus_t miopenDestroyCTCLossDescriptor(miopenCTCLossDescriptor_t ctcLossDesc)
Destroys a CTC loss function descriptor object.
@ MIOPEN_CTC_LOSS_ALGO_DETERMINISTIC
Definition: miopen.h:4837
miopenRNNMode_t
Definition: miopen.h:3443
miopenStatus_t miopenGetRNNDescriptor_V2(miopenRNNDescriptor_t rnnDesc, int *hiddenSize, int *layer, miopenDropoutDescriptor_t *dropoutDesc, miopenRNNInputMode_t *inputMode, miopenRNNDirectionMode_t *dirMode, miopenRNNMode_t *rnnMode, miopenRNNBiasMode_t *biasMode, miopenRNNAlgo_t *algoMode, miopenDataType_t *dataType)
Retrieves a RNN layer descriptor's details version 2. This version enables retrieving information of ...
miopenRNNInputMode_t
Definition: miopen.h:3454
miopenStatus_t miopenSetRNNLayerBias(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int layer, miopenTensorDescriptor_t xDesc, miopenTensorDescriptor_t wDesc, void *w, const int biasID, miopenTensorDescriptor_t biasDesc, const void *layerBias)
Sets a bias for a specific layer in an RNN stack.
miopenStatus_t miopenRNNBackwardWeightsSeqTensor(miopenHandle_t handle, const miopenRNNDescriptor_t rnnDesc, const miopenSeqTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t hDesc, const void *hx, const miopenSeqTensorDescriptor_t yDesc, const void *y, void *dw, size_t weightSpaceSize, void *workSpace, size_t workSpaceNumBytes, const void *reserveSpace, size_t reserveSpaceNumBytes)
Execute backward weights for recurrent layer.
miopenStatus_t miopenGetRNNParamsSize(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, miopenTensorDescriptor_t xDesc, size_t *numBytes, miopenDataType_t dtype)
Query the amount of parameter memory required for RNN training.
miopenStatus_t miopenGetRNNLayerBiasOffset(miopenRNNDescriptor_t rnnDesc, const int layer, miopenTensorDescriptor_t xDesc, const int biasID, miopenTensorDescriptor_t biasDesc, size_t *layerBiasOffset)
Gets a bias index offset for a specific layer in an RNN stack.
miopenStatus_t miopenGetRNNLayerParamOffset(miopenRNNDescriptor_t rnnDesc, const int layer, miopenTensorDescriptor_t xDesc, const int paramID, miopenTensorDescriptor_t paramDesc, size_t *layerParamOffset)
Gets an index offset for a specific weight matrix for a layer in the RNN stack.
miopenRNNDirectionMode_t
Definition: miopen.h:3474
miopenStatus_t miopenRNNBackwardSeqData(miopenHandle_t handle, const miopenRNNDescriptor_t rnnDesc, const miopenSeqTensorDescriptor_t yDesc, const void *y, const void *dy, const miopenTensorDescriptor_t hDesc, const void *hx, const void *dhy, void *dhx, const miopenTensorDescriptor_t cDesc, const void *cx, const void *dcy, void *dcx, const miopenSeqTensorDescriptor_t xDesc, void *dx, const void *w, size_t weightSpaceSize, void *workSpace, size_t workSpaceNumBytes, void *reserveSpace, size_t reserveSpaceNumBytes)
Execute backward data for recurrent layer.
miopenRNNBiasMode_t
Definition: miopen.h:3483
miopenStatus_t miopenGetRNNLayerBias(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int layer, miopenTensorDescriptor_t xDesc, miopenTensorDescriptor_t wDesc, const void *w, const int biasID, miopenTensorDescriptor_t biasDesc, void *layerBias)
Gets a bias for a specific layer in an RNN stack.
miopenStatus_t miopenRNNBackwardWeights(miopenHandle_t handle, const miopenRNNDescriptor_t rnnDesc, const int sequenceLen, const miopenTensorDescriptor_t *xDesc, const void *x, const miopenTensorDescriptor_t hxDesc, const void *hx, const miopenTensorDescriptor_t *yDesc, const void *y, const miopenTensorDescriptor_t dwDesc, void *dw, void *workSpace, size_t workSpaceNumBytes, const void *reserveSpace, size_t reserveSpaceNumBytes)
Execute backward weights for recurrent layer.
miopenStatus_t miopenGetRNNTrainingReserveSize(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int sequenceLen, const miopenTensorDescriptor_t *xDesc, size_t *numBytes)
Query the amount of memory required for RNN training.
miopenStatus_t miopenGetRNNLayerBiasSize(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int layer, const int biasID, size_t *numBytes)
Gets the number of bytes of a bias.
miopenStatus_t miopenSetRNNDescriptor(miopenRNNDescriptor_t rnnDesc, const int hsize, const int nlayers, miopenRNNInputMode_t inMode, miopenRNNDirectionMode_t direction, miopenRNNMode_t rnnMode, miopenRNNBiasMode_t biasMode, miopenRNNAlgo_t algo, miopenDataType_t dataType)
Set the details of the RNN descriptor.
miopenRNNBaseLayout_t
Definition: miopen.h:3518
miopenStatus_t miopenRNNBackwardData(miopenHandle_t handle, const miopenRNNDescriptor_t rnnDesc, const int sequenceLen, const miopenTensorDescriptor_t *yDesc, const void *y, const miopenTensorDescriptor_t *dyDesc, const void *dy, const miopenTensorDescriptor_t dhyDesc, const void *dhy, const miopenTensorDescriptor_t dcyDesc, const void *dcy, const miopenTensorDescriptor_t wDesc, const void *w, const miopenTensorDescriptor_t hxDesc, const void *hx, const miopenTensorDescriptor_t cxDesc, const void *cx, const miopenTensorDescriptor_t *dxDesc, void *dx, const miopenTensorDescriptor_t dhxDesc, void *dhx, const miopenTensorDescriptor_t dcxDesc, void *dcx, void *workSpace, size_t workSpaceNumBytes, void *reserveSpace, size_t reserveSpaceNumBytes)
Execute backward data for recurrent layer.
miopenStatus_t miopenGetRNNDescriptor(miopenRNNDescriptor_t rnnDesc, miopenRNNMode_t *rnnMode, miopenRNNAlgo_t *algoMode, miopenRNNInputMode_t *inputMode, miopenRNNDirectionMode_t *dirMode, miopenRNNBiasMode_t *biasMode, int *hiddenSize, int *layer)
Retrieves a RNN layer descriptor's details.
miopenRNNAlgo_t
Definition: miopen.h:3463
miopenStatus_t miopenGetRNNTempSpaceSizes(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, miopenSeqTensorDescriptor_t xDesc, miopenRNNFWDMode_t fwdMode, size_t *workSpaceSize, size_t *reserveSpaceSize)
Query the amount of additional memory required for this RNN layer execution.
miopenStatus_t miopenGetRNNPaddingMode(miopenRNNDescriptor_t rnnDesc, miopenRNNPaddingMode_t *paddingMode)
This function retrieves the RNN padding mode from the RNN descriptor.
miopenStatus_t miopenRNNForward(miopenHandle_t handle, const miopenRNNDescriptor_t rnnDesc, miopenRNNFWDMode_t fwdMode, const miopenSeqTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t hDesc, const void *hx, void *hy, const miopenTensorDescriptor_t cDesc, const void *cx, void *cy, const miopenSeqTensorDescriptor_t yDesc, void *y, const void *w, size_t weightSpaceSize, void *workSpace, size_t workSpaceNumBytes, void *reserveSpace, size_t reserveSpaceNumBytes)
Execute forward training for recurrent layer.
miopenStatus_t miopenGetRNNDataSeqTensorDescriptor(miopenSeqTensorDescriptor_t seqTensorDesc, miopenDataType_t *dataType, miopenRNNBaseLayout_t *layout, int *maxSequenceLen, int *batchSize, int *vectorSize, int sequenceLenArrayLimit, int *sequenceLenArray, void *paddingMarker)
Get shape of RNN seqData tensor.
miopenStatus_t miopenGetRNNInputTensorSize(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int seqLen, miopenTensorDescriptor_t *xDesc, size_t *numBytes)
Obtain a the size in bytes of the RNN input tensor.
miopenRNNFWDMode_t
Definition: miopen.h:3509
miopenStatus_t miopenSetRNNLayerParam(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int layer, miopenTensorDescriptor_t xDesc, miopenTensorDescriptor_t wDesc, void *w, const int paramID, miopenTensorDescriptor_t paramDesc, const void *layerParam)
Sets a weight matrix for a specific layer in an RNN stack.
miopenStatus_t miopenGetRNNLayerParamSize(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int layer, miopenTensorDescriptor_t xDesc, const int paramID, size_t *numBytes)
Gets the number of bytes of a parameter matrix.
miopenStatus_t miopenCreateRNNDescriptor(miopenRNNDescriptor_t *rnnDesc)
Create a RNN layer Descriptor.
miopenRNNGEMMalgoMode_t
Definition: miopen.h:3492
miopenStatus_t miopenGetRNNLayerParam(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int layer, miopenTensorDescriptor_t xDesc, miopenTensorDescriptor_t wDesc, const void *w, const int paramID, miopenTensorDescriptor_t paramDesc, void *layerParam)
Gets a weight matrix for a specific layer in an RNN stack.
miopenStatus_t miopenGetRNNWorkspaceSize(miopenHandle_t handle, const miopenRNNDescriptor_t rnnDesc, const int sequenceLen, const miopenTensorDescriptor_t *xDesc, size_t *numBytes)
Query the amount of memory required to execute the RNN layer.
miopenStatus_t miopenSetRNNDataSeqTensorDescriptor(miopenSeqTensorDescriptor_t seqTensorDesc, miopenDataType_t dataType, miopenRNNBaseLayout_t layout, int maxSequenceLen, int batchSize, int vectorSize, const int *sequenceLenArray, void *paddingMarker)
Set shape of RNN seqData tensor.
miopenStatus_t miopenGetRNNParamsDescriptor(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, miopenTensorDescriptor_t xDesc, miopenTensorDescriptor_t wDesc, miopenDataType_t dtype)
Obtain a weight tensor descriptor for RNNs.
miopenStatus_t miopenRNNForwardTraining(miopenHandle_t handle, const miopenRNNDescriptor_t rnnDesc, const int sequenceLen, const miopenTensorDescriptor_t *xDesc, const void *x, const miopenTensorDescriptor_t hxDesc, const void *hx, const miopenTensorDescriptor_t cxDesc, const void *cx, const miopenTensorDescriptor_t wDesc, const void *w, const miopenTensorDescriptor_t *yDesc, void *y, const miopenTensorDescriptor_t hyDesc, void *hy, const miopenTensorDescriptor_t cyDesc, void *cy, void *workSpace, size_t workSpaceNumBytes, void *reserveSpace, size_t reserveSpaceNumBytes)
Execute forward training for recurrent layer.
miopenRNNPaddingMode_t
Definition: miopen.h:3500
miopenStatus_t miopenSetRNNDescriptor_V2(miopenRNNDescriptor_t rnnDesc, const int hsize, const int nlayers, miopenDropoutDescriptor_t dropoutDesc, miopenRNNInputMode_t inMode, miopenRNNDirectionMode_t direction, miopenRNNMode_t rnnMode, miopenRNNBiasMode_t biasMode, miopenRNNAlgo_t algo, miopenDataType_t dataType)
Set the details of the RNN descriptor version 2. This version enables the use of dropout in rnn.
miopenStatus_t miopenDestroyRNNDescriptor(miopenRNNDescriptor_t rnnDesc)
Destroys the tensor descriptor object.
miopenStatus_t miopenGetRNNHiddenTensorSize(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int seqLen, miopenTensorDescriptor_t *xDesc, size_t *numBytes)
Obtain a the size in bytes of the RNN hidden tensor.
miopenStatus_t miopenSetRNNPaddingMode(miopenRNNDescriptor_t rnnDesc, miopenRNNPaddingMode_t paddingMode)
Sets a bias for a specific layer in an RNN stack.
miopenStatus_t miopenRNNForwardInference(miopenHandle_t handle, miopenRNNDescriptor_t rnnDesc, const int sequenceLen, const miopenTensorDescriptor_t *xDesc, const void *x, const miopenTensorDescriptor_t hxDesc, const void *hx, const miopenTensorDescriptor_t cxDesc, const void *cx, const miopenTensorDescriptor_t wDesc, const void *w, const miopenTensorDescriptor_t *yDesc, void *y, const miopenTensorDescriptor_t hyDesc, void *hy, const miopenTensorDescriptor_t cyDesc, void *cy, void *workSpace, size_t workSpaceNumBytes)
Execute forward inference for RNN layer.
@ miopenRNNTANH
Definition: miopen.h:3445
@ miopenLSTM
Definition: miopen.h:3446
@ miopenGRU
Definition: miopen.h:3447
@ miopenRNNRELU
Definition: miopen.h:3444
@ miopenRNNlinear
Definition: miopen.h:3455
@ miopenRNNskip
Definition: miopen.h:3456
@ miopenRNNbidirection
Definition: miopen.h:3476
@ miopenRNNunidirection
Definition: miopen.h:3475
@ miopenRNNwithBias
Definition: miopen.h:3485
@ miopenRNNNoBias
Definition: miopen.h:3484
@ miopenRNNDataSeqMajorPadded
Definition: miopen.h:3521
@ miopenRNNDataSeqMajorNotPadded
Definition: miopen.h:3520
@ miopenRNNDataBatchMajorPadded
Definition: miopen.h:3522
@ miopenRNNDataUnknownLayout
Definition: miopen.h:3519
@ miopenRNNfundamental
Definition: miopen.h:3466
@ miopenRNNdefault
Definition: miopen.h:3464
@ miopenRNNTraining
Definition: miopen.h:3510
@ miopenRNNInference
Definition: miopen.h:3511
@ miopenRNNAlgoGEMM
Definition: miopen.h:3493
@ miopenRNNIOWithPadding
Definition: miopen.h:3502
@ miopenRNNIONotPadded
Definition: miopen.h:3501
miopenReduceTensorIndices_t
Definition: miopen.h:584
miopenStatus_t miopenSetReduceTensorDescriptor(miopenReduceTensorDescriptor_t reduceTensorDesc, miopenReduceTensorOp_t reduceTensorOp, miopenDataType_t reduceTensorCompType, miopenNanPropagation_t reduceTensorNanOpt, miopenReduceTensorIndices_t reduceTensorIndices, miopenIndicesType_t reduceTensorIndicesType)
Initialize a ReduceTensor descriptor object.
miopenStatus_t miopenCreateReduceTensorDescriptor(miopenReduceTensorDescriptor_t *reduceTensorDesc)
Creates the ReduceTensor descriptor object.
miopenReduceTensorOp_t
Definition: miopen.h:549
miopenIndicesType_t
Definition: miopen.h:594
miopenStatus_t miopenReduceTensor(miopenHandle_t handle, const miopenReduceTensorDescriptor_t reduceTensorDesc, void *indices, size_t indicesSizeInBytes, void *workspace, size_t workspaceSizeInBytes, const void *alpha, const miopenTensorDescriptor_t aDesc, const void *A, const void *beta, const miopenTensorDescriptor_t cDesc, void *C)
TensorReduce function doing reduction on tensor A by implementing C = alpha * reduceOp(A)
miopenStatus_t miopenGetReductionIndicesSize(miopenHandle_t handle, const miopenReduceTensorDescriptor_t reduceTensorDesc, const miopenTensorDescriptor_t aDesc, const miopenTensorDescriptor_t cDesc, size_t *sizeInBytes)
Helper function to query the minimum index space size required by the ReduceTensor call.
miopenStatus_t miopenDestroyReduceTensorDescriptor(miopenReduceTensorDescriptor_t reduceTensorDesc)
Destroy the ReduceTensor descriptor object.
miopenStatus_t miopenGetReductionWorkspaceSize(miopenHandle_t handle, const miopenReduceTensorDescriptor_t reduceTensorDesc, const miopenTensorDescriptor_t aDesc, const miopenTensorDescriptor_t cDesc, size_t *sizeInBytes)
Helper function to query the minimum workspace size required by the ReduceTensor call.
miopenStatus_t miopenGetReduceTensorDescriptor(const miopenReduceTensorDescriptor_t reduceTensorDesc, miopenReduceTensorOp_t *reduceTensorOp, miopenDataType_t *reduceTensorCompType, miopenNanPropagation_t *reduceTensorNanOpt, miopenReduceTensorIndices_t *reduceTensorIndices, miopenIndicesType_t *reduceTensorIndicesType)
Query a ReduceTensor descriptor object.
miopenStatus_t miopenActivationForward(miopenHandle_t handle, const miopenActivationDescriptor_t activDesc, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y)
Execute an activation forward layer.
miopenStatus_t miopenActivationBackward(miopenHandle_t handle, const miopenActivationDescriptor_t activDesc, const void *alpha, const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx)
Execute a activation backwards layer.
miopenActivationMode_t
Definition: miopen.h:496
miopenStatus_t miopenSetActivationDescriptor(const miopenActivationDescriptor_t activDesc, miopenActivationMode_t mode, double activAlpha, double activBeta, double activGamma)
Sets the activation layer descriptor details.
miopenStatus_t miopenCreateActivationDescriptor(miopenActivationDescriptor_t *activDesc)
Creates the Activation descriptor object.
miopenStatus_t miopenGetActivationDescriptor(const miopenActivationDescriptor_t activDesc, miopenActivationMode_t *mode, double *activAlpha, double *activBeta, double *activGamma)
Gets the activation layer descriptor details.
miopenStatus_t miopenDestroyActivationDescriptor(miopenActivationDescriptor_t activDesc)
Destroys the activation descriptor object.
miopenStatus_t miopenArgmaxForward(miopenHandle_t handle, const miopenTensorDescriptor_t xDesc, const void *x, const int32_t dim, const miopenTensorDescriptor_t yDesc, void *y)
Find the index of the maximum value of a tensor across dimensions. To enable this,...
miopenStatus_t miopenBatchNormalizationForwardInference(miopenHandle_t handle, miopenBatchNormMode_t bn_mode, void *alpha, void *beta, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t yDesc, void *y, const miopenTensorDescriptor_t bnScaleBiasMeanVarDesc, void *bnScale, void *bnBias, void *estimatedMean, void *estimatedVariance, double epsilon)
Execute forward inference layer for batch normalization.
miopenStatus_t miopenBatchNormalizationForwardTraining(miopenHandle_t handle, miopenBatchNormMode_t bn_mode, void *alpha, void *beta, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t yDesc, void *y, const miopenTensorDescriptor_t bnScaleBiasMeanVarDesc, void *bnScale, void *bnBias, double expAvgFactor, void *resultRunningMean, void *resultRunningVariance, double epsilon, void *resultSaveMean, void *resultSaveInvVariance)
Execute forward training layer for batch normalization.
miopenStatus_t miopenBatchNormalizationBackward(miopenHandle_t handle, miopenBatchNormMode_t bn_mode, const void *alphaDataDiff, const void *betaDataDiff, const void *alphaParamDiff, const void *betaParamDiff, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t dxDesc, void *dx, const miopenTensorDescriptor_t bnScaleBiasDiffDesc, const void *bnScale, void *resultBnScaleDiff, void *resultBnBiasDiff, double epsilon, const void *savedMean, const void *savedInvVariance)
Execute backwards propagation layer for batch normalization.
miopenBatchNormMode_t
Definition: miopen.h:486
miopenStatus_t miopenDeriveBNTensorDescriptor(miopenTensorDescriptor_t derivedBnDesc, const miopenTensorDescriptor_t xDesc, miopenBatchNormMode_t bn_mode)
Derive tensor for gamma and beta from input tensor descriptor.
miopenStatus_t miopenCatForward(miopenHandle_t handle, const int32_t xCount, const miopenTensorDescriptor_t *xDescs, const void *const *xs, const miopenTensorDescriptor_t yDesc, void *y, const int32_t dim)
Execute a cat forward layer.
miopenStatus_t miopenInitConvolutionNdDescriptor(miopenConvolutionDescriptor_t convDesc, int spatialDim, const int *padA, const int *strideA, const int *dilationA, miopenConvolutionMode_t c_mode)
Creates a N-dimensional convolution layer descriptor.
miopenStatus_t miopenConvolutionForwardImmediate(miopenHandle_t handle, const miopenTensorDescriptor_t wDesc, const void *w, const miopenTensorDescriptor_t xDesc, const void *x, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t yDesc, void *y, void *workSpace, size_t workSpaceSize, const uint64_t solution_id)
Executes the Forward convolution operation based on the provided solution ID.
miopenStatus_t miopenConvolutionBackwardDataCompileSolution(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t wDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, const uint64_t solution_id)
Compiles the solution provided by the user, this solution may be acquired by the miopenConvolutionBac...
miopenStatus_t miopenConvolutionForwardGetSolutionWorkspaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t wDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t yDesc, const uint64_t solution_id, size_t *workSpaceSize)
Returns the workspace size required for a particular solution id.
miopenStatus_t miopenConvolutionForward(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t wDesc, const void *w, const miopenConvolutionDescriptor_t convDesc, miopenConvFwdAlgorithm_t algo, const void *beta, const miopenTensorDescriptor_t yDesc, void *y, void *workSpace, size_t workSpaceSize)
Execute a forward convolution layer.
miopenStatus_t miopenGetConvolutionGroupCount(miopenConvolutionDescriptor_t convDesc, int *groupCount)
Get the number of groups to be used in Group/Depthwise convolution.
miopenStatus_t miopenInitConvolutionDescriptor(miopenConvolutionDescriptor_t convDesc, miopenConvolutionMode_t c_mode, int pad_h, int pad_w, int stride_h, int stride_w, int dilation_h, int dilation_w)
Creates a 2-D convolution layer descriptor.
miopenConvAlgorithm_t
Definition: miopen.h:1181
miopenStatus_t miopenConvolutionBackwardData(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t wDesc, const void *w, const miopenConvolutionDescriptor_t convDesc, miopenConvBwdDataAlgorithm_t algo, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx, void *workSpace, size_t workSpaceSize)
Execute a backward data convolution layer.
miopenStatus_t miopenGetConvolutionAttribute(miopenConvolutionDescriptor_t convDesc, const miopenConvolutionAttrib_t attr, int *value)
Get the attribute of the convolution descriptor.
miopenStatus_t miopenGetConvolutionNdForwardOutputDim(miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t inputTensorDesc, const miopenTensorDescriptor_t filterDesc, int *nDim, int *outputTensorDimA)
Get the shape of a resulting N-dimensional tensor from a (N-2)-dimensional convolution.
miopenStatus_t miopenConvolutionBackwardWeightsCompileSolution(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, const uint64_t solution_id)
Compiles the solution provided by the user, this solution may be acquired by the miopenConvolutionBac...
miopenStatus_t miopenFindConvolutionBackwardWeightsAlgorithm(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, void *dw, const int requestAlgoCount, int *returnedAlgoCount, miopenConvAlgoPerf_t *perfResults, void *workSpace, size_t workSpaceSize, bool exhaustiveSearch)
Search and run the backwards weights convolutional algorithms and return a list of kernel times.
miopenStatus_t miopenGetConvolutionForwardOutputDim(miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t inputTensorDesc, const miopenTensorDescriptor_t filterDesc, int *n, int *c, int *h, int *w)
Get the shape of a resulting 4-D tensor from a 2-D convolution.
miopenConvFwdAlgorithm_t
Definition: miopen.h:1144
miopenStatus_t miopenConvolutionForwardGetWorkSpaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t wDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t yDesc, size_t *workSpaceSize)
Query the workspace size required for a forward convolution layer.
miopenStatus_t miopenCreateConvolutionDescriptor(miopenConvolutionDescriptor_t *convDesc)
Creates a convolution layer descriptor.
miopenStatus_t miopenConvolutionBackwardWeightsGetSolution(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, const size_t maxSolutionCount, size_t *solutionCount, miopenConvSolution_t *solutions)
Query the applicable solutions for a backward convolution w-r-t weights as described by input,...
miopenStatus_t miopenGetConvolutionNdDescriptor(miopenConvolutionDescriptor_t convDesc, int requestedSpatialDim, int *spatialDim, int *padA, int *strideA, int *dilationA, miopenConvolutionMode_t *c_mode)
Retrieves a N-dimensional convolution layer descriptor's details.
miopenConvBwdDataAlgorithm_t
Definition: miopen.h:1167
miopenConvolutionAttrib_t
Definition: miopen.h:606
miopenStatus_t miopenConvolutionBackwardWeightsGetWorkSpaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, size_t *workSpaceSize)
Get the GPU memory required for the backward weights convolution algorithm.
miopenStatus_t miopenConvolutionBackwardWeightsImmediate(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, void *dw, void *workSpace, size_t workSpaceSize, const uint64_t solution_id)
Executes the Backward convolution w-r-t weights operation based on the provided solution ID.
miopenStatus_t miopenFindConvolutionBackwardDataAlgorithm(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t wDesc, const void *w, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, void *dx, const int requestAlgoCount, int *returnedAlgoCount, miopenConvAlgoPerf_t *perfResults, void *workSpace, size_t workSpaceSize, bool exhaustiveSearch)
Search and run the backwards data convolution algorithms and return a list of kernel times.
miopenStatus_t miopenConvolutionBackwardDataGetSolution(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t wDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, const size_t maxSolutionCount, size_t *solutionCount, miopenConvSolution_t *solutions)
Query the applicable solutions for a backward convolution w-r-t data as described by input,...
miopenStatus_t miopenConvolutionForwardBias(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t bDesc, const void *b, const void *beta, const miopenTensorDescriptor_t yDesc, void *y)
Calculate element-wise scale and shift of a tensor via a bias tensor.
miopenConvolutionMode_t
Definition: miopen.h:419
miopenStatus_t miopenSetConvolutionAttribute(miopenConvolutionDescriptor_t convDesc, const miopenConvolutionAttrib_t attr, int value)
Set the attribute of the convolution descriptor.
miopenStatus_t miopenConvolutionBackwardDataImmediate(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t wDesc, const void *w, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, void *dx, void *workSpace, size_t workSpaceSize, const uint64_t solution_id)
Executes the Backward convolution w-r-t data operation based on the provided solution ID.
miopenStatus_t miopenSetTransposeConvNdOutputPadding(miopenConvolutionDescriptor_t convDesc, int spatialDim, const int *adjA)
Set the output padding to be used in N-dimensional Transpose convolution.
miopenStatus_t miopenSetTransposeConvOutputPadding(miopenConvolutionDescriptor_t convDesc, int adj_h, int adj_w)
Set the output padding to be used in 2-D Transpose convolution.
miopenStatus_t miopenGetConvolutionSpatialDim(miopenConvolutionDescriptor_t convDesc, int *spatialDim)
Retrieves the spatial dimension of a convolution layer descriptor.
miopenConvBwdWeightsAlgorithm_t
Definition: miopen.h:1156
miopenStatus_t miopenConvolutionForwardCompileSolution(miopenHandle_t handle, const miopenTensorDescriptor_t wDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t yDesc, const uint64_t solution_id)
Compiles the solution provided by the user, this solution may be acquired by the miopenConvolutionFor...
miopenStatus_t miopenConvolutionBackwardDataGetSolutionCount(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t wDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, size_t *solutionCount)
Query the maximum number of solutions applicable for the given input/output and weights tensor descri...
miopenStatus_t miopenConvolutionBackwardWeights(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const miopenConvolutionDescriptor_t convDesc, miopenConvBwdWeightsAlgorithm_t algo, const void *beta, const miopenTensorDescriptor_t dwDesc, void *dw, void *workSpace, size_t workSpaceSize)
Execute a backward weights convolution layer.
miopenStatus_t miopenConvolutionBackwardDataGetWorkSpaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t wDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, size_t *workSpaceSize)
Get the GPU memory required for the backward data convolution algorithm.
miopenStatus_t miopenFindConvolutionForwardAlgorithm(miopenHandle_t handle, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t wDesc, const void *w, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t yDesc, void *y, const int requestAlgoCount, int *returnedAlgoCount, miopenConvAlgoPerf_t *perfResults, void *workSpace, size_t workSpaceSize, bool exhaustiveSearch)
Search and run the forward convolutional algorithms and return a list of kernel times.
miopenStatus_t miopenDestroyConvolutionDescriptor(miopenConvolutionDescriptor_t convDesc)
Destroys the tensor descriptor object.
miopenStatus_t miopenConvolutionBackwardWeightsGetSolutionCount(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, size_t *solutionCount)
Query the maximum number of solutions applicable for the given input/output and weights tensor descri...
miopenStatus_t miopenSetConvolutionGroupCount(miopenConvolutionDescriptor_t convDesc, int groupCount)
Set the number of groups to be used in Group/Depthwise convolution.
miopenStatus_t miopenConvolutionBackwardWeightsGetSolutionWorkspaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, const uint64_t solution_id, size_t *workSpaceSize)
Returns the workspace size required for a particular solution id.
miopenStatus_t miopenConvolutionForwardGetSolution(miopenHandle_t handle, const miopenTensorDescriptor_t wDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t yDesc, const size_t maxSolutionCount, size_t *solutionCount, miopenConvSolution_t *solutions)
Query the applicable solutions for a convolution configuration described by input,...
miopenStatus_t miopenGetConvolutionDescriptor(miopenConvolutionDescriptor_t convDesc, miopenConvolutionMode_t *c_mode, int *pad_h, int *pad_w, int *stride_h, int *stride_w, int *dilation_h, int *dilation_w)
Retrieves a 2-D convolution layer descriptor's details.
miopenStatus_t miopenConvolutionForwardGetSolutionCount(miopenHandle_t handle, const miopenTensorDescriptor_t wDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t yDesc, size_t *solutionCount)
Query the maximum number of solutions applicable for the given input/output and weights tensor descri...
miopenStatus_t miopenConvolutionBackwardDataGetSolutionWorkspaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t wDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, const uint64_t solution_id, size_t *workSpaceSize)
Returns the workspace size required for a particular solution id.
miopenStatus_t miopenConvolutionBackwardBias(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t dyDesc, const void *dy, const void *beta, const miopenTensorDescriptor_t dbDesc, void *db)
Calculates the gradient with respect to the bias.
@ miopenConvolutionAlgoDirect
Definition: miopen.h:1183
@ miopenConvolutionAlgoWinograd
Definition: miopen.h:1185
@ miopenConvolutionAlgoFFT
Definition: miopen.h:1184
@ miopenConvolutionAlgoImplicitGEMM
Definition: miopen.h:1186
@ miopenConvolutionAlgoGEMM
Definition: miopen.h:1182
@ miopenConvolutionFwdAlgoFFT
Definition: miopen.h:1147
@ miopenConvolutionFwdAlgoImplicitGEMM
Definition: miopen.h:1149
@ miopenConvolutionFwdAlgoGEMM
Definition: miopen.h:1145
@ miopenConvolutionFwdAlgoWinograd
Definition: miopen.h:1148
@ miopenConvolutionFwdAlgoDirect
Definition: miopen.h:1146
@ miopenTransposeBwdDataAlgoGEMM
Definition: miopen.h:1172
@ miopenConvolutionBwdDataAlgoDirect
Definition: miopen.h:1169
@ miopenConvolutionBwdDataAlgoGEMM
Definition: miopen.h:1168
@ miopenConvolutionBwdDataAlgoFFT
Definition: miopen.h:1170
@ miopenConvolutionBwdDataAlgoWinograd
Definition: miopen.h:1171
@ miopenConvolutionBwdDataAlgoImplicitGEMM
Definition: miopen.h:1174
@ miopenConvolutionBwdWeightsAlgoGEMM
Definition: miopen.h:1157
@ miopenConvolutionBwdWeightsAlgoWinograd
Definition: miopen.h:1159
@ miopenConvolutionBwdWeightsAlgoDirect
Definition: miopen.h:1158
@ miopenConvolutionBwdWeightsAlgoImplicitGEMM
Definition: miopen.h:1160
miopenStatus_t miopenDestroyDropoutDescriptor(miopenDropoutDescriptor_t dropoutDesc)
Destroys the dropout descriptor object.
miopenRNGType_t
Definition: miopen.h:4956
miopenStatus_t miopenDropoutGetStatesSize(miopenHandle_t handle, size_t *stateSizeInBytes)
Query the amount of memory required to store the states of the random number generators.
miopenStatus_t miopenDropoutGetReserveSpaceSize(const miopenTensorDescriptor_t xDesc, size_t *reserveSpaceSizeInBytes)
Query the amount of memory required to run dropout.
miopenStatus_t miopenDropoutForward(miopenHandle_t handle, const miopenDropoutDescriptor_t dropoutDesc, const miopenTensorDescriptor_t noise_shape, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t yDesc, void *y, void *reserveSpace, size_t reserveSpaceSizeInBytes)
Execute forward dropout operation.
miopenStatus_t miopenGetDropoutDescriptor(miopenDropoutDescriptor_t dropoutDesc, miopenHandle_t handle, float *dropout, void **states, unsigned long long *seed, bool *use_mask, bool *state_evo, miopenRNGType_t *rng_mode)
Get the details of the dropout descriptor.
miopenStatus_t miopenCreateDropoutDescriptor(miopenDropoutDescriptor_t *dropoutDesc)
Creates the dropout descriptor object.
miopenStatus_t miopenDropoutBackward(miopenHandle_t handle, const miopenDropoutDescriptor_t dropoutDesc, const miopenTensorDescriptor_t noise_shape, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t dxDesc, void *dx, void *reserveSpace, size_t reserveSpaceSizeInBytes)
Execute backward dropout operation.
miopenStatus_t miopenRestoreDropoutDescriptor(miopenDropoutDescriptor_t dropoutDesc, miopenHandle_t handle, float dropout, void *states, size_t stateSizeInBytes, unsigned long long seed, bool use_mask, bool state_evo, miopenRNGType_t rng_mode)
Restore the dropout descriptor to a saved state.
miopenStatus_t miopenSetDropoutDescriptor(miopenDropoutDescriptor_t dropoutDesc, miopenHandle_t handle, float dropout, void *states, size_t stateSizeInBytes, unsigned long long seed, bool use_mask, bool state_evo, miopenRNGType_t rng_mode)
Initialize the dropout descriptor.
@ MIOPEN_RNG_PSEUDO_XORWOW
Definition: miopen.h:4957
miopenFindResultsOrder_t
Definition: miopen.h:5323
miopenStatus_t miopenGetSolutionSolverId(miopenSolution_t solution, uint64_t *solverId)
Reads id of the solver referred by the solution.
miopenStatus_t miopenGetSolutionTime(miopenSolution_t solution, float *time)
Reads the time spent to execute the solution the last it was run.
miopenStatus_t miopenSetFindOptionWorkspaceLimit(miopenFindOptions_t options, size_t value)
Sets the workspace limit find option. Default value is maximum of size_t.
miopenStatus_t miopenSetFindOptionPreallocatedTensor(miopenFindOptions_t options, miopenTensorArgumentId_t id, void *buffer)
Attaches a preallocated tensor to find options. If not used, buffers are allocated by MIOpen internal...
miopenStatus_t miopenDestroyFindOptions(miopenFindOptions_t options)
Destroys miopenFindOptions object.
miopenStatus_t miopenFuseProblems(miopenProblem_t problem1, miopenProblem_t problem2)
miopenStatus_t miopenGetSolutionSize(miopenSolution_t solution, size_t *size)
Reads the expected size of a solution.
miopenTensorArgumentId_t
Definition: miopen.h:5303
miopenStatus_t miopenFindSolutions(miopenHandle_t handle, miopenProblem_t problem, miopenFindOptions_t options, miopenSolution_t *solutions, size_t *numSolutions, size_t maxSolutions)
Finds solutions to a problem by running different applicable solutions. Memory is automatically alloc...
miopenStatus_t miopenSetFindOptionTuning(miopenFindOptions_t options, int value)
Sets the tuning find option. Default value is zero.
miopenStatus_t miopenGetSolutionWorkspaceSize(miopenSolution_t solution, size_t *workspaceSize)
Reads the amount of workspace required to exectute the solution.
miopenStatus_t miopenSetFindOptionResultsOrder(miopenFindOptions_t options, miopenFindResultsOrder_t value)
Sets the results order find option. Default value is miopenFindResultsOrderByTime.
miopenStatus_t miopenRunSolution(miopenHandle_t handle, miopenSolution_t solution, size_t nInputs, const miopenTensorArgument_t *tensors, void *workspace, size_t workspaceSize)
Runs the solution using the passed in buffers.
miopenProblemDirection_t
Definition: miopen.h:5293
miopenStatus_t miopenDestroySolution(miopenSolution_t solution)
Destroys solution object.
miopenStatus_t miopenLoadSolution(miopenSolution_t *solution, const char *data, size_t size)
Loads solution object from binary data.
miopenStatus_t miopenSaveSolution(miopenSolution_t solution, char *data)
Saves a solution object as binary data.
miopenStatus_t miopenGetSolverIdConvAlgorithm(uint64_t solverId, miopenConvAlgorithm_t *result)
Gets the convolution algorithm implemented by a solver.
miopenStatus_t miopenSetFindOptionPreallocatedWorkspace(miopenFindOptions_t options, void *buffer, size_t size)
Attaches the preallocated workspace to find options. Allocated by the library by default.
miopenStatus_t miopenCreateActivationProblem(miopenProblem_t *problem, miopenActivationDescriptor_t operatorDesc, miopenProblemDirection_t direction)
Initializes a problem object describing an activation operation.
miopenStatus_t miopenDestroyProblem(miopenProblem_t problem)
Destroys a problem object.
miopenStatus_t miopenCreateFindOptions(miopenFindOptions_t *options)
Initializes miopenFindOptions object.
miopenStatus_t miopenCreateConvProblem(miopenProblem_t *problem, miopenConvolutionDescriptor_t operatorDesc, miopenProblemDirection_t direction)
Initializes a problem object describing a convolution operation.
miopenStatus_t miopenCreateBiasProblem(miopenProblem_t *problem, miopenProblemDirection_t direction)
Initializes a problem object describing an bias operation.
miopenStatus_t miopenSetProblemTensorDescriptor(miopenProblem_t problem, miopenTensorArgumentId_t id, const miopenTensorDescriptor_t descriptor)
Sets a tensor descriptor for the specified argument.
@ miopenFindResultsOrderByWorkspaceSize
Definition: miopen.h:5325
@ miopenFindResultsOrderByTime
Definition: miopen.h:5324
@ miopenTensorActivationDY
Definition: miopen.h:5312
@ miopenTensorConvolutionX
Definition: miopen.h:5305
@ miopenTensorActivationDX
Definition: miopen.h:5311
@ miopenTensorActivationX
Definition: miopen.h:5309
@ miopenTensorConvolutionY
Definition: miopen.h:5307
@ miopenTensorArgumentIdInvalid
Definition: miopen.h:5304
@ miopenTensorConvolutionW
Definition: miopen.h:5306
@ miopenTensorBiasY
Definition: miopen.h:5314
@ miopenTensorBias
Definition: miopen.h:5315
@ miopenTensorActivationY
Definition: miopen.h:5310
@ miopenTensorBiasX
Definition: miopen.h:5313
@ miopenProblemDirectionBackwardWeights
Definition: miopen.h:5296
@ miopenProblemDirectionForward
Definition: miopen.h:5294
@ miopenProblemDirectionBackward
Definition: miopen.h:5295
miopenStatus_t miopenGroupNormForward(miopenHandle_t handle, miopenNormMode_t mode, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t weightDesc, const void *weight, const miopenTensorDescriptor_t biasDesc, const void *bias, const uint64_t num_groups, const float epsilon, const miopenTensorDescriptor_t yDesc, void *y, const miopenTensorDescriptor_t meanDesc, void *mean, const miopenTensorDescriptor_t rstdDesc, void *rstd)
Execute a groupnorm forward layer.
miopenStatus_t miopenCreateWithStream(miopenHandle_t *handle, miopenAcceleratorQueue_t stream)
Create a MIOpen handle with an accelerator stream.
miopenStatus_t miopenDestroy(miopenHandle_t handle)
Destroys the MIOpen handle.
void(* miopenDeallocatorFunction)(void *context, void *memory)
Custom deallocator function.
Definition: miopen.h:154
miopenStatus_t miopenGetStream(miopenHandle_t handle, miopenAcceleratorQueue_t *streamID)
Get the previously created accelerator command queue.
miopenStatus_t miopenEnableProfiling(miopenHandle_t handle, bool enable)
Enable profiling to retrieve kernel time.
miopenStatus_t miopenGetVersion(size_t *major, size_t *minor, size_t *patch)
Method to return version of MIOpen.
miopenStatus_t
Definition: miopen.h:105
miopenStatus_t miopenSetAllocator(miopenHandle_t handle, miopenAllocatorFunction allocator, miopenDeallocatorFunction deallocator, void *allocatorContext)
Set allocator for previously created miopenHandle.
miopenF8RoundingMode_t
Definition: miopen.h:121
void *(* miopenAllocatorFunction)(void *context, size_t sizeBytes)
Custom allocator function.
Definition: miopen.h:144
const char * miopenGetErrorString(miopenStatus_t error)
Get character string for an error code.
miopenStatus_t miopenCreate(miopenHandle_t *handle)
Method to create the MIOpen handle object.
miopenStatus_t miopenGetKernelTime(miopenHandle_t handle, float *time)
Get time for last kernel launched.
miopenStatus_t miopenSetStream(miopenHandle_t handle, miopenAcceleratorQueue_t streamID)
Set accelerator command queue previously created.
@ miopenStatusUnsupportedOp
Definition: miopen.h:114
@ miopenStatusGpuOperationsSkipped
Definition: miopen.h:115
@ miopenStatusUnknownError
Definition: miopen.h:113
@ miopenStatusSuccess
Definition: miopen.h:106
@ miopenStatusVersionMismatch
Definition: miopen.h:116
@ miopenStatusAllocFailed
Definition: miopen.h:110
@ miopenStatusNotImplemented
Definition: miopen.h:112
@ miopenStatusBadParm
Definition: miopen.h:109
@ miopenStatusNotInitialized
Definition: miopen.h:107
@ miopenStatusInternalError
Definition: miopen.h:111
@ miopenStatusInvalidValue
Definition: miopen.h:108
@ miopenF8RoundingModeStandard
Definition: miopen.h:122
@ miopenF8RoundingModeStochastic
Definition: miopen.h:123
miopenStatus_t miopenLayerNormForward(miopenHandle_t handle, miopenNormMode_t mode, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t weightDesc, const void *weight, const miopenTensorDescriptor_t biasDesc, const void *bias, const float epsilon, const int32_t normalized_dim, const miopenTensorDescriptor_t yDesc, void *y, const miopenTensorDescriptor_t meanDesc, void *mean, const miopenTensorDescriptor_t rstdDesc, void *rstd)
Execute a layernorm forward layer.
miopenNormMode_t
Definition: miopen.h:475
miopenStatus_t miopenSet2dPoolingDescriptor(miopenPoolingDescriptor_t poolDesc, miopenPoolingMode_t mode, int windowHeight, int windowWidth, int pad_h, int pad_w, int stride_h, int stride_w)
Sets a 2-D pooling layer descriptor details.
miopenStatus_t miopenSetPoolingWorkSpaceIndexMode(miopenPoolingDescriptor_t poolDesc, miopenPoolingWorkspaceIndexMode_t workspace_index)
Set workspace index mode for pooling layer. The default mode is miopenPoolingWorkSpaceIndexMask.
miopenStatus_t miopenGetPoolingForwardOutputDim(const miopenPoolingDescriptor_t poolDesc, const miopenTensorDescriptor_t tensorDesc, int *n, int *c, int *h, int *w)
Gets the shape of the output tensor for 2-D pooling.
miopenStatus_t miopenPoolingGetWorkSpaceSize(const miopenTensorDescriptor_t yDesc, size_t *workSpaceSize)
Get the amount of GPU memory required for pooling.
miopenStatus_t miopenSetNdPoolingDescriptor(miopenPoolingDescriptor_t poolDesc, const miopenPoolingMode_t mode, int nbDims, const int *windowDimA, const int *padA, const int *stridesA)
Set details of a N-D pooling layer descriptor.
miopenStatus_t miopenPoolingForward(miopenHandle_t handle, const miopenPoolingDescriptor_t poolDesc, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y, bool do_backward, void *workSpace, size_t workSpaceSize)
Execute a forward pooling layer.
miopenPoolingMode_t
Definition: miopen.h:442
miopenStatus_t miopenPoolingGetWorkSpaceSizeV2(const miopenPoolingDescriptor_t poolDesc, const miopenTensorDescriptor_t yDesc, size_t *workSpaceSize)
Get the amount of GPU memory required for pooling.
miopenStatus_t miopenGetPoolingWorkSpaceIndexMode(miopenPoolingDescriptor_t poolDesc, miopenPoolingWorkspaceIndexMode_t *workspace_index)
Get workspace index mode for pooling layer.
miopenIndexType_t
Definition: miopen.h:395
miopenStatus_t miopenGetPoolingIndexType(miopenPoolingDescriptor_t poolDesc, miopenIndexType_t *index_type)
Get the index data type for pooling layer. The index type to any of the miopenIndexType_t sizes; 8,...
miopenPoolingWorkspaceIndexMode_t
Definition: miopen.h:455
miopenStatus_t miopenGetPoolingNdForwardOutputDim(const miopenPoolingDescriptor_t poolDesc, const miopenTensorDescriptor_t tensorDesc, int dims, int *tensorDimArr)
Gets the shape of the output tensor for N-D pooling.
miopenStatus_t miopenGetNdPoolingDescriptor(const miopenPoolingDescriptor_t poolDesc, int nbDimsRequested, miopenPoolingMode_t *mode, int *nbDims, int *windowDimA, int *padA, int *stridesA)
Get details of a N-D pooling layer descriptor.
miopenStatus_t miopenCreatePoolingDescriptor(miopenPoolingDescriptor_t *poolDesc)
Creates a pooling layer descriptor.
miopenStatus_t miopenSetPoolingIndexType(miopenPoolingDescriptor_t poolDesc, miopenIndexType_t index_type)
Set index data type for pooling layer. The default indexing type is uint8_t. Users can set the index ...
miopenStatus_t miopenGet2dPoolingDescriptor(const miopenPoolingDescriptor_t poolDesc, miopenPoolingMode_t *mode, int *windowHeight, int *windowWidth, int *pad_h, int *pad_w, int *stride_h, int *stride_w)
Gets a 2-D pooling layer descriptor details.
miopenStatus_t miopenDestroyPoolingDescriptor(miopenPoolingDescriptor_t poolDesc)
Destroys the pooling descriptor object.
miopenStatus_t miopenPoolingBackward(miopenHandle_t handle, const miopenPoolingDescriptor_t poolDesc, const void *alpha, const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx, void *workSpace)
Execute a backward pooling layer.
miopenStatus_t miopenSoftmaxBackward_V2(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx, miopenSoftmaxAlgorithm_t algorithm, miopenSoftmaxMode_t mode)
Execute a softmax backwards layer with expanded modes and algorithms.
miopenStatus_t miopenSoftmaxForward(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y)
Execute a softmax forward layer.
miopenStatus_t miopenSoftmaxForward_V2(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y, miopenSoftmaxAlgorithm_t algorithm, miopenSoftmaxMode_t mode)
Execute a softmax forward layer with expanded modes and algorithms.
miopenStatus_t miopenSoftmaxBackward(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx)
Execute a softmax backwards layer.
miopenSoftmaxMode_t
Definition: miopen.h:529
miopenSoftmaxAlgorithm_t
Definition: miopen.h:518
miopenStatus_t miopenSumForward(miopenHandle_t handle, miopenSumNanPropagation_t nanPropagation, void *workspace, size_t workspaceSizeInBytes, const miopenTensorDescriptor_t xDesc, const void *x, const int32_t dim, const miopenTensorDescriptor_t yDesc, void *y)
Execute a sum forward layer.
miopenSumNanPropagation_t
Definition: miopen.h:5611
miopenStatus_t miopenGetSumWorkspaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t xDesc, const int32_t dim, const miopenTensorDescriptor_t yDesc, size_t *sizeInBytes)
Helper function to query the minimum workspace size required by the ReduceTensor call.
miopenStatus_t miopenDestroySeqTensorDescriptor(miopenSeqTensorDescriptor_t tensorDesc)
Destroys the sequence data tensor descriptor.
miopenStatus_t miopenGetTensorDescriptor(miopenTensorDescriptor_t tensorDesc, miopenDataType_t *dataType, int *dimsA, int *stridesA)
Get the details of the N-dimensional tensor descriptor.
miopenStatus_t miopenSetNdTensorDescriptorWithLayout(miopenTensorDescriptor_t tensorDesc, miopenDataType_t dataType, miopenTensorLayout_t tensorLayout, const int *lens, int num_lens)
Set shape of ND tensor with specific layout.
miopenStatus_t miopenSetTensor(miopenHandle_t handle, const miopenTensorDescriptor_t yDesc, void *y, const void *alpha)
Fills a tensor with a single value.
miopenStatus_t miopenOpTensor(miopenHandle_t handle, miopenTensorOp_t tensorOp, const void *alpha1, const miopenTensorDescriptor_t aDesc, const void *A, const void *alpha2, const miopenTensorDescriptor_t bDesc, const void *B, const void *beta, const miopenTensorDescriptor_t cDesc, void *C)
Execute element-wise tensor operations.
miopenStatus_t miopenGetTensorNumBytes(miopenTensorDescriptor_t tensorDesc, size_t *numBytes)
Returns number of bytes associated with tensor descriptor.
miopenStatus_t miopenGet4dTensorDescriptor(miopenTensorDescriptor_t tensorDesc, miopenDataType_t *dataType, int *n, int *c, int *h, int *w, int *nStride, int *cStride, int *hStride, int *wStride)
Get the details of the tensor descriptor.
miopenTensorLayout_t
Definition: miopen.h:378
miopenStatus_t miopenTransformTensor(miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y)
Copies one tensor to another tensor with a different layout/scale.
miopenStatus_t miopenCreateTensorDescriptor(miopenTensorDescriptor_t *tensorDesc)
Create a Tensor Descriptor.
miopenStatus_t miopenScaleTensor(miopenHandle_t handle, const miopenTensorDescriptor_t yDesc, void *y, const void *alpha)
Scales all elements in a tensor by a single value.
miopenStatus_t miopenSetTensorCastType(miopenTensorDescriptor_t tensorDesc, miopenDataType_t cast_type)
Set the tensor cast type.
miopenStatus_t miopenSet4dTensorDescriptor(miopenTensorDescriptor_t tensorDesc, miopenDataType_t dataType, int n, int c, int h, int w)
Set shape of 4D tensor.
miopenStatus_t miopenSet4dTensorDescriptorEx(miopenTensorDescriptor_t tensorDesc, miopenDataType_t dataType, int n, int c, int h, int w, int nStride, int cStride, int hStride, int wStride)
Set shape and stride of 4D tensor.
miopenDataType_t
Definition: miopen.h:354
miopenStatus_t miopenCreateSeqTensorDescriptor(miopenSeqTensorDescriptor_t *tensorDesc)
Create a Tensor Descriptor for sequence data.
miopenTensorOp_t
Definition: miopen.h:407
miopenStatus_t miopenGetTensorDescriptorSize(miopenTensorDescriptor_t tensorDesc, int *size)
Set shape of N-dimensional tensor.
miopenStatus_t miopenDestroyTensorDescriptor(miopenTensorDescriptor_t tensorDesc)
Destroys the tensor descriptor.
miopenStatus_t miopenSetTensorDescriptor(miopenTensorDescriptor_t tensorDesc, miopenDataType_t dataType, int nbDims, const int *dimsA, const int *stridesA)
Set shape of N-dimensional tensor.
miopenPaddingMode_t
Definition: miopen.h:431
@ miopenPaddingDefault
Definition: miopen.h:432
@ miopenPaddingSame
Definition: miopen.h:433
@ miopenPaddingValid
Definition: miopen.h:434
#define MIOPEN_DECLARE_OBJECT(name)
Definition: miopen.h:75
miopenNanPropagation_t
Definition: miopen.h:574
@ MIOPEN_PROPAGATE_NAN
Definition: miopen.h:576
@ MIOPEN_NOT_PROPAGATE_NAN
Definition: miopen.h:575
@ miopenPoolingAverage
Definition: miopen.h:444
@ miopenPoolingAverageInclusive
Definition: miopen.h:445
@ miopenPoolingMax
Definition: miopen.h:443
@ miopenTensorCHWN
Definition: miopen.h:381
@ miopenTensorNHWC
Definition: miopen.h:380
@ miopenTensorNDHWC
Definition: miopen.h:387
@ miopenTensorNCHW
Definition: miopen.h:379
@ miopenTensorCHWNc4
Definition: miopen.h:384
@ miopenTensorNCHWc8
Definition: miopen.h:383
@ miopenTensorNCDHW
Definition: miopen.h:386
@ miopenTensorCHWNc8
Definition: miopen.h:385
@ miopenTensorNCHWc4
Definition: miopen.h:382
@ MIOPEN_REDUCE_TENSOR_FLATTENED_INDICES
Definition: miopen.h:586
@ MIOPEN_REDUCE_TENSOR_NO_INDICES
Definition: miopen.h:585
@ miopenActivationLEAKYRELU
Definition: miopen.h:506
@ miopenActivationPASTHRU
Definition: miopen.h:497
@ miopenActivationABS
Definition: miopen.h:502
@ miopenActivationLOGISTIC
Definition: miopen.h:498
@ miopenActivationCLIPPEDRELU
Definition: miopen.h:504
@ miopenActivationRELU
Definition: miopen.h:500
@ miopenActivationPOWER
Definition: miopen.h:503
@ miopenActivationELU
Definition: miopen.h:508
@ miopenActivationSOFTRELU
Definition: miopen.h:501
@ miopenActivationTANH
Definition: miopen.h:499
@ MIOPEN_REDUCE_TENSOR_MUL
Definition: miopen.h:551
@ MIOPEN_REDUCE_TENSOR_MAX
Definition: miopen.h:555
@ MIOPEN_REDUCE_TENSOR_AVG
Definition: miopen.h:559
@ MIOPEN_REDUCE_TENSOR_NORM1
Definition: miopen.h:561
@ MIOPEN_REDUCE_TENSOR_AMAX
Definition: miopen.h:557
@ MIOPEN_REDUCE_TENSOR_MIN
Definition: miopen.h:553
@ MIOPEN_REDUCE_TENSOR_ADD
Definition: miopen.h:550
@ MIOPEN_REDUCE_TENSOR_NORM2
Definition: miopen.h:563
@ MIOPEN_CONVOLUTION_ATTRIB_DETERMINISTIC
Definition: miopen.h:611
@ MIOPEN_CONVOLUTION_ATTRIB_FP8_ROUNDING_MODE
Definition: miopen.h:615
@ MIOPEN_CONVOLUTION_ATTRIB_FP16_ALT_IMPL
Definition: miopen.h:607
@ miopenIndexUint16
Definition: miopen.h:397
@ miopenIndexUint64
Definition: miopen.h:399
@ miopenIndexUint32
Definition: miopen.h:398
@ miopenIndexUint8
Definition: miopen.h:396
@ miopenFloat
Definition: miopen.h:356
@ miopenBFloat16
Definition: miopen.h:360
@ miopenInt8
Definition: miopen.h:358
@ miopenInt32
Definition: miopen.h:357
@ miopenHalf
Definition: miopen.h:355
@ miopenBFloat8
Definition: miopen.h:365
@ miopenDouble
Definition: miopen.h:362
@ miopenFloat8
Definition: miopen.h:364
@ MIOPEN_8BIT_INDICES
Definition: miopen.h:598
@ MIOPEN_32BIT_INDICES
Definition: miopen.h:595
@ MIOPEN_16BIT_INDICES
Definition: miopen.h:597
@ MIOPEN_64BIT_INDICES
Definition: miopen.h:596
@ miopenPoolingWorkspaceIndexImage
Definition: miopen.h:457
@ miopenPoolingWorkspaceIndexMask
Definition: miopen.h:456
@ miopenDepthwise
Definition: miopen.h:423
@ miopenGroupConv
Definition: miopen.h:422
@ miopenTranspose
Definition: miopen.h:421
@ miopenConvolution
Definition: miopen.h:420
@ MIOPEN_WEIGHT_BIAS
Definition: miopen.h:477
@ MIOPEN_ELEMENTWISE_AFFINE
Definition: miopen.h:476
@ MIOPEN_SUM_NOT_PROPAGATE_NAN
Definition: miopen.h:5612
@ MIOPEN_SUM_PROPAGATE_NAN
Definition: miopen.h:5613
@ miopenTensorOpMin
Definition: miopen.h:410
@ miopenTensorOpAdd
Definition: miopen.h:408
@ miopenTensorOpMul
Definition: miopen.h:409
@ miopenTensorOpMax
Definition: miopen.h:411
@ miopenBNSpatial
Definition: miopen.h:488
@ miopenBNPerActivation
Definition: miopen.h:487
@ miopenLRNWithinChannel
Definition: miopen.h:466
@ miopenLRNCrossChannel
Definition: miopen.h:467
@ MIOPEN_SOFTMAX_MODE_INSTANCE
Definition: miopen.h:530
@ MIOPEN_SOFTMAX_MODE_CHANNEL
Definition: miopen.h:531
@ MIOPEN_SOFTMAX_FAST
Definition: miopen.h:519
@ MIOPEN_SOFTMAX_ACCURATE
Definition: miopen.h:520
@ MIOPEN_SOFTMAX_LOG
Definition: miopen.h:521
Perf struct for forward, backward filter, or backward data algorithms.
Definition: miopen.h:1196
miopenConvFwdAlgorithm_t fwd_algo
Definition: miopen.h:1199
miopenConvBwdDataAlgorithm_t bwd_data_algo
Definition: miopen.h:1203
size_t memory
Definition: miopen.h:1207
miopenConvBwdWeightsAlgorithm_t bwd_weights_algo
Definition: miopen.h:1200
float time
Definition: miopen.h:1206
Performance struct for forward, backward filter, or backward data algorithms in immediate mode.
Definition: miopen.h:1220
miopenConvAlgorithm_t algorithm
Definition: miopen.h:1227
uint64_t solution_id
Definition: miopen.h:1226
size_t workspace_size
Definition: miopen.h:1224
float time
Definition: miopen.h:1221
Values of a tensor argument for the miopenRunSolution function.
Definition: miopen.h:5451
miopenTensorArgumentId_t id
Definition: miopen.h:5454
void * buffer
Definition: miopen.h:5463
miopenTensorDescriptor_t * descriptor
Definition: miopen.h:5460