This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

Reducecalculation

Reducecalculation#

MIOpen: Reducecalculation
Reducecalculation

Enumerations

enum  miopenReduceCalculationOp_t {
  MIOPEN_REDUCE_CALCULATION_PROD ,
  MIOPEN_REDUCE_CALCULATION_SUM
}
 

Functions

miopenStatus_t miopenGetReduceCalculationWorkspaceSize (miopenHandle_t handle, const miopenTensorDescriptor_t xDesc, const int32_t dim, const miopenReduceCalculationOp_t reduceCalculationOp, const miopenTensorDescriptor_t reduceDesc, size_t *sizeInBytes)
 Helper function to query the minimum workspace size required by the ReduceTensor call. More...
 
miopenStatus_t miopenReduceCalculationForward (miopenHandle_t handle, miopenReduceCalculationNanPropagation_t nanPropagation, void *workspace, size_t workspaceSizeInBytes, const miopenTensorDescriptor_t xDesc, const void *x, const int32_t dim, const miopenReduceCalculationOp_t reduceCalculationOp, const miopenTensorDescriptor_t reduceDesc, void *y)
 Execute a reducecalculation forward layer. More...
 

Detailed Description

Enumeration Type Documentation

◆ miopenReduceCalculationOp_t

Reduction Calculation operation types

Enumerator
MIOPEN_REDUCE_CALCULATION_PROD 

the operation is multiplying the values of the reduced elements

MIOPEN_REDUCE_CALCULATION_SUM 

the operation is adding the values of the reduced elements

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

Function Documentation

◆ miopenGetReduceCalculationWorkspaceSize()

miopenStatus_t miopenGetReduceCalculationWorkspaceSize ( miopenHandle_t  handle,
const miopenTensorDescriptor_t  xDesc,
const int32_t  dim,
const miopenReduceCalculationOp_t  reduceCalculationOp,
const miopenTensorDescriptor_t  reduceDesc,
size_t *  sizeInBytes 
)

Helper function to query the minimum workspace size required by the ReduceTensor call.

Parameters
[in]handleMIOpen Handle
[in]xDescTensor descriptor for data input tensor x
[in]dimDimension to calculation.
[in]yDescTensor descriptor for output data tensor y
[out]sizeInBytesPointer to data to return the minimum workspace size
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/develop/include/miopen/miopen.h.

◆ miopenReduceCalculationForward()

miopenStatus_t miopenReduceCalculationForward ( miopenHandle_t  handle,
miopenReduceCalculationNanPropagation_t  nanPropagation,
void *  workspace,
size_t  workspaceSizeInBytes,
const miopenTensorDescriptor_t  xDesc,
const void *  x,
const int32_t  dim,
const miopenReduceCalculationOp_t  reduceCalculationOp,
const miopenTensorDescriptor_t  reduceDesc,
void *  y 
)

Execute a reducecalculation forward layer.

Parameters
[in]handleMIOpen handle
[in]nanPropagationNan number propagation mode
[in]workspaceAddress of the allocated workspace data
[in]workspaceSizeInBytesSize in bytes of the allocated workspace data
[in]xDescTensor descriptor for data input tensor x
[in]xData tensor x
[in]dimDimension to calculation.
[in]yDescTensor descriptor for output data tensor y
[out]yData tensor y
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/develop/include/miopen/miopen.h.