Convolutions

Convolutions#

MIOpen: Convolutions
Convolutions

Classes

struct  miopenConvAlgoPerf_t
 Perf struct for forward, backward filter, or backward data algorithms. More...
 
struct  miopenConvSolution_t
 Performance struct for forward, backward filter, or backward data algorithms in immediate mode. More...
 

Enumerations

enum  miopenConvFwdAlgorithm_t {
  miopenConvolutionFwdAlgoGEMM = 0 ,
  miopenConvolutionFwdAlgoDirect = 1 ,
  miopenConvolutionFwdAlgoFFT = 2 ,
  miopenConvolutionFwdAlgoWinograd = 3 ,
  miopenConvolutionFwdAlgoImplicitGEMM = 5
}
 
enum  miopenConvBwdWeightsAlgorithm_t {
  miopenConvolutionBwdWeightsAlgoGEMM = 0 ,
  miopenConvolutionBwdWeightsAlgoDirect = 1 ,
  miopenConvolutionBwdWeightsAlgoWinograd = 3 ,
  miopenConvolutionBwdWeightsAlgoImplicitGEMM = 5
}
 
enum  miopenConvBwdDataAlgorithm_t {
  miopenConvolutionBwdDataAlgoGEMM = 0 ,
  miopenConvolutionBwdDataAlgoDirect = 1 ,
  miopenConvolutionBwdDataAlgoFFT = 2 ,
  miopenConvolutionBwdDataAlgoWinograd = 3 ,
  miopenTransposeBwdDataAlgoGEMM ,
  miopenConvolutionBwdDataAlgoImplicitGEMM = 5
}
 
enum  miopenConvAlgorithm_t {
  miopenConvolutionAlgoGEMM = 0 ,
  miopenConvolutionAlgoDirect = 1 ,
  miopenConvolutionAlgoFFT = 2 ,
  miopenConvolutionAlgoWinograd = 3 ,
  miopenConvolutionAlgoImplicitGEMM = 5
}
 
enum  miopenConvolutionMode_t {
  miopenConvolution = 0 ,
  miopenTranspose = 1 ,
  miopenGroupConv = 2 ,
  miopenDepthwise = 3
}
 
enum  miopenConvolutionAttrib_t {
  MIOPEN_CONVOLUTION_ATTRIB_FP16_ALT_IMPL ,
  MIOPEN_CONVOLUTION_ATTRIB_DETERMINISTIC ,
  MIOPEN_CONVOLUTION_ATTRIB_FP8_ROUNDING_MODE
}
 

Functions

 MIOPEN_DECLARE_OBJECT (miopenConvolutionDescriptor)
 Creates the miopenConvolutionDescriptor_t type. More...
 
miopenStatus_t miopenCreateConvolutionDescriptor (miopenConvolutionDescriptor_t *convDesc)
 Creates a convolution layer descriptor. More...
 
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. More...
 
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. More...
 
miopenStatus_t miopenGetConvolutionSpatialDim (miopenConvolutionDescriptor_t convDesc, int *spatialDim)
 Retrieves the spatial dimension of a convolution layer descriptor. More...
 
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. More...
 
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. More...
 
miopenStatus_t miopenGetConvolutionGroupCount (miopenConvolutionDescriptor_t convDesc, int *groupCount)
 Get the number of groups to be used in Group/Depthwise convolution. More...
 
miopenStatus_t miopenSetConvolutionGroupCount (miopenConvolutionDescriptor_t convDesc, int groupCount)
 Set the number of groups to be used in Group/Depthwise convolution. More...
 
miopenStatus_t miopenSetTransposeConvOutputPadding (miopenConvolutionDescriptor_t convDesc, int adj_h, int adj_w)
 Set the output padding to be used in 2-D Transpose convolution. More...
 
miopenStatus_t miopenSetTransposeConvNdOutputPadding (miopenConvolutionDescriptor_t convDesc, int spatialDim, const int *adjA)
 Set the output padding to be used in N-dimensional Transpose convolution. More...
 
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. More...
 
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. More...
 
miopenStatus_t miopenDestroyConvolutionDescriptor (miopenConvolutionDescriptor_t convDesc)
 Destroys the tensor descriptor object. More...
 
miopenStatus_t miopenSetConvolutionAttribute (miopenConvolutionDescriptor_t convDesc, const miopenConvolutionAttrib_t attr, int value)
 Set the attribute of the convolution descriptor. More...
 
miopenStatus_t miopenGetConvolutionAttribute (miopenConvolutionDescriptor_t convDesc, const miopenConvolutionAttrib_t attr, int *value)
 Get the attribute of the convolution descriptor. More...
 
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 descriptor for Convolution in the Forward direction. More...
 
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, output and convolution descriptors. More...
 
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. More...
 
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 miopenConvolutionForwardGetSolution API call above. Compiling the solution ensures that the first API call to miopenConvolutionForwardImmediate does not cause a compile. More...
 
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. More...
 
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 descriptor for backward Convolution w-r-t Data. More...
 
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, output and convolution descriptors. More...
 
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. More...
 
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 miopenConvolutionBackwardDataGetSolution API call above. Compiling the solution ensures that the first API call to miopenConvolutionBackwardDataImmediate does not cause a compile. More...
 
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. More...
 
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 descriptor for backward Convolution w-r-t Weights. More...
 
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, output and convolution descriptors. More...
 
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. More...
 
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 miopenConvolutionBackwardWeightsGetSolution API call above. Compiling the solution ensures that the first API call to miopenConvolutionBackwardWeightsImmediate does not cause a compile. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

Enumeration Type Documentation

◆ miopenConvAlgorithm_t

Top-level convolutional algorithm mode

Enumerator
miopenConvolutionAlgoGEMM 

GEMM variant

miopenConvolutionAlgoDirect 

Direct convolutions

miopenConvolutionAlgoFFT 

Fast Fourier Transform indirect convolutions

miopenConvolutionAlgoWinograd 

Winograd indirect convolutions

miopenConvolutionAlgoImplicitGEMM 

Implicit GEMM convolutions

Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvBwdDataAlgorithm_t

Convolutional algorithm mode for back propagation on data.

Enumerator
miopenConvolutionBwdDataAlgoGEMM 

GEMM variant

miopenConvolutionBwdDataAlgoDirect 

Direct convolutions

miopenConvolutionBwdDataAlgoFFT 

Fast Fourier Transform indirect convolutions

miopenConvolutionBwdDataAlgoWinograd 

Winograd indirect convolutions

miopenTransposeBwdDataAlgoGEMM 

Deprecated Transpose GEMM variant legacy, ToBe Removed

miopenConvolutionBwdDataAlgoImplicitGEMM 

Implicit GEMM convolutions

Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvBwdWeightsAlgorithm_t

Convolutional algorithm mode for back propagation on weights.

Enumerator
miopenConvolutionBwdWeightsAlgoGEMM 

GEMM variant

miopenConvolutionBwdWeightsAlgoDirect 

Direct convolution algorithm

miopenConvolutionBwdWeightsAlgoWinograd 

Winograd convolutions

miopenConvolutionBwdWeightsAlgoImplicitGEMM 

Implicit GEMM convolutions

Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvFwdAlgorithm_t

Convolutional algorithm mode for forward propagation. MIOpen use cross-correlation for its convolution implementation.

Enumerator
miopenConvolutionFwdAlgoGEMM 

GEMM variant

miopenConvolutionFwdAlgoDirect 

Direct convolutions

miopenConvolutionFwdAlgoFFT 

Fast Fourier Transform indirect convolutions

miopenConvolutionFwdAlgoWinograd 

Winograd indirect convolutions

miopenConvolutionFwdAlgoImplicitGEMM 

Implicit GEMM convolutions

Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionAttrib_t

Attribute for convolution descriptor, used for alternating the convolution behavior

Enumerator
MIOPEN_CONVOLUTION_ATTRIB_FP16_ALT_IMPL 

Use alternative fp16 implementation. Only supported for gfx90a; has no effect for other targets. 0 - disabled, 1 - enabled, -1 or unset - default (F0B1W1) >

MIOPEN_CONVOLUTION_ATTRIB_DETERMINISTIC 

Restrict MIOpen convolutions to kernels which produce numerically deterministic results. 0 - disabled (default), 1 - enabled >

MIOPEN_CONVOLUTION_ATTRIB_FP8_ROUNDING_MODE 

Specifies the rounding mode for the 8-bit floating data types. Currently, two rounding modes are supported miopenF8RoundingModeStandard and miopenF8RoundingModeStochastic. These are listed as part of the miopenF8RoundingMode_t enum.>

Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionMode_t

Convolution mode selection for convolution layer preference.

Enumerator
miopenConvolution 

Cross-Correlation convolution

miopenTranspose 

Transpose convolutions – deconvolution

miopenGroupConv 

Deprecated Group convolution legacy, ToBe Removed

miopenDepthwise 

Deprecated Depthwise convolution legacy, ToBe Removed

Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

Function Documentation

◆ MIOPEN_DECLARE_OBJECT()

MIOPEN_DECLARE_OBJECT ( miopenConvolutionDescriptor  )

Creates the miopenConvolutionDescriptor_t type.

Convolution descriptor is an object that allows the user to specify a layer's padding, stride, and dilation of the convolutional filter. Parameters must all be non-negative.

◆ miopenConvolutionBackwardBias()

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.

Compute the convolution backwards gradient with respect to the bias tensor. The scaling parameter alpha (float) and shift parameter beta (float) are only supported for alpha = 1 and beta = 0.

Parameters
handleMIOpen handle (input)
alphaFloating point scaling factor, allocated on the host (input)
dyDescTensor descriptor for data input tensor dy (input)
dyData delta tensor dy (input)
betaFloating point shift factor, allocated on the host (input)
dbDescTensor descriptor for input bias tensor db (input)
dbBias delta tensor db (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardData()

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.

Runs the backward data convolution layer based on the selected algorithm. The function miopenFindConvolutionBackwardDataAlgorithm() must have been executed previously to determine the required memory needed for the workspace and the best convolutional algorithm.

The backward data convolution is designed to accommodate both packed and non-packed tensor strides for multiple data types and dimensions across various platforms. This flexibility ensures optimal performance in handling diverse computational scenarios. To configure tensor parameters, including strides, users can utilize the APIs miopenSetTensorDescriptor() and miopenGetTensorDescriptor(). These APIs empower developers to seamlessly set and retrieve tensor information, facilitating a more intuitive and efficient workflow. The tensor strides are non-packed by default.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
alphaFloating point scaling factor, allocated on the host (input)
dyDescTensor descriptor for data input tensor dy (input)
dyData delta tensor dy (input)
wDescTensor descriptor for weight tensor w (input)
wWeights tensor w (input)
convDescConvolution layer descriptor (input)
algoAlgorithm selected (input)
betaFloating point shift factor, allocated on the host (input)
dxDescTensor descriptor for output data tensor dx (input)
dxData delta tensor dx (output)
workSpacePointer to workspace required for the search (input)
workSpaceSizeSize in bytes of the memory needed for find (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardDataCompileSolution()

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 miopenConvolutionBackwardDataGetSolution API call above. Compiling the solution ensures that the first API call to miopenConvolutionBackwardDataImmediate does not cause a compile.

This is an optional step and may be skipped if a slow first miopenConvolutionBackwardDataImmediate invocation is acceptable.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
wDescTensor descriptor for weight tensor w (input)
convDescConvolution layer descriptor (input)
dxDescTensor descriptor for output data tensor dx (input)
solution_idID of the solution to be compiled, as chosen by the user
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardDataGetSolution()

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, output and convolution descriptors.

The returned solutions array is sorted in the order of decreasing performance. The returned solutions ns might be based on heuristics and for more consistent performance results the user the advised to run the Find step. The maximum length of the solutions array may be queried using miopenConvolutionBackwardDataGetSolutionCount

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
wDescTensor descriptor for weight tensor w (input)
convDescConvolution layer descriptor (input)
dxDescTensor descriptor for output data tensor dx (input)
maxSolutionCountThe size of the solutions array passed in below (input)
solutionCountThe size of the solutions array returned (output)
solutionsA pointer to an array of type miopenConvSolution_t allocated by the user, filled in by MIOpen with applicable solutions. (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardDataGetSolutionCount()

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 descriptor for backward Convolution w-r-t Data.

This call returns the maximum number of applicable solutions for a the convolution problem, the number returned may be used to allocate the memory required for the miopenConvAlgoPert2_t which is required by miopenConvolutionBackwardDataGetSolution API calls.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
wDescTensor descriptor for weight tensor w (input)
convDescConvolution layer descriptor (input)
dxDescTensor descriptor for output data tensor dx (input)
solutionCountPointer to memory to return number of applicable solutions (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardDataGetSolutionWorkspaceSize()

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.

This is an optional call for users who may have serialized the solution id and just need the workspace size for it. The same information is returned by the miopenConvolutionBackwardDataGetSolution as part of the miopenConvSolution_t struct.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
wDescTensor descriptor for weight tensor w (input)
convDescConvolution layer descriptor (input)
dxDescTensor descriptor for output data tensor dx (input)
solution_idID of the solution for which workspace size is required (input)
workSpaceSizeThe size of the workspace (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardDataGetWorkSpaceSize()

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.

For a provided tensor descriptors and algorithm selection, this function calculates and returns the workspace size required for back propagation on data. This call is required and must be executed once before running miopenFindConvolutionBackwardDataAlgorithm() in order to determine the largest required allocation for the algorithm search; i.e., the maximum size of the memory needed from the set of potential backward convolution algorithm is returned.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
wDescTensor descriptor for weight tensor w (input)
convDescConvolution layer descriptor (input)
dxDescTensor descriptor for output data tensor dx (input)
workSpaceSizeSize in bytes of the memory required (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardDataImmediate()

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.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
dyData delta tensor dy (input)
wDescTensor descriptor for weight tensor w (input)
wWeights tensor w (input)
convDescConvolution layer descriptor (input)
dxDescTensor descriptor for output data tensor dx (input)
dxData delta tensor dx (output)
workSpaceWorkspace tensor (input)
workSpaceSizeSize in bytes of the workspace memory pointed to by workSpace
solution_idID of the solution to be compiled, as chosen by the user
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardWeights()

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.

Runs the backward weights convolution layer based on the selected algorithm. The function miopenFindConvolutionBackwardWeightsAlgorithm() must have been executed previously to determine the required memory needed for the workspace and the best convolutional algorithm.

The backward weights convolution is designed to accommodate both packed and non-packed tensor strides for multiple data types and dimensions across various platforms. This flexibility ensures optimal performance in handling diverse computational scenarios. To configure tensor parameters, including strides, users can utilize the APIs miopenSetTensorDescriptor() and miopenGetTensorDescriptor(). These APIs empower developers to seamlessly set and retrieve tensor information, facilitating a more intuitive and efficient workflow. The tensor strides are non-packed by default.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
alphaFloating point scaling factor, allocated on the host (input)
dyDescTensor descriptor for data tensor dy (input)
dyData delta tensor dy (input)
xDescTensor descriptor for data tensor x (input)
xData tensor x (input)
convDescConvolution layer descriptor (input)
algoAlgorithm selected (input)
betaFloating point shift factor, allocated on the host (input)
dwDescTensor descriptor for weight tensor dw (input)
dwWeights delta tensor dw (output)
workSpacePointer to workspace required for the search (input)
workSpaceSizeSize in bytes of the memory needed for find (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardWeightsCompileSolution()

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 miopenConvolutionBackwardWeightsGetSolution API call above. Compiling the solution ensures that the first API call to miopenConvolutionBackwardWeightsImmediate does not cause a compile.

This is an optional step and may be skipped if a slow first miopenConvolutionBackwardWeightsImmediate invocation is acceptable.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data tensor dy (input)
xDescTensor descriptor for data tensor x (input)
convDescConvolution layer descriptor (input)
dwDescTensor descriptor for weight tensor dw (input)
solution_idID of the solution to be compiled, as chosen by the user
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardWeightsGetSolution()

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, output and convolution descriptors.

The returned solutions array is sorted in the order of decreasing performance. The returned solutions might be based on heuristics and for more consistent performance results the user the advised to run the Find step. The maximum length of the solutions array may be queried using miopenConvolutionBackwardWeightsGetSolutionCount

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data tensor dy (input)
xDescTensor descriptor for data tensor x (input)
convDescConvolution layer descriptor (input)
dwDescTensor descriptor for weight tensor dw (input)
maxSolutionCountThe size of the solutions array passed in below (input)
solutionCountThe size of the solutions array returned (output)
solutionsA pointer to an array of type miopenConvSolution_t allocated by the user, filled in by MIOpen with applicable solutions. (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardWeightsGetSolutionCount()

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 descriptor for backward Convolution w-r-t Weights.

This call returns the maximum number of applicable solutions for a the convolution problem, the number returned may be used to allocate the memory required for the miopenConvAlgoPert2_t which is required by miopenConvolutionBackwardWeightsGetSolution API calls.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data tensor dy (input)
xDescTensor descriptor for data tensor x (input)
convDescConvolution layer descriptor (input)
dwDescTensor descriptor for weight tensor dw (input)
solutionCountPointer to memory to return number of applicable solutions (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardWeightsGetSolutionWorkspaceSize()

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.

This is an optional call for users who may have serialized the solution id and just need the workspace size for it. The same information is returned by the miopenConvolutionBackwardWeightsGetSolution as part of the miopenConvSolution_t struct.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data tensor dy (input)
xDescTensor descriptor for data tensor x (input)
convDescConvolution layer descriptor (input)
dwDescTensor descriptor for weight tensor dw (input)
solution_idID of the solution for which workspace size is required (input)
workSpaceSizeThe size of the workspace (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardWeightsGetWorkSpaceSize()

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.

For a provided tensor descriptors and algorithm selection, this function calculates and returns the workspace size required for back propagation on data. This call is required and must be executed once before running miopenFindConvolutionBackwardWeightsAlgorithm() in order to determine the largest required allocation for the algorithm search; i.e., the maximum size of the memory needed from the set of potential backward weights convolution algorithm is returned.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
xDescTensor descriptor for data tensor x (input)
convDescConvolution layer descriptor (input)
dwDescTensor descriptor for output weights tensor dw (input)
workSpaceSizeSize in bytes of the memory required (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionBackwardWeightsImmediate()

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.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data tensor dy (input)
dyData delta tensor dy (input)
xDescTensor descriptor for data tensor x (input)
xData tensor x (input)
convDescConvolution layer descriptor (input)
dwDescTensor descriptor for weight tensor dw (input)
dwWeights delta tensor dw (output)
workSpaceWorkspace tensor (input)
workSpaceSizeSize in bytes of the memory passed in, pointed to by workSpace pointer above
solution_idID of the solution to be compiled, as chosen by the user
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionForward()

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.

Runs the forward convolution layer based on the selected algorithm. The function miopenFindConvolutionForwardAlgorithm() must have been executed previously to determine the required memory needed for the workspace and the best convolutional algorithm. The scaling parameter alpha (float) and shift parameter beta (float) are only supported for alpha = 1 and beta = 0.

The forward convolution is designed to accommodate both packed and non-packed tensor strides for multiple data types and dimensions across various platforms. This flexibility ensures optimal performance in handling diverse computational scenarios. To configure tensor parameters, including strides, users can utilize the APIs miopenSetTensorDescriptor() and miopenGetTensorDescriptor(). These APIs empower developers to seamlessly set and retrieve tensor information, facilitating a more intuitive and efficient workflow. The tensor strides are non-packed by default.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
alphaFloating point scaling factor, allocated on the host (input)
xDescTensor descriptor for data input tensor x (input)
xData tensor x (input)
wDescTensor descriptor for weight tensor w (input)
wWeights tensor w (inputs)
convDescConvolution layer descriptor (inputs)
algoAlgorithm selected (inputs)
betaFloating point shift factor, allocated on the host (input)
yDescTensor descriptor for output data tensor y (input)
yData tensor y (output)
workSpacePointer to workspace required (input)
workSpaceSizeSize in bytes of the memory determined by the find step (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionForwardBias()

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.

This function applies an element-wise bias to a data tensor from an input bias tensor. The scaling parameter alpha (float) and shift parameter beta (float) are only supported for alpha = 1 and beta = 0.

Parameters
handleMIOpen handle (input)
alphaFloating point scaling factor, allocated on the host (input)
bDescTensor descriptor for bias tensor b (input)
bBias tensor b (input)
betaFloating point shift factor, allocated on the host (input)
yDescTensor descriptor for data tensor y (input)
yData tensor y (input and output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionForwardCompileSolution()

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 miopenConvolutionForwardGetSolution API call above. Compiling the solution ensures that the first API call to miopenConvolutionForwardImmediate does not cause a compile.

This is an optional step and may be skipped if a slow first miopenConvolutionForwardImmediate invocation is acceptable.

Parameters
handleMIOpen handle (input)
wDescTensor descriptor for weight tensor w (input)
xDescTensor descriptor for input data tensor x (input)
convDescConvolution layer descriptor (input)
yDescTensor descriptor for output data tensor y (input)
solution_idID of the solution to be compiled, as chosen by the user
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionForwardGetSolution()

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, output and convolution descriptors.

The returned solutions array is sorted in the order of decreasing performance. The returned solutions might be based on heuristics and for more consistent performance results the user the advised to run the Find step. The maximum length of the solutions array may be queried using miopenConvolutionForwardGetSolutionCount

Parameters
handleMIOpen handle (input)
wDescTensor descriptor for weight tensor w (input)
xDescTensor descriptor for input data tensor x (input)
convDescConvolution layer descriptor (input)
yDescTensor descriptor for output data tensor y (input)
maxSolutionCountThe size of the solutions array passed in below (input)
solutionCountThe size of the solutions array returned (output)
solutionsA pointer to an array of type miopenConvSolution_t allocated by the user, filled in by MIOpen with applicable solutions. (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionForwardGetSolutionCount()

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 descriptor for Convolution in the Forward direction.

This call returns the maximum number of applicable solutions for a forward convolution problem. The solutionCount returned may be used to allocate the memory required for the miopenConvAlgoPerf_t which is required by miopenConvolutionGetSolution API calls.

Parameters
handleMIOpen handle (input)
wDescTensor descriptor for weight tensor w (input)
xDescTensor descriptor for input data tensor x (input)
convDescConvolution layer descriptor (input)
yDescTensor descriptor for output data tensor y (input)
solutionCountPointer to memory to return number of applicable solutions (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionForwardGetSolutionWorkspaceSize()

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.

This is an optional call for users who may have serialized the solution id and just need the workspace size for it. The same information is returned by the miopenConvolutionForwardGetSolution as part of the miopenConvSolution_t struct.

Parameters
handleMIOpen handle (input)
wDescTensor descriptor for weight tensor w (input)
xDescTensor descriptor for input data tensor x (input)
convDescConvolution layer descriptor (input)
yDescTensor descriptor for output data tensor y (input)
solution_idID of the solution for which workspace size is required (input)
workSpaceSizeThe size of the workspace (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionForwardGetWorkSpaceSize()

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.

This call is required and must be executed once before running miopenFindConvolutionForwardAlgorithm() in order to determine the largest required allocation for the algorithm search; i.e., the maximum size of the memory needed from the set of potential forward convolution algorithm is returned.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
wDescTensor descriptor for weight tensor w (input)
xDescTensor descriptor for input data tensor x (input)
convDescConvolution layer descriptor (input)
yDescTensor descriptor for output data tensor y (input)
workSpaceSizePointer to memory to return size in bytes (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenConvolutionForwardImmediate()

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.

Supported datatypes are fp32, fp16, bfp16, and int8

Parameters
handleMIOpen handle (input)
wDescTensor descriptor for weight tensor w (input)
wWeights tensor w (input)
xDescTensor descriptor for input data tensor x (input)
xData tensor x (input)
convDescConvolution layer descriptor (input)
yDescTensor descriptor for output data tensor y (input)
yData tensor y (output)
workSpaceWorkspace tensor (input)
workSpaceSizeSize of the memory in bytes pointed to by workSpace above
solution_idID of the solution to be compiled, as chosen by the user
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenCreateConvolutionDescriptor()

miopenStatus_t miopenCreateConvolutionDescriptor ( miopenConvolutionDescriptor_t *  convDesc)

Creates a convolution layer descriptor.

Parameters
convDescConvolution layer descriptor
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenDestroyConvolutionDescriptor()

miopenStatus_t miopenDestroyConvolutionDescriptor ( miopenConvolutionDescriptor_t  convDesc)

Destroys the tensor descriptor object.

Parameters
convDescConvolution tensor descriptor type (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenFindConvolutionBackwardDataAlgorithm()

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.

This function attempts all MIOpen backward data convolution algorithms, and outputs the performance metrics to a user-allocated array of type miopenConvAlgoPerf_t. These metrics are written in sorted fashion where the first element has the lowest compute time. This function is mandatory before using backwards convolutions. Users can chose the top-most algorithm if they only care about the fastest algorithm.

This function is mandatory before using miopenConvolutionBackwardData(). In order to execute this function, miopenConvolutionBackwardsDataGetWorkSpaceSize() must be run to determine the required memory for this search.

  • If exhaustiveSearch == 0, MIOpen will look for the first kernel with a configuration match. If a configuration match is not found, a default configuration will be returned.
  • If exhaustiveSearch == 1, MIOpen will look for the best kernel for the provided configuration. If a match is not found, an exhaustive search is performed by running individual algorithms.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
dyData delta tensor dy (input)
wDescTensor descriptor for weight tensor w (input)
wWeights tensor w (input)
convDescConvolution layer descriptor (input)
dxDescTensor descriptor for output data tensor dx (input)
dxData delta tensor dx (input)
requestAlgoCountNumber of algorithms to return kernel times (input)
returnedAlgoCountPointer to number of algorithms returned (output)
perfResultsPointer to union of best algorithm for forward and backwards (output)
workSpacePointer to workspace required for the search (output)
workSpaceSizeSize in bytes of the memory needed for find (output)
exhaustiveSearchA boolean to toggle a full search of all algorithms and configurations (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenFindConvolutionBackwardWeightsAlgorithm()

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.

This function attempts all MIOpen backward weights convolution algorithms, and outputs the performance metrics to a user-allocated array of type miopenConvAlgoPerf_t. These metrics are written in sorted fashion where the first element has the lowest compute time. This function is mandatory before using backwards weight convolutions. Users can chose the top-most algorithm if they only care about the fastest algorithm.

This function is mandatory before using miopenConvolutionBackwardWeights(). In order to execute this function, miopenConvolutionBackwardsWeightsGetWorkSpaceSize() must be run to determine the required memory for this search.

  • If exhaustiveSearch == 0, MIOpen will look for the first kernel with a configuration match. If a configuration match is not found, a default configuration will be returned.
  • If exhaustiveSearch == 1, MIOpen will look for the best kernel for the provided configuration. If a match is not found, an exhaustive search is performed by running individual algorithms.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
dyDescTensor descriptor for data input tensor dy (input)
dyData delta tensor dy (input)
xDescTensor descriptor for output data tensor x (input)
xData delta tensor dx (input)
convDescConvolution layer descriptor (input)
dwDescTensor descriptor for weight tensor dw (input)
dwWeights delta tensor dw (input)
requestAlgoCountNumber of algorithms to return kernel times (input)
returnedAlgoCountPointer to number of algorithms returned (output)
perfResultsPointer to union of best algorithm for forward and backwards (output)
workSpacePointer to workspace required for the search (output)
workSpaceSizeSize in bytes of the memory needed for find (output)
exhaustiveSearchA boolean to toggle a full search of all algorithms and configurations (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenFindConvolutionForwardAlgorithm()

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.

This function attempts all MIOpen forward convolution algorithms based on the input configuration, and outputs performance metrics to a user-allocated array of type miopenConvAlgoPerf_t. These metrics are written in a sorted fashion where the first element has the lowest compute time. Users can chose the top-most algorithm if they only care about the fastest algorithm.

This function is mandatory before using miopenConvolutionForward(). In order to execute this function, miopenConvolutionForwardGetWorkSpaceSize() must be run to determine the required memory for this search.

  • If exhaustiveSearch == 0, MIOpen will look for the first kernel with a configuration match. If a configuration match is not found, a default configuration will be returned.
  • If exhaustiveSearch == 1, MIOpen will look for the best kernel for the provided configuration. If a match is not found, an exhaustive search is performed by running individual algorithms.

If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running this.

Parameters
handleMIOpen handle (input)
xDescTensor descriptor for data input tensor x (input)
xData tensor x (input)
wDescTensor descriptor for weight tensor w (input)
wWeights tensor w (input)
convDescConvolution layer descriptor (input)
yDescTensor descriptor for output data tensor y (input)
yData tensor y (output)
requestAlgoCountNumber of algorithms to return kernel times (input)
returnedAlgoCountPointer to number of algorithms returned (output)
perfResultsPointer to union of best algorithm for forward and backwards (input)
workSpacePointer to workspace required for the search (output)
workSpaceSizeSize in bytes of the memory needed for find (output)
exhaustiveSearchA boolean to toggle a full search of all algorithms and configurations (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenGetConvolutionAttribute()

miopenStatus_t miopenGetConvolutionAttribute ( miopenConvolutionDescriptor_t  convDesc,
const miopenConvolutionAttrib_t  attr,
int *  value 
)

Get the attribute of the convolution descriptor.

Parameters
convDescConvolution layer descriptor (input)
attrAttribute of this convolution to get (input)
valueValue of this attribute (output)
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenGetConvolutionDescriptor()

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.

For group/depthwise convolution dilation height and width, only a dilation value of 1 is supported.

Parameters
convDescConvolution layer descriptor (input)
c_modeConvolutional mode (output)
pad_hHeight input data padding (output)
pad_wWidth input data padding (output)
stride_hStride for the height of input data (output)
stride_wStride for the width of input data (output)
dilation_hDilation height (output)
dilation_wDilation width (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenGetConvolutionForwardOutputDim()

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.

This function returns the dimensions of the resulting 4D tensor of a 2D convolution, given the convolution descriptor, the input tensor descriptor and the filter descriptor. This function can help to setup the output tensor and allocate the proper amount of memory prior to launch the actual convolution.

Parameters
convDescConvolution layer descriptor (input)
inputTensorDescInput data tensor descriptor (input)
filterDescWeight descriptor (input)
nMini-batch size (output)
cNumber of channels (output)
hData height dimension size (output)
wData width dimension size (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenGetConvolutionGroupCount()

miopenStatus_t miopenGetConvolutionGroupCount ( miopenConvolutionDescriptor_t  convDesc,
int *  groupCount 
)

Get the number of groups to be used in Group/Depthwise convolution.

Parameters
convDescConvolution layer descriptor (input)
groupCountPointer to number of groups in group/depthwise convolution (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenGetConvolutionNdDescriptor()

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.

Parameters
convDescConvolution layer descriptor (input)
requestedSpatialDimExpected convolution spatial dimension (intput)
spatialDimConvolutional spatial dimension (output)
padAArray of input data padding (output)
strideAArray of convolution stride (output)
dilationAArray of convolution dilation (output)
c_modeConvolutional mode (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenGetConvolutionNdForwardOutputDim()

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.

This function returns the dimensions of the resulting N-dimensional tensor of a (N-2)-dimensional convolution, given the convolution descriptor, the input tensor descriptor and the filter descriptor. It is used to setup the output tensor descriptor prior to executing the convolution layer.

Parameters
convDescConvolution layer descriptor (input)
inputTensorDescInput data tensor descriptor (input)
filterDescWeight descriptor (input)
nDimPointer to Output data tensor dimension (output)
outputTensorDimAArray of Output data tensor length (output)
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenGetConvolutionSpatialDim()

miopenStatus_t miopenGetConvolutionSpatialDim ( miopenConvolutionDescriptor_t  convDesc,
int *  spatialDim 
)

Retrieves the spatial dimension of a convolution layer descriptor.

Parameters
convDescConvolution layer descriptor (input)
spatialDimSpatial dimension of convolution descriptor (output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenInitConvolutionDescriptor()

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.

For group/depthwise convolution dilation height and width, only a dilation value of 1 is supported.

Parameters
convDescConvolution layer descriptor (output)
c_modeConvolutional mode (input)
pad_hHeight input data padding (input)
pad_wWidth input data padding (input)
stride_hStride for the height of input data (input)
stride_wStride for the width of input data (input)
dilation_hDilation height (input)
dilation_wDilation width (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenInitConvolutionNdDescriptor()

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.

Parameters
convDescConvolution layer descriptor (output)
spatialDimConvolutional spatial dimension (input)
padAArray of input data padding (input)
strideAArray of convolution stride (input)
dilationAArray of convolution dilation (input)
c_modeConvolutional mode (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenSetConvolutionAttribute()

miopenStatus_t miopenSetConvolutionAttribute ( miopenConvolutionDescriptor_t  convDesc,
const miopenConvolutionAttrib_t  attr,
int  value 
)

Set the attribute of the convolution descriptor.

Parameters
convDescConvolution layer descriptor (input)
attrAttribute of this convolution to set (input)
valueValue of this attribute (input)
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenSetConvolutionGroupCount()

miopenStatus_t miopenSetConvolutionGroupCount ( miopenConvolutionDescriptor_t  convDesc,
int  groupCount 
)

Set the number of groups to be used in Group/Depthwise convolution.

Must be called before all computational APIs of group/depthwise convolution, it is preferable to call miopenInitConvolutionDescriptor() first, then miopenSetConvolutionGroupCount() to fully initialize group convolutions. Both Convolution Mode and Transpose Convolution Mode support group/depthwise convolution. To run depthwise convolution, set groupCount value equal to number of channels.

Parameters
convDescConvolution layer descriptor (output)
groupCountnumber of groups, in depthwise conv using filter_number/channel_multiplier (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenSetTransposeConvNdOutputPadding()

miopenStatus_t miopenSetTransposeConvNdOutputPadding ( miopenConvolutionDescriptor_t  convDesc,
int  spatialDim,
const int *  adjA 
)

Set the output padding to be used in N-dimensional Transpose convolution.

This function is optional for initialization of Transpose convolution. If applicable, it must be called before all computational APIs of Transpose convolution. It is preferable to call miopenInitConvolutionNdDescriptor() first, then miopenSetTransposeConvNdOutputPadding() to fully initialize transpose convolutions. Currently, 2-D and 3-D convolutions are supported.

Parameters
convDescConvolution layer descriptor (output)
spatialDimConvolutional spatial dimension (input)
adjAarray of output padding for output data (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.

◆ miopenSetTransposeConvOutputPadding()

miopenStatus_t miopenSetTransposeConvOutputPadding ( miopenConvolutionDescriptor_t  convDesc,
int  adj_h,
int  adj_w 
)

Set the output padding to be used in 2-D Transpose convolution.

This function is optional for initialization of Transpose convolution. If applicable, it must be called before all computational APIs of Transpose convolution. It is preferable to call miopenInitConvolutionDescriptor() first, then miopenSetTransposeConvOutputPadding() to fully initialize transpose convolutions.

Parameters
convDescConvolution layer descriptor (output)
adj_houtput padding for the height of output data (input)
adj_woutput padding for the width of output data (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.1.2/include/miopen/miopen.h.