/* automatically generated by rust-bindgen 0.71.1 */
pub const MIOPEN_BACKEND_OPENCL: u32 = 0;
pub const MIOPEN_BACKEND_HIP: u32 = 1;
pub const MIOPEN_MODE_NOGPU: u32 = 0;
pub const MIOPEN_USE_ROCBLAS: u32 = 1;
pub const MIOPEN_USE_HIPBLASLT: u32 = 1;
pub const MIOPEN_USE_ROCTRACER: u32 = 1;
pub const MIOPEN_BUILD_DEV: u32 = 0;
pub const MIOPEN_GPU_SYNC: u32 = 0;
pub const MIOPEN_ENABLE_SQLITE: u32 = 1;
pub const MIOPEN_ENABLE_SQLITE_KERN_CACHE: u32 = 1;
pub const MIOPEN_DEBUG_FIND_DB_CACHING: u32 = 1;
pub const MIOPEN_USE_COMGR: u32 = 1;
pub const MIOPEN_USE_HIPRTC: u32 = 1;
pub const MIOPEN_USE_HIP_KERNELS: u32 = 1;
pub const MIOPEN_DISABLE_USERDB: u32 = 0;
pub const MIOPEN_EMBED_DB: u32 = 0;
pub const MIOPEN_DISABLE_SYSDB: u32 = 0;
pub const MIOPEN_LOG_FUNC_TIME_ENABLE: u32 = 0;
pub const MIOPEN_ENABLE_SQLITE_BACKOFF: u32 = 1;
pub const MIOPEN_USE_MLIR: u32 = 0;
pub const MIOPEN_USE_COMPOSABLEKERNEL: u32 = 1;
pub const MIOPEN_BUILD_DRIVER: u32 = 1;
pub const MIOPEN_ENABLE_AI_IMMED_MODE_FALLBACK: u32 = 1;
pub const MIOPEN_ENABLE_AI_KERNEL_TUNING: u32 = 1;
pub const MIOPEN_HIP_COMPILER_HAS_OPTION_OFFLOAD_UNIFORM_BLOCK: u32 = 1;
pub const MIOPEN_ENABLE_FIN_INTERFACE: u32 = 0;
pub const MIOPEN_AMD_COMGR_VERSION_MAJOR: u32 = 3;
pub const MIOPEN_AMD_COMGR_VERSION_MINOR: u32 = 0;
pub const MIOPEN_AMD_COMGR_VERSION_PATCH: u32 = 0;
pub const MIOPEN_USE_RNE_BFLOAT16: u32 = 1;
pub const MIOPEN_FP8_IEEE_EXPONENT_BIAS: u32 = 0;
pub const MIOPEN_FP8_CLIPPING: u32 = 1;
pub const MIOPEN_OFFLINE_COMPILER_PATHS_V2: u32 = 0;
pub const MIOPEN_AMDGCN_ASSEMBLER: &[u8; 90] =
b"/home/runner/_work/rockrel/rockrel/output/build/compiler/amd-llvm/dist/lib/llvm/bin/clang\0";
pub const MIOPEN_HIP_COMPILER: &[u8; 83] =
b"/home/runner/_work/rockrel/rockrel/output/build/core/clr/dist/lib/llvm/bin/clang++\0";
pub const MIOPEN_OFFLOADBUNDLER_BIN : & [u8 ; 106] = b"/home/runner/_work/rockrel/rockrel/output/build/compiler/amd-llvm/dist/lib/llvm/bin/clang-offload-bundler\0" ;
pub const MIOPEN_CACHE_DIR: &[u8; 17] = b"~/.cache/miopen/\0";
pub const MIOPEN_USE_SQLITE_PERFDB: u32 = 0;
pub const MIOPEN_NDEBUG: u32 = 0;
pub const MIOPEN_ALLOC_BUFFERS: u32 = 0;
pub const MIOPEN_ROCBLAS_VERSION_MAJOR: u32 = 5;
pub const MIOPEN_ROCBLAS_VERSION_MINOR: u32 = 4;
pub const MIOPEN_ROCBLAS_VERSION_PATCH: u32 = 0;
pub const MIOPEN_ROCBLAS_VERSION_FLAT: u32 = 5004000;
pub const MIOPEN_HIPBLASLT_VERSION_MAJOR: u32 = 1;
pub const MIOPEN_HIPBLASLT_VERSION_MINOR: u32 = 3;
pub const MIOPEN_HIPBLASLT_VERSION_PATCH: u32 = 0;
pub const MIOPEN_HIPBLASLT_VERSION_FLAT: u32 = 1003000;
pub const MIOPEN_GOLDEN_DB_VERSION: u32 = 21;
pub const MIOPEN_API_VERSION_REDUCE_TENSOR: u32 = 1;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ihipStream_t {
_unused: [u8; 0],
}
pub type hipStream_t = *mut ihipStream_t;
pub type miopenAcceleratorQueue_t = hipStream_t;
#[doc = " @ingroup handle\n @brief Creates the miopenHandle_t type"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenHandle {
pub _address: u8,
}
#[doc = " @ingroup handle\n @brief Creates the miopenHandle_t type"]
pub type miopenHandle_t = *mut miopenHandle;
#[doc = "< No errors"]
pub const miopenStatus_t_miopenStatusSuccess: miopenStatus_t = 0;
#[doc = "< Data not initialized."]
pub const miopenStatus_t_miopenStatusNotInitialized: miopenStatus_t = 1;
#[doc = "< Incorrect variable value."]
pub const miopenStatus_t_miopenStatusInvalidValue: miopenStatus_t = 2;
#[doc = "< Incorrect parameter detected."]
pub const miopenStatus_t_miopenStatusBadParm: miopenStatus_t = 3;
#[doc = "< Memory allocation error."]
pub const miopenStatus_t_miopenStatusAllocFailed: miopenStatus_t = 4;
#[doc = "< MIOpen failure."]
pub const miopenStatus_t_miopenStatusInternalError: miopenStatus_t = 5;
#[doc = "< Use of unimplemented feature."]
pub const miopenStatus_t_miopenStatusNotImplemented: miopenStatus_t = 6;
#[doc = "< Unknown error occurred."]
pub const miopenStatus_t_miopenStatusUnknownError: miopenStatus_t = 7;
#[doc = "< Unsupported operator for fusion."]
pub const miopenStatus_t_miopenStatusUnsupportedOp: miopenStatus_t = 8;
#[doc = "< This is not an error."]
pub const miopenStatus_t_miopenStatusGpuOperationsSkipped: miopenStatus_t = 9;
#[doc = "< Version mismatch of the supplied binary data argment."]
pub const miopenStatus_t_miopenStatusVersionMismatch: miopenStatus_t = 10;
#[doc = " @enum miopenStatus_t\n Error codes that are returned by all MIOpen API calls."]
pub type miopenStatus_t = ::std::os::raw::c_uint;
#[doc = "< Use TF32 if possible"]
pub const miopenMathType_t_miopenMathDefault: miopenMathType_t = 0;
pub const miopenMathType_t_miopenMathPedantic: miopenMathType_t = 1;
pub type miopenMathType_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Get character string for an error code.\n\n A function which returns a NULL terminated character string of the error code.\n\n @param error miopenStatus_t type error status (input)\n @return errorString"]
pub fn miopenGetErrorString(error: miopenStatus_t) -> *const ::std::os::raw::c_char;
}
#[doc = " @brief Custom allocator function\n\n This function allow for user-defined custom allocator\n\n @param context A pointer a context (input)\n @param sizeBytes Number of bytes to allocate (input)\n"]
pub type miopenAllocatorFunction = ::std::option::Option<
unsafe extern "C" fn(
context: *mut ::std::os::raw::c_void,
sizeBytes: usize,
) -> *mut ::std::os::raw::c_void,
>;
#[doc = " @brief Custom deallocator function\n\n This function allow for user-defined custom deallocation function\n\n @param context A pointer context (input)\n @param memory A pointer allocated memory (input)\n"]
pub type miopenDeallocatorFunction = ::std::option::Option<
unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, memory: *mut ::std::os::raw::c_void),
>;
unsafe extern "C" {
#[doc = " @brief Method to return version of MIOpen\n\n The output values of this call follow from the versioning\n format major.minor.patch\n\n Pointers that are NULL will be ignored.\n\n @param major Major version number (output)\n @param minor Minor version number (output)\n @param patch Patch version number (output)\n\n @return miopenStatus_t"]
pub fn miopenGetVersion(
major: *mut usize,
minor: *mut usize,
patch: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Method to create the MIOpen handle object.\n\n This function creates a MIOpen handle. This is called at the very start to initialize the MIOpen\n environment.\n @param handle A pointer to a MIOpen handle type (output)\n\n @return miopenStatus_t"]
pub fn miopenCreate(handle: *mut miopenHandle_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Create a MIOpen handle with an accelerator stream.\n\n The HIP side uses a hipStream_t type for the stream, while OpenCL will use a\n cl_command_queue.\n\n Create a handle with a previously created accelerator command queue.\n @param handle A pointer to a MIOpen handle type (output)\n @param stream An accelerator queue type (input)\n\n @return miopenStatus_t"]
pub fn miopenCreateWithStream(
handle: *mut miopenHandle_t,
stream: miopenAcceleratorQueue_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the MIOpen handle.\n\n This is called when breaking down the MIOpen environment.\n @param handle MIOpen handle (input)\n @return miopenStatus_t"]
pub fn miopenDestroy(handle: miopenHandle_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set accelerator command queue previously created\n\n Set a command queue for an accelerator device\n @param handle MIOpen handle (input)\n @param streamID An accelerator queue type (input)\n @return miopenStatus_t"]
pub fn miopenSetStream(
handle: miopenHandle_t,
streamID: miopenAcceleratorQueue_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the previously created accelerator command queue\n\n Creates a command queue for an accelerator device\n @param handle MIOpen handle (input)\n @param streamID Pointer to a accelerator queue type (output)\n @return miopenStatus_t"]
pub fn miopenGetStream(
handle: miopenHandle_t,
streamID: *mut miopenAcceleratorQueue_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set allocator for previously created miopenHandle\n\n Set a command queue for an accelerator device\n @param handle MIOpen handle\n @param allocator A callback function MIOpen will use for internal memory allocations.\n The provided callback function should allocate device memory with requested size\n and return a pointer to this memory.\n Passing 0 will restore the default MIOpen allocator and deallocator.\n @param deallocator A callback function MIOpen will use to for internal memory deallocation.\n The provided callback function should free the specified memory pointer\n @param allocatorContext User-specified pointer which is passed to \\p allocator and \\p\n deallocator\n This allows the callback function to access state set by the caller to this function,\n for example a stateful heap allocator or a c++ class.\n @return miopenStatus_t"]
pub fn miopenSetAllocator(
handle: miopenHandle_t,
allocator: miopenAllocatorFunction,
deallocator: miopenDeallocatorFunction,
allocatorContext: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get time for last kernel launched\n\n This function is used only when profiling mode has been enabled.\n Kernel timings are based on the MIOpen handle and is not thread-safe.\n In order to use multi-threaded profiling, create an MIOpen handle for each\n concurrent thread.\n\n @param handle MIOpen handle (input)\n @param time Pointer to a float type to contain kernel time in milliseconds (output)\n @return miopenStatus_t"]
pub fn miopenGetKernelTime(handle: miopenHandle_t, time: *mut f32) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Enable profiling to retrieve kernel time\n\n Enable or disable kernel profiling. This profiling is only for kernel time.\n @param handle MIOpen handle (input)\n @param enable Boolean to toggle profiling (input)\n @return miopenStatus_t"]
pub fn miopenEnableProfiling(handle: miopenHandle_t, enable: bool) -> miopenStatus_t;
}
#[doc = " @ingroup fusion\n @brief Creates the miopenFusionOpDescriptor_t type\n\n Fusion Operator Descriptor contains the meta-data associated with an operator\n to be fused in a compute graph\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenFusionOpDescriptor {
pub _address: u8,
}
#[doc = " @ingroup fusion\n @brief Creates the miopenFusionOpDescriptor_t type\n\n Fusion Operator Descriptor contains the meta-data associated with an operator\n to be fused in a compute graph\n"]
pub type miopenFusionOpDescriptor_t = *mut miopenFusionOpDescriptor;
#[doc = " @ingroup tensor\n @brief Creates the miopenTensorDescriptor_t type\n\n Tensor descriptor is an object that allows the user to specify a layer's size for each\n dimension and dimension strides.\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenTensorDescriptor {
pub _address: u8,
}
#[doc = " @ingroup tensor\n @brief Creates the miopenTensorDescriptor_t type\n\n Tensor descriptor is an object that allows the user to specify a layer's size for each\n dimension and dimension strides.\n"]
pub type miopenTensorDescriptor_t = *mut miopenTensorDescriptor;
#[doc = " @ingroup tensor\n @brief Creates the miopenSeqTensorDescriptor_t type\n\n SeqTensor descriptor is an object that allows the user to specify tensor with sequence dimension.\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenSeqTensorDescriptor {
pub _address: u8,
}
#[doc = " @ingroup tensor\n @brief Creates the miopenSeqTensorDescriptor_t type\n\n SeqTensor descriptor is an object that allows the user to specify tensor with sequence dimension.\n"]
pub type miopenSeqTensorDescriptor_t = *mut miopenSeqTensorDescriptor;
#[doc = " @ingroup convolutions\n @brief Creates the miopenConvolutionDescriptor_t type\n\n Convolution descriptor is an object that allows the user to specify a layer's padding, stride,\n and dilation of the convolutional filter. Parameters must all be non-negative.\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenConvolutionDescriptor {
pub _address: u8,
}
#[doc = " @ingroup convolutions\n @brief Creates the miopenConvolutionDescriptor_t type\n\n Convolution descriptor is an object that allows the user to specify a layer's padding, stride,\n and dilation of the convolutional filter. Parameters must all be non-negative.\n"]
pub type miopenConvolutionDescriptor_t = *mut miopenConvolutionDescriptor;
#[doc = " @ingroup pooling\n @brief Creates the miopenPoolingDescriptor_t type\n\n Pooling descriptor is an object that allows the user to specify the dimension sizes of the\n pooling windows, paddings, strides, and pooling mode.\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenPoolingDescriptor {
pub _address: u8,
}
#[doc = " @ingroup pooling\n @brief Creates the miopenPoolingDescriptor_t type\n\n Pooling descriptor is an object that allows the user to specify the dimension sizes of the\n pooling windows, paddings, strides, and pooling mode.\n"]
pub type miopenPoolingDescriptor_t = *mut miopenPoolingDescriptor;
#[doc = " @ingroup LRN\n @brief Creates the miopenLRNDescriptor_t type\n\n LRN descriptor is an object that allows the user to specify the LRN mode, the number of elements\n in the normalization window, and the LRN k-parameter.\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenLRNDescriptor {
pub _address: u8,
}
#[doc = " @ingroup LRN\n @brief Creates the miopenLRNDescriptor_t type\n\n LRN descriptor is an object that allows the user to specify the LRN mode, the number of elements\n in the normalization window, and the LRN k-parameter.\n"]
pub type miopenLRNDescriptor_t = *mut miopenLRNDescriptor;
#[doc = " @ingroup activation\n @brief Creates the miopenActivationDescriptor_t type\n\n Activation descriptor is an object that allows the user to specify the activation mode.\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenActivationDescriptor {
pub _address: u8,
}
#[doc = " @ingroup activation\n @brief Creates the miopenActivationDescriptor_t type\n\n Activation descriptor is an object that allows the user to specify the activation mode.\n"]
pub type miopenActivationDescriptor_t = *mut miopenActivationDescriptor;
#[doc = " @ingroup RNN\n @brief Creates the miopenRNNDescriptor_t type"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenRNNDescriptor {
pub _address: u8,
}
#[doc = " @ingroup RNN\n @brief Creates the miopenRNNDescriptor_t type"]
pub type miopenRNNDescriptor_t = *mut miopenRNNDescriptor;
#[doc = " @ingroup LossFunction\n @brief Creates the miopenCTCLossDescriptor_t type"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenCTCLossDescriptor {
pub _address: u8,
}
#[doc = " @ingroup LossFunction\n @brief Creates the miopenCTCLossDescriptor_t type"]
pub type miopenCTCLossDescriptor_t = *mut miopenCTCLossDescriptor;
#[doc = " @ingroup Dropout\n @brief Creates the miopenDropoutDescriptor_t type"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenDropoutDescriptor {
pub _address: u8,
}
#[doc = " @ingroup Dropout\n @brief Creates the miopenDropoutDescriptor_t type"]
pub type miopenDropoutDescriptor_t = *mut miopenDropoutDescriptor;
#[doc = " @ingroup TensorReduce\n @brief Creates the miopenReduceTensorDescriptor_t type"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenReduceTensorDescriptor {
pub _address: u8,
}
#[doc = " @ingroup TensorReduce\n @brief Creates the miopenReduceTensorDescriptor_t type"]
pub type miopenReduceTensorDescriptor_t = *mut miopenReduceTensorDescriptor;
#[doc = " @ingroup mha\n @brief Creates the miopenMhaDescriptor_t type"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenMhaDescriptor {
pub _address: u8,
}
#[doc = " @ingroup mha\n @brief Creates the miopenMhaDescriptor_t type"]
pub type miopenMhaDescriptor_t = *mut miopenMhaDescriptor;
#[doc = " @ingroup softmax\n @brief Creates the miopenSoftmaxDescriptor_t type"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenSoftmaxDescriptor {
pub _address: u8,
}
#[doc = " @ingroup softmax\n @brief Creates the miopenSoftmaxDescriptor_t type"]
pub type miopenSoftmaxDescriptor_t = *mut miopenSoftmaxDescriptor;
#[doc = "< 16-bit floating point (Fully supported)"]
pub const miopenDataType_t_miopenHalf: miopenDataType_t = 0;
#[doc = "< 32-bit floating point (Fully supported)"]
pub const miopenDataType_t_miopenFloat: miopenDataType_t = 1;
#[doc = "< 32-bit integer (Partially supported)"]
pub const miopenDataType_t_miopenInt32: miopenDataType_t = 2;
#[doc = "< 8-bit integer (Partially supported)"]
pub const miopenDataType_t_miopenInt8: miopenDataType_t = 3;
#[doc = "< 16-bit binary floating point (8-bit exponent, 7-bit fraction)\n(Partially supported)"]
pub const miopenDataType_t_miopenBFloat16: miopenDataType_t = 5;
#[doc = "< 64-bit floating point (Partially supported)"]
pub const miopenDataType_t_miopenDouble: miopenDataType_t = 6;
pub const miopenDataType_t_miopenFloat8_fnuz: miopenDataType_t = 7;
pub const miopenDataType_t_miopenBFloat8_fnuz: miopenDataType_t = 8;
pub const miopenDataType_t_miopenInt64: miopenDataType_t = 9;
#[doc = " @ingroup tensor\n @enum miopenDataType_t\n MIOpen floating point datatypes. Both 32-bit and 16-bit floats are supported in MIOpen."]
pub type miopenDataType_t = ::std::os::raw::c_uint;
#[doc = "< NCHW memory layout (Fully supported)"]
pub const miopenTensorLayout_t_miopenTensorNCHW: miopenTensorLayout_t = 0;
#[doc = "< NHWC memory layout (Fully supported)"]
pub const miopenTensorLayout_t_miopenTensorNHWC: miopenTensorLayout_t = 1;
#[doc = "< CHWN memory layout (Not supported)"]
pub const miopenTensorLayout_t_miopenTensorCHWN: miopenTensorLayout_t = 2;
#[doc = "< NCHWc4 memory layout (Partially supported)"]
pub const miopenTensorLayout_t_miopenTensorNCHWc4: miopenTensorLayout_t = 3;
#[doc = "< NCHWc8 memory layout (Partially supported)"]
pub const miopenTensorLayout_t_miopenTensorNCHWc8: miopenTensorLayout_t = 4;
#[doc = "< CHWNc4 memory layout (Partially supported)"]
pub const miopenTensorLayout_t_miopenTensorCHWNc4: miopenTensorLayout_t = 5;
#[doc = "< CHWNc8 memory layout (Partially supported)"]
pub const miopenTensorLayout_t_miopenTensorCHWNc8: miopenTensorLayout_t = 6;
#[doc = "< NCDHW memory layout (Fully supported)"]
pub const miopenTensorLayout_t_miopenTensorNCDHW: miopenTensorLayout_t = 7;
#[doc = "< NCDHW memory layout (Fully supported)"]
pub const miopenTensorLayout_t_miopenTensorNDHWC: miopenTensorLayout_t = 8;
#[doc = " @ingroup tensor\n @enum miopenTensorLayout_t\n Tensor layouts supported by MIOpen.\n miopenTensorCHWNc4 and miopenTensorCHWNc8 layout only support weight tensor."]
pub type miopenTensorLayout_t = ::std::os::raw::c_uint;
#[doc = "< 8-bit unsigned"]
pub const miopenIndexType_t_miopenIndexUint8: miopenIndexType_t = 0;
#[doc = "< 16-bit unsigned"]
pub const miopenIndexType_t_miopenIndexUint16: miopenIndexType_t = 1;
#[doc = "< 32-bit unsigned"]
pub const miopenIndexType_t_miopenIndexUint32: miopenIndexType_t = 2;
#[doc = "< 64-bit unsigned"]
pub const miopenIndexType_t_miopenIndexUint64: miopenIndexType_t = 3;
#[doc = " @ingroup pooling\n @enum miopenIndexType_t\n MIOpen index datatypes."]
pub type miopenIndexType_t = ::std::os::raw::c_uint;
#[doc = "< Add tensors element-wise"]
pub const miopenTensorOp_t_miopenTensorOpAdd: miopenTensorOp_t = 0;
#[doc = "< Multiply two tensors element-wise"]
pub const miopenTensorOp_t_miopenTensorOpMul: miopenTensorOp_t = 1;
#[doc = "< Minimum of tensor element pairs"]
pub const miopenTensorOp_t_miopenTensorOpMin: miopenTensorOp_t = 2;
#[doc = "< Maximum of tensor element pairs"]
pub const miopenTensorOp_t_miopenTensorOpMax: miopenTensorOp_t = 3;
#[doc = " @ingroup tensor\n @enum miopenTensorOp_t\n Element-wise tensor operation modes"]
pub type miopenTensorOp_t = ::std::os::raw::c_uint;
#[doc = "< Cross-Correlation convolution"]
pub const miopenConvolutionMode_t_miopenConvolution: miopenConvolutionMode_t = 0;
#[doc = "< Transpose convolutions -- deconvolution"]
pub const miopenConvolutionMode_t_miopenTranspose: miopenConvolutionMode_t = 1;
#[doc = "< Deprecated Group convolution legacy, ToBe Removed"]
pub const miopenConvolutionMode_t_miopenGroupConv: miopenConvolutionMode_t = 2;
#[doc = "< Deprecated Depthwise convolution legacy, ToBe Removed"]
pub const miopenConvolutionMode_t_miopenDepthwise: miopenConvolutionMode_t = 3;
#[doc = " @ingroup convolutions\n @enum miopenConvolutionMode_t\n Convolution mode selection for convolution layer preference."]
pub type miopenConvolutionMode_t = ::std::os::raw::c_uint;
#[doc = "< MIOPEN Default Padding"]
pub const miopenPaddingMode_t_miopenPaddingDefault: miopenPaddingMode_t = 0;
#[doc = "< Tensorflow SAME Padding"]
pub const miopenPaddingMode_t_miopenPaddingSame: miopenPaddingMode_t = 1;
#[doc = "< Tensorflow VALID Padding"]
pub const miopenPaddingMode_t_miopenPaddingValid: miopenPaddingMode_t = 2;
#[doc = " @ingroup padding\n @enum miopenPaddingMode_t\n Padding mode selection for convolution/Pooling layer preference"]
pub type miopenPaddingMode_t = ::std::os::raw::c_uint;
#[doc = "< Maximum pooling"]
pub const miopenPoolingMode_t_miopenPoolingMax: miopenPoolingMode_t = 0;
#[doc = "< Average pooling"]
pub const miopenPoolingMode_t_miopenPoolingAverage: miopenPoolingMode_t = 1;
#[doc = "< Inclusive Average pooling"]
pub const miopenPoolingMode_t_miopenPoolingAverageInclusive: miopenPoolingMode_t = 2;
#[doc = " @ingroup pooling\n @enum miopenPoolingMode_t\n Pooling layer mode"]
pub type miopenPoolingMode_t = ::std::os::raw::c_uint;
#[doc = "< Use mask indices, 2D pooling only"]
pub const miopenPoolingWorkspaceIndexMode_t_miopenPoolingWorkspaceIndexMask:
miopenPoolingWorkspaceIndexMode_t = 0;
#[doc = "< Use image indices"]
pub const miopenPoolingWorkspaceIndexMode_t_miopenPoolingWorkspaceIndexImage:
miopenPoolingWorkspaceIndexMode_t = 1;
#[doc = " @ingroup pooling\n @enum miopenPoolingWorkspaceIndexMode_t\n Pooling layer workspace index mode. miopenPoolingWorkspaceIndexMask mode records indices\n indicating the max values' positions in the filter/mask. miopenPoolingWorkspaceIndexImage mode\n records indices indicating the max values' positions in the image."]
pub type miopenPoolingWorkspaceIndexMode_t = ::std::os::raw::c_uint;
#[doc = "< Channel independent"]
pub const miopenLRNMode_t_miopenLRNWithinChannel: miopenLRNMode_t = 0;
#[doc = "< Cross Channel"]
pub const miopenLRNMode_t_miopenLRNCrossChannel: miopenLRNMode_t = 1;
#[doc = " @ingroup LRN\n @enum miopenLRNMode_t\n Local Response Normalization layer mode"]
pub type miopenLRNMode_t = ::std::os::raw::c_uint;
#[doc = "< Element-wise normalization for fully connected layer"]
pub const miopenBatchNormMode_t_miopenBNPerActivation: miopenBatchNormMode_t = 0;
#[doc = "< Mini-batch spatial normalization for convolutional layers"]
pub const miopenBatchNormMode_t_miopenBNSpatial: miopenBatchNormMode_t = 1;
#[doc = " @ingroup batchnorm\n @enum miopenBatchNormMode_t\n Batch Normalization layer mode"]
pub type miopenBatchNormMode_t = ::std::os::raw::c_uint;
#[doc = "< No activation, pass through the data"]
pub const miopenActivationMode_t_miopenActivationPASTHRU: miopenActivationMode_t = 0;
#[doc = "< Sigmoid function: \\f$1 / (1 + e^{-x})\\f$"]
pub const miopenActivationMode_t_miopenActivationLOGISTIC: miopenActivationMode_t = 1;
#[doc = "< Tanh activation \\f$ \\beta * tanh( \\alpha * x) \\f$"]
pub const miopenActivationMode_t_miopenActivationTANH: miopenActivationMode_t = 2;
#[doc = "< Rectified Linear Unit \\f$ max(0, x) \\f$"]
pub const miopenActivationMode_t_miopenActivationRELU: miopenActivationMode_t = 3;
#[doc = "< \\f$log(1 + e^x)\\f$"]
pub const miopenActivationMode_t_miopenActivationSOFTRELU: miopenActivationMode_t = 4;
#[doc = "< Absolute value \\f$abs(x)\\f$"]
pub const miopenActivationMode_t_miopenActivationABS: miopenActivationMode_t = 5;
#[doc = "< Scaled and shifted power \\f$(\\alpha + \\beta * x)^{gamma}\\f$"]
pub const miopenActivationMode_t_miopenActivationPOWER: miopenActivationMode_t = 6;
pub const miopenActivationMode_t_miopenActivationCLIPPEDRELU: miopenActivationMode_t = 7;
pub const miopenActivationMode_t_miopenActivationLEAKYRELU: miopenActivationMode_t = 8;
pub const miopenActivationMode_t_miopenActivationELU: miopenActivationMode_t = 9;
#[doc = "< Clamp \\f$ max(\\alpha, min(\\beta, x)) \\f$"]
pub const miopenActivationMode_t_miopenActivationCLAMP: miopenActivationMode_t = 10;
#[doc = " @ingroup activation\n @enum miopenActivationMode_t\n Activation layer modes"]
pub type miopenActivationMode_t = ::std::os::raw::c_uint;
#[doc = "< straightforward softmax"]
pub const miopenSoftmaxAlgorithm_t_MIOPEN_SOFTMAX_FAST: miopenSoftmaxAlgorithm_t = 0;
#[doc = "< scaled softmax by maximum value in input domain"]
pub const miopenSoftmaxAlgorithm_t_MIOPEN_SOFTMAX_ACCURATE: miopenSoftmaxAlgorithm_t = 1;
#[doc = "< log softmax"]
pub const miopenSoftmaxAlgorithm_t_MIOPEN_SOFTMAX_LOG: miopenSoftmaxAlgorithm_t = 2;
#[doc = " @ingroup softmax\n @enum miopenSoftmaxAlgorithm_t\n Softmax implementation algorithms"]
pub type miopenSoftmaxAlgorithm_t = ::std::os::raw::c_uint;
#[doc = "< compute per image (N) across C, H, W"]
pub const miopenSoftmaxMode_t_MIOPEN_SOFTMAX_MODE_INSTANCE: miopenSoftmaxMode_t = 0;
pub const miopenSoftmaxMode_t_MIOPEN_SOFTMAX_MODE_CHANNEL: miopenSoftmaxMode_t = 1;
#[doc = " @ingroup softmax\n @enum miopenSoftmaxMode_t\n Softmax modes"]
pub type miopenSoftmaxMode_t = ::std::os::raw::c_uint;
#[doc = "< the operation is adding the values of the reduced elements"]
pub const miopenReduceTensorOp_t_MIOPEN_REDUCE_TENSOR_ADD: miopenReduceTensorOp_t = 0;
pub const miopenReduceTensorOp_t_MIOPEN_REDUCE_TENSOR_MUL: miopenReduceTensorOp_t = 1;
pub const miopenReduceTensorOp_t_MIOPEN_REDUCE_TENSOR_MIN: miopenReduceTensorOp_t = 2;
pub const miopenReduceTensorOp_t_MIOPEN_REDUCE_TENSOR_MAX: miopenReduceTensorOp_t = 3;
pub const miopenReduceTensorOp_t_MIOPEN_REDUCE_TENSOR_AMAX: miopenReduceTensorOp_t = 4;
pub const miopenReduceTensorOp_t_MIOPEN_REDUCE_TENSOR_AVG: miopenReduceTensorOp_t = 5;
pub const miopenReduceTensorOp_t_MIOPEN_REDUCE_TENSOR_NORM1: miopenReduceTensorOp_t = 6;
#[doc = "< the operation is getting the square root of the sum of\nsquares of the reduced elements"]
pub const miopenReduceTensorOp_t_MIOPEN_REDUCE_TENSOR_NORM2: miopenReduceTensorOp_t = 7;
#[doc = " @ingroup TensorReduce\n @enum miopenReduceTensorOp_t\n Tensor Reduction operation types"]
pub type miopenReduceTensorOp_t = ::std::os::raw::c_uint;
#[doc = "< does not propagate NaN number"]
pub const miopenNanPropagation_t_MIOPEN_NOT_PROPAGATE_NAN: miopenNanPropagation_t = 0;
#[doc = "< propagate the NaN number by the Reduction operation"]
pub const miopenNanPropagation_t_MIOPEN_PROPAGATE_NAN: miopenNanPropagation_t = 1;
#[doc = " @ingroup TensorReduce\n @enum miopenReduceTensorOp_t\n Nan numbers propagation modes"]
pub type miopenNanPropagation_t = ::std::os::raw::c_uint;
#[doc = "< Does not compuate indices"]
pub const miopenReduceTensorIndices_t_MIOPEN_REDUCE_TENSOR_NO_INDICES: miopenReduceTensorIndices_t =
0;
#[doc = "< Compute the relative, flatted indices"]
pub const miopenReduceTensorIndices_t_MIOPEN_REDUCE_TENSOR_FLATTENED_INDICES:
miopenReduceTensorIndices_t = 1;
#[doc = " @ingroup TensorReduce\n @enum miopenReduceTensorIndices_t\n Reduction Indices computation modes"]
pub type miopenReduceTensorIndices_t = ::std::os::raw::c_uint;
#[doc = "< 32-bit unsigned integer indices"]
pub const miopenIndicesType_t_MIOPEN_32BIT_INDICES: miopenIndicesType_t = 0;
#[doc = "< 64-bit unsigned integer indices"]
pub const miopenIndicesType_t_MIOPEN_64BIT_INDICES: miopenIndicesType_t = 1;
#[doc = "< 16-bit unsigned integer indices"]
pub const miopenIndicesType_t_MIOPEN_16BIT_INDICES: miopenIndicesType_t = 2;
#[doc = "< 8-bit unsigned integer indices"]
pub const miopenIndicesType_t_MIOPEN_8BIT_INDICES: miopenIndicesType_t = 3;
#[doc = " @ingroup TensorReduce\n @enum miopenIndicesType_t\n Reduction Indices types"]
pub type miopenIndicesType_t = ::std::os::raw::c_uint;
pub const miopenConvolutionAttrib_t_MIOPEN_CONVOLUTION_ATTRIB_FP16_ALT_IMPL:
miopenConvolutionAttrib_t = 0;
pub const miopenConvolutionAttrib_t_MIOPEN_CONVOLUTION_ATTRIB_DETERMINISTIC:
miopenConvolutionAttrib_t = 1;
pub const miopenConvolutionAttrib_t_MIOPEN_CONVOLUTION_ATTRIB_MATH_TYPE: miopenConvolutionAttrib_t =
3;
#[doc = " @ingroup convolutions\n @enum miopenConvolutionAttrib_t\n Attribute for convolution descriptor, used for alternating the convolution behavior"]
pub type miopenConvolutionAttrib_t = ::std::os::raw::c_uint;
pub const miopenConvolutionFindMode_t_miopenConvolutionFindModeNormal: miopenConvolutionFindMode_t =
1;
pub const miopenConvolutionFindMode_t_miopenConvolutionFindModeFast: miopenConvolutionFindMode_t =
2;
pub const miopenConvolutionFindMode_t_miopenConvolutionFindModeHybrid: miopenConvolutionFindMode_t =
3;
pub const miopenConvolutionFindMode_t_miopenConvolutionFindModeDynamicHybrid:
miopenConvolutionFindMode_t = 5;
pub const miopenConvolutionFindMode_t_miopenConvolutionFindModeTrustVerify:
miopenConvolutionFindMode_t = 6;
pub const miopenConvolutionFindMode_t_miopenConvolutionFindModeTrustVerifyFull:
miopenConvolutionFindMode_t = 7;
pub const miopenConvolutionFindMode_t_miopenConvolutionFindModeDefault:
miopenConvolutionFindMode_t = 5;
#[doc = " @ingroup convolutions\n @enum miopenConvolutionFindMode_t\n Findmode for convolution descriptor, used for changing the find behavior when calling\n miopenFindConvolutionForwardAlgorithm(), miopenFindConvolutionBackwardDataAlgorithm(), or\n miopenFindConvolutionBackwardWeightsAlgorithm()."]
pub type miopenConvolutionFindMode_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Create a Tensor Descriptor\n\n API for creating an uninitialized tensor descriptor.\n @param tensorDesc Pointer to a tensor descriptor type (output)\n @return miopenStatus_t"]
pub fn miopenCreateTensorDescriptor(
tensorDesc: *mut miopenTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set shape of 4D tensor\n\n Interface for setting 4-D tensor shape. MIOpen currently implements NCHW and NHWC layout.\n\n @param tensorDesc Tensor descriptor (input/output)\n @param dataType MIOpen datatype (input)\n @param n Mini-batch size (input)\n @param c Number of channels (input)\n @param h Data height dimension size (input)\n @param w Data width dimension size (input)\n @return miopenStatus_t"]
pub fn miopenSet4dTensorDescriptor(
tensorDesc: miopenTensorDescriptor_t,
dataType: miopenDataType_t,
n: ::std::os::raw::c_int,
c: ::std::os::raw::c_int,
h: ::std::os::raw::c_int,
w: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set shape of ND tensor with specific layout\n\n Interface for setting N-D packed tensor shape. This interface support NHWC, NCHW, NCHWc*, CHWNc*\n @param tensorDesc Tensor descriptor (input/output)\n @param dataType MIOpen datatype (input)\n @param tensorLayout Tensor layout (input)\n @param lens Tensor dimensions (input)\n @param num_lens Tensor dimension size (input)\n @return miopenStatus_t"]
pub fn miopenSetNdTensorDescriptorWithLayout(
tensorDesc: miopenTensorDescriptor_t,
dataType: miopenDataType_t,
tensorLayout: miopenTensorLayout_t,
lens: *const ::std::os::raw::c_int,
num_lens: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set shape and stride of 4D tensor\n\n Interface for setting 4-D tensor shape and stride. It allows to create the non-packed tensor.\n A non-packed tensor refers to the tensor where the elements are not compressed or packed in any\n specific way. Each element in the tensor is stored individually, and there is no special\n compression applied to the storage.\n\n @param tensorDesc Tensor descriptor (input/output)\n @param dataType MIOpen datatype (input)\n @param n Mini-batch size (input)\n @param c Number of channels (input)\n @param h Data height dimension size (input)\n @param w Data width dimension size (input)\n @param nStride Mini-batch dimension stride (input)\n @param cStride Channel dimension stride (input)\n @param hStride Height dimension stride (input)\n @param wStride Width dimension stride (input)\n @return miopenStatus_t"]
pub fn miopenSet4dTensorDescriptorEx(
tensorDesc: miopenTensorDescriptor_t,
dataType: miopenDataType_t,
n: ::std::os::raw::c_int,
c: ::std::os::raw::c_int,
h: ::std::os::raw::c_int,
w: ::std::os::raw::c_int,
nStride: ::std::os::raw::c_int,
cStride: ::std::os::raw::c_int,
hStride: ::std::os::raw::c_int,
wStride: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the details of the tensor descriptor\n\n Interface to query the 4-D tensor shape.\n\n @param tensorDesc Tensor descriptor (input)\n @param dataType MIOpen datatype (output)\n @param n Mini-batch size (output)\n @param c Number of channels (output)\n @param h Data height dimension size (output)\n @param w Data width dimension size (output)\n @param nStride Mini-batch dimension stride (output)\n @param cStride Channel dimension stride (output)\n @param hStride Height dimension stride (output)\n @param wStride Width dimension stride (output)\n @return miopenStatus_t"]
pub fn miopenGet4dTensorDescriptor(
tensorDesc: miopenTensorDescriptor_t,
dataType: *mut miopenDataType_t,
n: *mut ::std::os::raw::c_int,
c: *mut ::std::os::raw::c_int,
h: *mut ::std::os::raw::c_int,
w: *mut ::std::os::raw::c_int,
nStride: *mut ::std::os::raw::c_int,
cStride: *mut ::std::os::raw::c_int,
hStride: *mut ::std::os::raw::c_int,
wStride: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set shape of N-dimensional tensor\n\n Interface for setting non-packed tensor shape.\n @param tensorDesc Tensor descriptor (input/output)\n @param dataType MIOpen datatype (input)\n @param nbDims Number of dimensions in the dimsA array (input)\n @param dimsA Array containing the size of dimensions (input)\n @param stridesA Array containing the size of stride (input)\n @return miopenStatus_t"]
pub fn miopenSetTensorDescriptor(
tensorDesc: miopenTensorDescriptor_t,
dataType: miopenDataType_t,
nbDims: ::std::os::raw::c_int,
dimsA: *const ::std::os::raw::c_int,
stridesA: *const ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set shape of N-dimensional tensor\n\n Interface for querying tensor size. MIOpen has support for 1, 2, 3, 4, 5 dimensional tensor of\n layout.\n @param tensorDesc Tensor descriptor (input)\n @param size number of elements in tensor described by the descriptor (output)\n @return miopenStatus_t"]
pub fn miopenGetTensorDescriptorSize(
tensorDesc: miopenTensorDescriptor_t,
size: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the details of the N-dimensional tensor descriptor.\n\n @param tensorDesc Tensor descriptor (input)\n @param dataType MIOpen datatype (output)\n @param dimsA Array containing the size of dimensions (output)\n @param stridesA Array containing the size of stride (output)\n @return miopenStatus_t"]
pub fn miopenGetTensorDescriptor(
tensorDesc: miopenTensorDescriptor_t,
dataType: *mut miopenDataType_t,
dimsA: *mut ::std::os::raw::c_int,
stridesA: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the tensor descriptor\n\n @param tensorDesc Tensor descriptor (input)\n @return miopenStatus_t"]
pub fn miopenDestroyTensorDescriptor(tensorDesc: miopenTensorDescriptor_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Create a Tensor Descriptor for sequence data\n\n API for creating an uninitialized sequence data tensor descriptor.\n @param tensorDesc Pointer to a sequence data tensor descriptor type (output)\n @return miopenStatus_t"]
pub fn miopenCreateSeqTensorDescriptor(
tensorDesc: *mut miopenSeqTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the sequence data tensor descriptor\n\n @param tensorDesc Tensor descriptor (input)\n @return miopenStatus_t"]
pub fn miopenDestroySeqTensorDescriptor(
tensorDesc: miopenSeqTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute element-wise tensor operations\n\n This function implements: \\f$ C = op ( alpha1[0] * A, alpha2[0] * B ) + beta[0] * C \\f$\n\n For Forward Bias one can also use, miopenConvolutionForwardBias()\n\n @param handle MIOpen handle (input)\n @param tensorOp Operation from miopenTensorOp_t (input)\n @param alpha1 Tensor A's floating point scaling factor, allocated on the host (input)\n @param aDesc Tensor descriptor for tensor A (input)\n @param A Tensor A (input)\n @param alpha2 Tensor B's floating point scaling factor, allocated on the host (input)\n @param bDesc Tensor descriptor for tensor B (input)\n @param B Tensor B (input)\n @param beta Tensor C's floating point scaling factor, allocated on the host (input)\n @param cDesc Tensor descriptor for tensor C (input)\n @param C Tensor C (input and output)\n @return miopenStatus_t"]
pub fn miopenOpTensor(
handle: miopenHandle_t,
tensorOp: miopenTensorOp_t,
alpha1: *const ::std::os::raw::c_void,
aDesc: miopenTensorDescriptor_t,
A: *const ::std::os::raw::c_void,
alpha2: *const ::std::os::raw::c_void,
bDesc: miopenTensorDescriptor_t,
B: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
cDesc: miopenTensorDescriptor_t,
C: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Fills a tensor with a single value.\n\n Supported datatypes are fp32, fp16, and bfp16\n\n @param handle MIOpen handle (input)\n @param yDesc Tensor descriptor for tensor y (input)\n @param y Tensor y (input)\n @param alpha Pointer to fill value (input)\n @return miopenStatus_t"]
pub fn miopenSetTensor(
handle: miopenHandle_t,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
alpha: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Scales all elements in a tensor by a single value.\n\n Supported datatypes are fp32 and fp16\n\n @param handle MIOpen handle (input)\n @param yDesc Tensor descriptor for tensor y (input)\n @param y Tensor y (input and output)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @return miopenStatus_t"]
pub fn miopenScaleTensor(
handle: miopenHandle_t,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
alpha: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Returns number of bytes associated with tensor descriptor\n\n @param tensorDesc Tensor descriptor (input)\n @param numBytes Number of bytes associated with tensor descriptor (output)\n @return miopenStatus_t"]
pub fn miopenGetTensorNumBytes(
tensorDesc: miopenTensorDescriptor_t,
numBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Copies one tensor to another tensor with a different layout/scale.\n\n This function implements:\n 1. \\f$ Y = alpha * X + beta * Y \\f$ for fp32 and fp16 datatype\n 2. Vectorize/de-vectorize along channel dimension C for int8 datatype\n\n Currently this is used for transforming from int8 to int8x4 vector datatypes\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param xDesc Source Tensor descriptor for tensor x (input)\n @param x Source Tensor x (input)\n @param beta Floating point scaling factor, allocated on the host (input)\n @param yDesc Destination Tensor descriptor for tensor y (input)\n @param y Destination Tensor y (output)\n @return miopenStatus_t"]
pub fn miopenTransformTensor(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a convolution layer descriptor\n\n @param convDesc Convolution layer descriptor\n @return miopenStatus_t"]
pub fn miopenCreateConvolutionDescriptor(
convDesc: *mut miopenConvolutionDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a 2-D convolution layer descriptor\n\n For group/depthwise convolution dilation height and width, only a dilation value of 1 is\n supported.\n\n @param convDesc Convolution layer descriptor (output)\n @param c_mode Convolutional mode (input)\n @param pad_h Height input data padding (input)\n @param pad_w Width input data padding (input)\n @param stride_h Stride for the height of input data (input)\n @param stride_w Stride for the width of input data (input)\n @param dilation_h Dilation height (input)\n @param dilation_w Dilation width (input)\n @return miopenStatus_t"]
pub fn miopenInitConvolutionDescriptor(
convDesc: miopenConvolutionDescriptor_t,
c_mode: miopenConvolutionMode_t,
pad_h: ::std::os::raw::c_int,
pad_w: ::std::os::raw::c_int,
stride_h: ::std::os::raw::c_int,
stride_w: ::std::os::raw::c_int,
dilation_h: ::std::os::raw::c_int,
dilation_w: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a N-dimensional convolution layer descriptor\n\n @param convDesc Convolution layer descriptor (output)\n @param spatialDim Convolutional spatial dimension (input)\n @param padA Array of input data padding (input)\n @param strideA Array of convolution stride (input)\n @param dilationA Array of convolution dilation (input)\n @param c_mode Convolutional mode (input)\n @return miopenStatus_t"]
pub fn miopenInitConvolutionNdDescriptor(
convDesc: miopenConvolutionDescriptor_t,
spatialDim: ::std::os::raw::c_int,
padA: *const ::std::os::raw::c_int,
strideA: *const ::std::os::raw::c_int,
dilationA: *const ::std::os::raw::c_int,
c_mode: miopenConvolutionMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Retrieves the spatial dimension of a convolution layer descriptor\n\n @param convDesc Convolution layer descriptor (input)\n @param spatialDim Spatial dimension of convolution descriptor (output)\n @return miopenStatus_t"]
pub fn miopenGetConvolutionSpatialDim(
convDesc: miopenConvolutionDescriptor_t,
spatialDim: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Retrieves a 2-D convolution layer descriptor's details\n\n For group/depthwise convolution dilation height and width, only a dilation value of 1 is\n supported.\n\n @param convDesc Convolution layer descriptor (input)\n @param c_mode Convolutional mode (output)\n @param pad_h Height input data padding (output)\n @param pad_w Width input data padding (output)\n @param stride_h Stride for the height of input data (output)\n @param stride_w Stride for the width of input data (output)\n @param dilation_h Dilation height (output)\n @param dilation_w Dilation width (output)\n @return miopenStatus_t"]
pub fn miopenGetConvolutionDescriptor(
convDesc: miopenConvolutionDescriptor_t,
c_mode: *mut miopenConvolutionMode_t,
pad_h: *mut ::std::os::raw::c_int,
pad_w: *mut ::std::os::raw::c_int,
stride_h: *mut ::std::os::raw::c_int,
stride_w: *mut ::std::os::raw::c_int,
dilation_h: *mut ::std::os::raw::c_int,
dilation_w: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Retrieves a N-dimensional convolution layer descriptor's details\n\n @param convDesc Convolution layer descriptor (input)\n @param requestedSpatialDim Expected convolution spatial dimension (intput)\n @param spatialDim Convolutional spatial dimension (output)\n @param padA Array of input data padding (output)\n @param strideA Array of convolution stride (output)\n @param dilationA Array of convolution dilation (output)\n @param c_mode Convolutional mode (output)\n @return miopenStatus_t"]
pub fn miopenGetConvolutionNdDescriptor(
convDesc: miopenConvolutionDescriptor_t,
requestedSpatialDim: ::std::os::raw::c_int,
spatialDim: *mut ::std::os::raw::c_int,
padA: *mut ::std::os::raw::c_int,
strideA: *mut ::std::os::raw::c_int,
dilationA: *mut ::std::os::raw::c_int,
c_mode: *mut miopenConvolutionMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the number of groups to be used in Group/Depthwise convolution\n\n @param convDesc Convolution layer descriptor (input)\n @param groupCount Pointer to number of groups in group/depthwise convolution (output)\n @return miopenStatus_t"]
pub fn miopenGetConvolutionGroupCount(
convDesc: miopenConvolutionDescriptor_t,
groupCount: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set the number of groups to be used in Group/Depthwise convolution\n\n Must be called before all computational APIs of group/depthwise convolution, it is preferable to\n call miopenInitConvolutionDescriptor() first, then miopenSetConvolutionGroupCount() to fully\n initialize group convolutions. Both Convolution Mode and Transpose Convolution Mode support\n group/depthwise convolution. To run depthwise convolution, set groupCount value equal to number\n of channels.\n\n @param convDesc Convolution layer descriptor (output)\n @param groupCount number of groups, in depthwise conv using filter_number/channel_multiplier\n (input)\n @return miopenStatus_t"]
pub fn miopenSetConvolutionGroupCount(
convDesc: miopenConvolutionDescriptor_t,
groupCount: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set the output padding to be used in 2-D Transpose convolution\n\n This function is optional for initialization of Transpose convolution. If applicable, it must be\n called before all computational APIs of Transpose convolution. It is preferable to call\n miopenInitConvolutionDescriptor() first, then miopenSetTransposeConvOutputPadding() to fully\n initialize transpose convolutions.\n\n @param convDesc Convolution layer descriptor (output)\n @param adj_h output padding for the height of output data (input)\n @param adj_w output padding for the width of output data (input)\n @return miopenStatus_t"]
pub fn miopenSetTransposeConvOutputPadding(
convDesc: miopenConvolutionDescriptor_t,
adj_h: ::std::os::raw::c_int,
adj_w: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set the output padding to be used in N-dimensional Transpose convolution\n\n This function is optional for initialization of Transpose convolution. If applicable, it must be\n called before all computational APIs of Transpose convolution. It is preferable to call\n miopenInitConvolutionNdDescriptor() first, then miopenSetTransposeConvNdOutputPadding() to fully\n initialize transpose convolutions. Currently, 2-D and 3-D convolutions are supported.\n\n @param convDesc Convolution layer descriptor (output)\n @param spatialDim Convolutional spatial dimension (input)\n @param adjA array of output padding for output data (input)\n @return miopenStatus_t"]
pub fn miopenSetTransposeConvNdOutputPadding(
convDesc: miopenConvolutionDescriptor_t,
spatialDim: ::std::os::raw::c_int,
adjA: *const ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the shape of a resulting 4-D tensor from a 2-D convolution\n\n This function returns the dimensions of the resulting 4D tensor of a 2D\n convolution, given the convolution descriptor, the input tensor descriptor\n and the filter descriptor. This function can help to setup the output tensor\n and allocate the proper amount of memory prior to launch the actual\n convolution.\n\n @param convDesc Convolution layer descriptor (input)\n @param inputTensorDesc Input data tensor descriptor (input)\n @param filterDesc Weight descriptor (input)\n @param n Mini-batch size (output)\n @param c Number of channels (output)\n @param h Data height dimension size (output)\n @param w Data width dimension size (output)\n @return miopenStatus_t"]
pub fn miopenGetConvolutionForwardOutputDim(
convDesc: miopenConvolutionDescriptor_t,
inputTensorDesc: miopenTensorDescriptor_t,
filterDesc: miopenTensorDescriptor_t,
n: *mut ::std::os::raw::c_int,
c: *mut ::std::os::raw::c_int,
h: *mut ::std::os::raw::c_int,
w: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the shape of a resulting N-dimensional tensor from a (N-2)-dimensional convolution\n\n This function returns the dimensions of the resulting N-dimensional tensor of a (N-2)-dimensional\n convolution, given the convolution descriptor, the input tensor descriptor\n and the filter descriptor. It is used to setup the output tensor descriptor prior to executing\n the convolution layer.\n\n @param convDesc Convolution layer descriptor (input)\n @param inputTensorDesc Input data tensor descriptor (input)\n @param filterDesc Weight descriptor (input)\n @param nDim Pointer to Output data tensor dimension (output)\n @param outputTensorDimA Array of Output data tensor length (output)"]
pub fn miopenGetConvolutionNdForwardOutputDim(
convDesc: miopenConvolutionDescriptor_t,
inputTensorDesc: miopenTensorDescriptor_t,
filterDesc: miopenTensorDescriptor_t,
nDim: *mut ::std::os::raw::c_int,
outputTensorDimA: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the tensor descriptor object\n\n @param convDesc Convolution tensor descriptor type (input)\n @return miopenStatus_t"]
pub fn miopenDestroyConvolutionDescriptor(
convDesc: miopenConvolutionDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set the attribute of the convolution descriptor\n\n @param convDesc Convolution layer descriptor (input)\n @param attr Attribute of this convolution to set (input)\n @param value Value of this attribute (input)"]
pub fn miopenSetConvolutionAttribute(
convDesc: miopenConvolutionDescriptor_t,
attr: miopenConvolutionAttrib_t,
value: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the attribute of the convolution descriptor\n\n @param convDesc Convolution layer descriptor (input)\n @param attr Attribute of this convolution to get (input)\n @param value Value of this attribute (output)"]
pub fn miopenGetConvolutionAttribute(
convDesc: miopenConvolutionDescriptor_t,
attr: miopenConvolutionAttrib_t,
value: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the Find Mode attribute in the convolution descriptor.\n\n The subsequent calls of miopenFindConvolutionForwardAlgorithm(),\n miopenFindConvolutionBackwardDataAlgorithm(), or miopenFindConvolutionBackwardWeightsAlgorithm()\n invoked with convDesc, will follow the findMode set by this call.\n\n Note that the default Find Mode is overriden by the MIOPEN_FIND_MODE environment variable,\n if it is set. If unset, the default is as specified by miopenConvolutionFindModeDefault.\n\n @param convDesc Convolution layer descriptor (input)\n @param findMode Find Mode of convDesc (input)\n @return miopenStatus_t"]
pub fn miopenSetConvolutionFindMode(
convDesc: miopenConvolutionDescriptor_t,
findMode: miopenConvolutionFindMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Reads the Find Mode attribute from the convolution descriptor.\n\n @param convDesc Convolution layer descriptor (input)\n @param findMode Find Mode of convDesc (output)\n @return miopenStatus_t"]
pub fn miopenGetConvolutionFindMode(
convDesc: miopenConvolutionDescriptor_t,
findMode: *mut miopenConvolutionFindMode_t,
) -> miopenStatus_t;
}
#[doc = "< GEMM variant"]
pub const miopenConvFwdAlgorithm_t_miopenConvolutionFwdAlgoGEMM: miopenConvFwdAlgorithm_t = 0;
#[doc = "< Direct convolutions"]
pub const miopenConvFwdAlgorithm_t_miopenConvolutionFwdAlgoDirect: miopenConvFwdAlgorithm_t = 1;
#[doc = "< Fast Fourier Transform indirect convolutions"]
pub const miopenConvFwdAlgorithm_t_miopenConvolutionFwdAlgoFFT: miopenConvFwdAlgorithm_t = 2;
#[doc = "< Winograd indirect convolutions"]
pub const miopenConvFwdAlgorithm_t_miopenConvolutionFwdAlgoWinograd: miopenConvFwdAlgorithm_t = 3;
#[doc = "< Implicit GEMM convolutions"]
pub const miopenConvFwdAlgorithm_t_miopenConvolutionFwdAlgoImplicitGEMM: miopenConvFwdAlgorithm_t =
5;
#[doc = " @enum miopenConvFwdAlgorithm_t\n Convolutional algorithm mode for forward propagation. MIOpen use cross-correlation for its\n convolution implementation."]
pub type miopenConvFwdAlgorithm_t = ::std::os::raw::c_uint;
#[doc = "< GEMM variant"]
pub const miopenConvBwdWeightsAlgorithm_t_miopenConvolutionBwdWeightsAlgoGEMM:
miopenConvBwdWeightsAlgorithm_t = 0;
#[doc = "< Direct convolution algorithm"]
pub const miopenConvBwdWeightsAlgorithm_t_miopenConvolutionBwdWeightsAlgoDirect:
miopenConvBwdWeightsAlgorithm_t = 1;
#[doc = "< Winograd convolutions"]
pub const miopenConvBwdWeightsAlgorithm_t_miopenConvolutionBwdWeightsAlgoWinograd:
miopenConvBwdWeightsAlgorithm_t = 3;
#[doc = "< Implicit GEMM convolutions"]
pub const miopenConvBwdWeightsAlgorithm_t_miopenConvolutionBwdWeightsAlgoImplicitGEMM:
miopenConvBwdWeightsAlgorithm_t = 5;
#[doc = " @enum miopenConvBwdWeightsAlgorithm_t\n Convolutional algorithm mode for back propagation on weights."]
pub type miopenConvBwdWeightsAlgorithm_t = ::std::os::raw::c_uint;
#[doc = "< GEMM variant"]
pub const miopenConvBwdDataAlgorithm_t_miopenConvolutionBwdDataAlgoGEMM:
miopenConvBwdDataAlgorithm_t = 0;
#[doc = "< Direct convolutions"]
pub const miopenConvBwdDataAlgorithm_t_miopenConvolutionBwdDataAlgoDirect:
miopenConvBwdDataAlgorithm_t = 1;
#[doc = "< Fast Fourier Transform indirect convolutions"]
pub const miopenConvBwdDataAlgorithm_t_miopenConvolutionBwdDataAlgoFFT:
miopenConvBwdDataAlgorithm_t = 2;
#[doc = "< Winograd indirect convolutions"]
pub const miopenConvBwdDataAlgorithm_t_miopenConvolutionBwdDataAlgoWinograd:
miopenConvBwdDataAlgorithm_t = 3;
pub const miopenConvBwdDataAlgorithm_t_miopenTransposeBwdDataAlgoGEMM:
miopenConvBwdDataAlgorithm_t = 4;
#[doc = "< Implicit GEMM convolutions"]
pub const miopenConvBwdDataAlgorithm_t_miopenConvolutionBwdDataAlgoImplicitGEMM:
miopenConvBwdDataAlgorithm_t = 5;
#[doc = " @enum miopenConvBwdDataAlgorithm_t\n Convolutional algorithm mode for back propagation on data."]
pub type miopenConvBwdDataAlgorithm_t = ::std::os::raw::c_uint;
#[doc = "< GEMM variant"]
pub const miopenConvAlgorithm_t_miopenConvolutionAlgoGEMM: miopenConvAlgorithm_t = 0;
#[doc = "< Direct convolutions"]
pub const miopenConvAlgorithm_t_miopenConvolutionAlgoDirect: miopenConvAlgorithm_t = 1;
#[doc = "< Fast Fourier Transform indirect convolutions"]
pub const miopenConvAlgorithm_t_miopenConvolutionAlgoFFT: miopenConvAlgorithm_t = 2;
#[doc = "< Winograd indirect convolutions"]
pub const miopenConvAlgorithm_t_miopenConvolutionAlgoWinograd: miopenConvAlgorithm_t = 3;
#[doc = "< Implicit GEMM convolutions"]
pub const miopenConvAlgorithm_t_miopenConvolutionAlgoImplicitGEMM: miopenConvAlgorithm_t = 5;
#[doc = " @enum miopenConvAlgorithm_t\n Top-level convolutional algorithm mode"]
pub type miopenConvAlgorithm_t = ::std::os::raw::c_uint;
#[doc = " @brief Perf struct for forward, backward filter, or backward data algorithms\n\n Contains the union to hold the selected convolution algorithm for forward, or backwards layers,\n and also contains the time it took to run the algorithm and the workspace required to run the\n algorithm. The workspace in this structure can be used when executing the convolution layer."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct miopenConvAlgoPerf_t {
pub __bindgen_anon_1: miopenConvAlgoPerf_t__bindgen_ty_1,
#[doc = "< Time to exectued the selected algorithm represented in the union"]
pub time: f32,
#[doc = "< Workspace required to run the selected algorithm represented in the union"]
pub memory: usize,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union miopenConvAlgoPerf_t__bindgen_ty_1 {
#[doc = "< Forward convolution algorithm enum selection"]
pub fwd_algo: miopenConvFwdAlgorithm_t,
#[doc = "< Back propagation on weights\nconvolution algorithm enum selection"]
pub bwd_weights_algo: miopenConvBwdWeightsAlgorithm_t,
#[doc = "< Back propagation on data convolution algorithm enum selection"]
pub bwd_data_algo: miopenConvBwdDataAlgorithm_t,
}
#[doc = " @brief Performance struct for forward, backward filter, or backward data algorithms in\n immediate mode\n\n Contains a 64-bit integer identifying the solution and the algorithm for the solution,\n as well as the runtime, workspace size and a boolean flag indicating whether the returned\n solution is a heuristic or resulting from an actual run\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenConvSolution_t {
#[doc = "< Represents the approximate time required to execute this solution on the GPU,\nin milliseconds. This value may either be based on an acutal kernel run or an\nestimate based on a heuristic."]
pub time: f32,
#[doc = "< Workspace required to run the selected algorithm represented in the\nunion"]
pub workspace_size: usize,
#[doc = "< Identifier for the returned solution"]
pub solution_id: u64,
#[doc = "< The algorithm used to compute the solution"]
pub algorithm: miopenConvAlgorithm_t,
}
unsafe extern "C" {
#[doc = " @brief Query the maximum number of solutions applicable for the given input/output and weights\n tensor descriptor for Convolution in the Forward direction.\n\n This call returns the maximum number of applicable solutions for a forward convolution problem.\n The \\c solutionCount returned may be used to allocate the memory required for the\n \\c miopenConvAlgoPerf_t which is required by miopenConvolutionGetSolution API calls.\n\n @param handle MIOpen handle (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param xDesc Tensor descriptor for input data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param solutionCount Pointer to memory to return number of applicable solutions (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionForwardGetSolutionCount(
handle: miopenHandle_t,
wDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
yDesc: miopenTensorDescriptor_t,
solutionCount: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the applicable solutions for a convolution configuration described by\n input, output and convolution descriptors.\n\n The returned solutions array is sorted in the order of decreasing performance. The returned\n solutions\n might be based\n on heuristics and for more consistent performance results the user the advised to run the Find\n step.\n The maximum length of the solutions array may be queried using\n miopenConvolutionForwardGetSolutionCount\n\n @param handle MIOpen handle (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param xDesc Tensor descriptor for input data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param maxSolutionCount The size of the solutions array passed in below (input)\n @param solutionCount The size of the solutions array returned (output)\n @param solutions A pointer to an array of type miopenConvSolution_t allocated by the user,\n filled in by MIOpen with applicable solutions. (output)\n @return miopenStatus_t\n"]
pub fn miopenConvolutionForwardGetSolution(
handle: miopenHandle_t,
wDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
yDesc: miopenTensorDescriptor_t,
maxSolutionCount: usize,
solutionCount: *mut usize,
solutions: *mut miopenConvSolution_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Returns the workspace size required for a particular solution id.\n\n This is an optional call for users who may have serialized the solution id and just need the\n workspace\n size for it. The same information is returned by the miopenConvolutionForwardGetSolution as part\n of the\n miopenConvSolution_t struct.\n\n @param handle MIOpen handle (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param xDesc Tensor descriptor for input data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param solution_id ID of the solution for which workspace size is required (input)\n @param workSpaceSize The size of the workspace (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionForwardGetSolutionWorkspaceSize(
handle: miopenHandle_t,
wDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
yDesc: miopenTensorDescriptor_t,
solution_id: u64,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Compiles the solution provided by the user, this solution may be acquired by the\n miopenConvolutionForwardGetSolution API call above.\n Compiling the solution ensures that the first API call to miopenConvolutionForwardImmediate\n does\n not cause a compile.\n\n This is an optional step and may be skipped if a slow first miopenConvolutionForwardImmediate\n invocation is acceptable.\n\n @param handle MIOpen handle (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param xDesc Tensor descriptor for input data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param solution_id ID of the solution to be compiled, as chosen by the user\n @return miopenStatus_t"]
pub fn miopenConvolutionForwardCompileSolution(
handle: miopenHandle_t,
wDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
yDesc: miopenTensorDescriptor_t,
solution_id: u64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Executes the Forward convolution operation based on the provided solution ID.\n\n Supported datatypes are fp32, fp16, bfp16, and int8\n\n @param handle MIOpen handle (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param w Weights tensor w (input)\n @param xDesc Tensor descriptor for input data tensor x (input)\n @param x Data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param workSpace Workspace tensor (input)\n @param workSpaceSize Size of the memory in bytes pointed to by workSpace above\n @param solution_id ID of the solution to be compiled, as chosen by the user\n @return miopenStatus_t"]
pub fn miopenConvolutionForwardImmediate(
handle: miopenHandle_t,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
solution_id: u64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the maximum number of solutions applicable for the given input/output and weights\n tensor descriptor for backward Convolution w-r-t Data.\n\n This call returns the maximum number of applicable solutions for a the convolution problem, the\n number\n returned may be used to allocate the memory required for the miopenConvAlgoPert2_t which is\n required\n by miopenConvolutionBackwardDataGetSolution API calls.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param solutionCount Pointer to memory to return number of applicable solutions (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardDataGetSolutionCount(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dxDesc: miopenTensorDescriptor_t,
solutionCount: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the applicable solutions for a backward convolution w-r-t data as described by\n input, output and convolution descriptors.\n\n The returned solutions array is sorted in the order of decreasing performance. The returned\n solutions\n ns\n might be based\n on heuristics and for more consistent performance results the user the advised to run the Find\n step.\n The maximum length of the solutions array may be queried using\n miopenConvolutionBackwardDataGetSolutionCount\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param maxSolutionCount The size of the solutions array passed in below (input)\n @param solutionCount The size of the solutions array returned (output)\n @param solutions A pointer to an array of type miopenConvSolution_t allocated by the user,\n filled in by MIOpen with applicable solutions. (output)\n @return miopenStatus_t\n"]
pub fn miopenConvolutionBackwardDataGetSolution(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dxDesc: miopenTensorDescriptor_t,
maxSolutionCount: usize,
solutionCount: *mut usize,
solutions: *mut miopenConvSolution_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Returns the workspace size required for a particular solution id.\n\n This is an optional call for users who may have serialized the solution id and just need the\n workspace\n size for it. The same information is returned by the miopenConvolutionBackwardDataGetSolution as\n part of the\n miopenConvSolution_t struct.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param solution_id ID of the solution for which workspace size is required (input)\n @param workSpaceSize The size of the workspace (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardDataGetSolutionWorkspaceSize(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dxDesc: miopenTensorDescriptor_t,
solution_id: u64,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Compiles the solution provided by the user, this solution may be acquired by the\n miopenConvolutionBackwardDataGetSolution API call above.\n Compiling the solution ensures that the first API call to\n miopenConvolutionBackwardDataImmediate\n does not cause a compile.\n\n This is an optional step and may be skipped if a slow first\n miopenConvolutionBackwardDataImmediate\n invocation is acceptable.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param solution_id ID of the solution to be compiled, as chosen by the user\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardDataCompileSolution(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dxDesc: miopenTensorDescriptor_t,
solution_id: u64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Executes the Backward convolution w-r-t data operation based on the provided solution\n ID.\n\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param w Weights tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param dx Data delta tensor dx (output)\n @param workSpace Workspace tensor (input)\n @param workSpaceSize Size in bytes of the workspace memory pointed to by workSpace\n @param solution_id ID of the solution to be compiled, as chosen by the user\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardDataImmediate(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
solution_id: u64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the maximum number of solutions applicable for the given input/output and weights\n tensor descriptor for backward Convolution w-r-t Weights.\n\n This call returns the maximum number of applicable solutions for a the convolution problem, the\n number\n returned may be used to allocate the memory required for the miopenConvAlgoPert2_t which is\n required\n by miopenConvolutionBackwardWeightsGetSolution API calls.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data tensor dy (input)\n @param xDesc Tensor descriptor for data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param dwDesc Tensor descriptor for weight tensor dw (input)\n @param solutionCount Pointer to memory to return number of applicable solutions (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardWeightsGetSolutionCount(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dwDesc: miopenTensorDescriptor_t,
solutionCount: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the applicable solutions for a backward convolution w-r-t weights as described by\n input, output and convolution descriptors.\n\n The returned solutions array is sorted in the order of decreasing performance. The returned\n solutions\n might be based\n on heuristics and for more consistent performance results the user the advised to run the Find\n step.\n The maximum length of the solutions array may be queried using\n miopenConvolutionBackwardWeightsGetSolutionCount\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data tensor dy (input)\n @param xDesc Tensor descriptor for data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param dwDesc Tensor descriptor for weight tensor dw (input)\n @param maxSolutionCount The size of the solutions array passed in below (input)\n @param solutionCount The size of the solutions array returned (output)\n @param solutions A pointer to an array of type miopenConvSolution_t allocated by the user,\n filled in by MIOpen with applicable solutions. (output)\n @return miopenStatus_t\n"]
pub fn miopenConvolutionBackwardWeightsGetSolution(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dwDesc: miopenTensorDescriptor_t,
maxSolutionCount: usize,
solutionCount: *mut usize,
solutions: *mut miopenConvSolution_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Returns the workspace size required for a particular solution id.\n\n This is an optional call for users who may have serialized the solution id and just need the\n workspace\n size for it. The same information is returned by the miopenConvolutionBackwardWeightsGetSolution\n as part of the\n miopenConvSolution_t struct.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data tensor dy (input)\n @param xDesc Tensor descriptor for data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param dwDesc Tensor descriptor for weight tensor dw (input)\n @param solution_id ID of the solution for which workspace size is required (input)\n @param workSpaceSize The size of the workspace (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardWeightsGetSolutionWorkspaceSize(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dwDesc: miopenTensorDescriptor_t,
solution_id: u64,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Compiles the solution provided by the user, this solution may be acquired by the\n miopenConvolutionBackwardWeightsGetSolution API call above.\n Compiling the solution ensures that the first API call to\n miopenConvolutionBackwardWeightsImmediate\n does not cause a compile.\n\n This is an optional step and may be skipped if a slow first\n miopenConvolutionBackwardWeightsImmediate invocation is acceptable.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data tensor dy (input)\n @param xDesc Tensor descriptor for data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param dwDesc Tensor descriptor for weight tensor dw (input)\n @param solution_id ID of the solution to be compiled, as chosen by the user\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardWeightsCompileSolution(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dwDesc: miopenTensorDescriptor_t,
solution_id: u64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Executes the Backward convolution w-r-t weights operation based on the provided solution\n ID.\n\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param xDesc Tensor descriptor for data tensor x (input)\n @param x Data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param dwDesc Tensor descriptor for weight tensor dw (input)\n @param dw Weights delta tensor dw (output)\n @param workSpace Workspace tensor (input)\n @param workSpaceSize Size in bytes of the memory passed in, pointed to by workSpace pointer\n above\n @param solution_id ID of the solution to be compiled, as chosen by the user\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardWeightsImmediate(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
dwDesc: miopenTensorDescriptor_t,
dw: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
solution_id: u64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the workspace size required for a forward convolution algorithm.\n\n For given tensor and convolution descriptors, this function calculates and returns the minimum\n size of the workspace that must be provided to miopenFindConvolutionForwardAlgorithm() in order\n for the latter to find the best candidate from the available forward data convolution algorithms.\n\n WARNING: Providing smaller workspace may result in the selection of a slow convolution\n algorithm, and therefore affect library performance.\n\n It should be assumed that the required workspace size is different for each convolution\n configuration. Therefore, typically this function should be called at least once for each\n convolution configuration used.\n\n Since the convolution configuration is determined by tensor and convolution descriptors, the user\n should ensure that all descriptors contain complete information. For example, if Group/Depthwise\n convolution mode is used, then miopenSetConvolutionGroupCount() should be called before running\n this, and so on.\n\n @param handle MIOpen handle (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param xDesc Tensor descriptor for input data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param workSpaceSize Pointer to memory to return size in bytes (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionForwardGetWorkSpaceSize(
handle: miopenHandle_t,
wDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
yDesc: miopenTensorDescriptor_t,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Search and run the forward convolutional algorithms and return a list of kernel times.\n\n This function attempts all MIOpen forward convolution algorithms based on\n the input configuration, and outputs performance metrics to a\n user-allocated array of type miopenConvAlgoPerf_t. These metrics are written\n in a sorted fashion where the first element has the lowest compute time.\n Users can chose the top-most algorithm if they only care about the fastest\n algorithm.\n\n This function is mandatory before using miopenConvolutionForward(). In order\n to execute this function, miopenConvolutionForwardGetWorkSpaceSize() must be\n run to determine the required memory for this search.\n\n * If exhaustiveSearch == 0, MIOpen will look for the first kernel with a configuration match. If\n a configuration match is not found, a default configuration will be returned.\n\n * If exhaustiveSearch == 1, MIOpen will look for the best kernel for the provided configuration.\n If a match is not found, an exhaustive search is performed by running individual algorithms.\n\n If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running\n this.\n\n @param handle MIOpen handle (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param w Weights tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param requestAlgoCount Number of algorithms to return kernel times (input)\n @param returnedAlgoCount Pointer to number of algorithms returned (output)\n @param perfResults Pointer to union of best algorithm for forward and backwards (input)\n @param workSpace Pointer to workspace buffer (input).\n @param workSpaceSize Size in bytes of the workspace buffer (input).\n The buffer must be allocated on the device by the caller.\n The size of the buffer should be determined by calling\n miopenConvolutionForwardGetWorkSpaceSize(), see its\n documentation for details.\n @param exhaustiveSearch A boolean to toggle a full search of all algorithms\n and configurations (input)\n @return miopenStatus_t"]
pub fn miopenFindConvolutionForwardAlgorithm(
handle: miopenHandle_t,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
requestAlgoCount: ::std::os::raw::c_int,
returnedAlgoCount: *mut ::std::os::raw::c_int,
perfResults: *mut miopenConvAlgoPerf_t,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
exhaustiveSearch: bool,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a forward convolution layer\n\n Runs the forward convolution layer based on the selected algorithm. The function\n miopenFindConvolutionForwardAlgorithm() must have been executed previously to\n determine the required memory needed for the workspace and the best convolutional algorithm.\n The scaling parameter alpha (float) and shift parameter beta (float) are only supported for\n alpha = 1 and beta = 0 in 2D. In 3D, these parameters can take other values.\n\n The forward convolution is designed to accommodate both packed and non-packed tensor strides for\n multiple data types and dimensions across various platforms. This flexibility ensures optimal\n performance in handling diverse computational scenarios. To configure tensor parameters,\n including strides, users can utilize the APIs miopenSetTensorDescriptor() and\n miopenGetTensorDescriptor(). These APIs empower developers to seamlessly set and retrieve tensor\n information, facilitating a more intuitive and efficient workflow. The tensor strides are\n non-packed by default.\n\n If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running\n this.\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param w Weights tensor w (inputs)\n @param convDesc Convolution layer descriptor (inputs)\n @param algo Algorithm selected (inputs)\n @param beta Floating point shift factor, allocated on the host (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param workSpace Pointer to workspace required (input)\n @param workSpaceSize Size in bytes of the memory determined by the find step (input)\n @return miopenStatus_t"]
pub fn miopenConvolutionForward(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
algo: miopenConvFwdAlgorithm_t,
beta: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Calculate element-wise scale and shift of a tensor via a bias tensor\n\n This function applies an element-wise bias to a data tensor from an input bias tensor.\n The scaling parameter alpha (float) and shift parameter beta (float) are only supported for\n alpha = 1 and beta = 0.\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param bDesc Tensor descriptor for bias tensor b (input)\n @param b Bias tensor b (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param yDesc Tensor descriptor for data tensor y (input)\n @param y Data tensor y (input and output)\n @return miopenStatus_t"]
pub fn miopenConvolutionForwardBias(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
bDesc: miopenTensorDescriptor_t,
b: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the workspace size required for a backward data convolution algorithm.\n\n For given tensor and convolution descriptors, this function calculates and returns the minimum\n size of the workspace that must be provided to miopenFindConvolutionBackwardDataAlgorithm() in\n order for the latter to find the best candidate from the available backward data convolution\n algorithms.\n\n WARNING: Providing smaller workspace may result in the selection of a slow convolution\n algorithm, and therefore affect library performance.\n\n It should be assumed that the required workspace size is different for each convolution\n configuration. Therefore, typically this function should be called at least once for each\n convolution configuration used.\n\n Since the convolution configuration is determined by tensor and convolution descriptors, the user\n should ensure that all descriptors contain complete information. For example, if Group/Depthwise\n convolution mode is used, then miopenSetConvolutionGroupCount() should be called before running\n this, and so on.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param workSpaceSize Size in bytes of the memory required (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardDataGetWorkSpaceSize(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dxDesc: miopenTensorDescriptor_t,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Search and run the backwards data convolution algorithms and return a list of kernel\n times.\n\n This function attempts all MIOpen backward data convolution algorithms, and outputs the\n performance metrics to a user-allocated array of type miopenConvAlgoPerf_t.\n These metrics are written in sorted fashion where the first element has the lowest compute time.\n This function is mandatory before using backwards convolutions. Users can chose the top-most\n algorithm if they only care about the fastest algorithm.\n\n This function is mandatory before using miopenConvolutionBackwardData(). In order to\n execute this function, miopenConvolutionBackwardsDataGetWorkSpaceSize() must be run to determine\n the required memory for this search.\n\n * If exhaustiveSearch == 0, MIOpen will look for the first kernel with a configuration match. If\n a configuration match is not found, a default configuration will be returned.\n\n * If exhaustiveSearch == 1, MIOpen will look for the best kernel for the provided configuration.\n If a match is not found, an exhaustive search is performed by running individual algorithms.\n\n If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running\n this.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param w Weights tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param dx Data delta tensor dx (input)\n @param requestAlgoCount Number of algorithms to return kernel times (input)\n @param returnedAlgoCount Pointer to number of algorithms returned (output)\n @param perfResults Pointer to union of best algorithm for forward and backwards (output)\n @param workSpace Pointer to workspace buffer (input).\n @param workSpaceSize Size in bytes of the workspace buffer (input).\n The buffer must be allocated on the device by the caller.\n The size of the buffer should be determined by calling\n miopenConvolutionBackwardDataGetWorkSpaceSize(), see its\n documentation for details.\n @param exhaustiveSearch A boolean to toggle a full search of all algorithms\n and configurations (input)\n @return miopenStatus_t"]
pub fn miopenFindConvolutionBackwardDataAlgorithm(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
requestAlgoCount: ::std::os::raw::c_int,
returnedAlgoCount: *mut ::std::os::raw::c_int,
perfResults: *mut miopenConvAlgoPerf_t,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
exhaustiveSearch: bool,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a backward data convolution layer\n\n Runs the backward data convolution layer based on the selected algorithm. The function\n miopenFindConvolutionBackwardDataAlgorithm() must have been executed previously to\n determine the required memory needed for the workspace and the best convolutional\n algorithm.\n\n The backward data convolution is designed to accommodate both packed and non-packed tensor\n strides for multiple data types and dimensions across various platforms. This flexibility ensures\n optimal performance in handling diverse computational scenarios. To configure tensor parameters,\n including strides, users can utilize the APIs miopenSetTensorDescriptor() and\n miopenGetTensorDescriptor(). These APIs empower developers to seamlessly set and retrieve tensor\n information, facilitating a more intuitive and efficient workflow. The tensor strides are\n non-packed by default.\n\n If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running\n this.\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param w Weights tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param algo Algorithm selected (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param dx Data delta tensor dx (output)\n @param workSpace Pointer to workspace required for the search (input)\n @param workSpaceSize Size in bytes of the memory needed for find (input)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardData(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
algo: miopenConvBwdDataAlgorithm_t,
beta: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the GPU memory required for the backward weights convolution algorithm.\n\n For given tensor and convolution descriptors, this function calculates and returns the minimum\n size of the workspace that must be provided to miopenFindConvolutionBackwardWeightsAlgorithm() in\n order for the latter to find the best candidate from the available backward weights convolution\n algorithms.\n\n WARNING: Providing smaller workspace may result in the selection of a slow convolution\n algorithm, and therefore affect library performance.\n\n It should be assumed that the required workspace size is different for each convolution\n configuration. Therefore, typically this function should be called at least once for each\n convolution configuration used.\n\n Since the convolution configuration is determined by tensor and convolution descriptors, the user\n should ensure that all descriptors contain complete information. For example, if Group/Depthwise\n convolution mode is used, then miopenSetConvolutionGroupCount() should be called before running\n this, and so on.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param xDesc Tensor descriptor for data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param dwDesc Tensor descriptor for output weights tensor dw (input)\n @param workSpaceSize Size in bytes of the memory required (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardWeightsGetWorkSpaceSize(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
dwDesc: miopenTensorDescriptor_t,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Search and run the backwards weights convolutional algorithms and return a list of kernel\n times.\n\n This function attempts all MIOpen backward weights convolution algorithms, and outputs\n the performance metrics to a user-allocated array of type miopenConvAlgoPerf_t. These metrics are\n written in sorted fashion where the first element has the lowest compute time.\n This function is mandatory before using backwards weight convolutions. Users can chose the\n top-most algorithm if they only care about the fastest algorithm.\n\n This function is mandatory before using miopenConvolutionBackwardWeights(). In order to\n execute this function, miopenConvolutionBackwardsWeightsGetWorkSpaceSize() must be run to\n determine the required memory for this search.\n\n * If exhaustiveSearch == 0, MIOpen will look for the first kernel with a configuration match. If\n a configuration match is not found, a default configuration will be returned.\n\n * If exhaustiveSearch == 1, MIOpen will look for the best kernel for the provided configuration.\n If a match is not found, an exhaustive search is performed by running individual algorithms.\n\n If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running\n this.\n\n @param handle MIOpen handle (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param xDesc Tensor descriptor for output data tensor x (input)\n @param x Data delta tensor dx (input)\n @param convDesc Convolution layer descriptor (input)\n @param dwDesc Tensor descriptor for weight tensor dw (input)\n @param dw Weights delta tensor dw (input)\n @param requestAlgoCount Number of algorithms to return kernel times (input)\n @param returnedAlgoCount Pointer to number of algorithms returned (output)\n @param perfResults Pointer to union of best algorithm for forward and backwards (output)\n @param workSpace Pointer to workspace buffer (input).\n @param workSpaceSize Size in bytes of the workspace buffer (input).\n The buffer must be allocated on the device by the caller.\n The size of the buffer should be determined by calling\n miopenConvolutionBackwardWeightsGetWorkSpaceSize(), see its\n documentation for details.\n @param exhaustiveSearch A boolean to toggle a full search of all algorithms\n and configurations (input)\n @return miopenStatus_t"]
pub fn miopenFindConvolutionBackwardWeightsAlgorithm(
handle: miopenHandle_t,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
dwDesc: miopenTensorDescriptor_t,
dw: *mut ::std::os::raw::c_void,
requestAlgoCount: ::std::os::raw::c_int,
returnedAlgoCount: *mut ::std::os::raw::c_int,
perfResults: *mut miopenConvAlgoPerf_t,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
exhaustiveSearch: bool,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a backward weights convolution layer\n\n Runs the backward weights convolution layer based on the selected algorithm. The function\n miopenFindConvolutionBackwardWeightsAlgorithm() must have\n been executed previously to determine the required memory needed for the workspace and the\n best convolutional algorithm.\n\n The backward weights convolution is designed to accommodate both packed and non-packed tensor\n strides for multiple data types and dimensions across various platforms. This flexibility ensures\n optimal performance in handling diverse computational scenarios. To configure tensor parameters,\n including strides, users can utilize the APIs miopenSetTensorDescriptor() and\n miopenGetTensorDescriptor(). These APIs empower developers to seamlessly set and retrieve tensor\n information, facilitating a more intuitive and efficient workflow. The tensor strides are\n non-packed by default.\n\n If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running\n this.\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param dyDesc Tensor descriptor for data tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param xDesc Tensor descriptor for data tensor x (input)\n @param x Data tensor x (input)\n @param convDesc Convolution layer descriptor (input)\n @param algo Algorithm selected (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param dwDesc Tensor descriptor for weight tensor dw (input)\n @param dw Weights delta tensor dw (output)\n @param workSpace Pointer to workspace required for the search (input)\n @param workSpaceSize Size in bytes of the memory needed for find (input)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardWeights(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
algo: miopenConvBwdWeightsAlgorithm_t,
beta: *const ::std::os::raw::c_void,
dwDesc: miopenTensorDescriptor_t,
dw: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Calculates the gradient with respect to the bias.\n\n @deprecated This function is deprecated and will be removed in a future release.\n The underlying OpenCL kernel (MIOpenConvBwdBias.cl) has been removed.\n This function now returns miopenStatusNotImplemented.\n\n Compute the convolution backwards gradient with respect to the bias tensor.\n The scaling parameter alpha (float) and shift parameter beta (float) are only supported for\n alpha = 1 and beta = 0.\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param dbDesc Tensor descriptor for input bias tensor db (input)\n @param db Bias delta tensor db (output)\n @return miopenStatus_t"]
pub fn miopenConvolutionBackwardBias(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
dbDesc: miopenTensorDescriptor_t,
db: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a pooling layer descriptor\n\n @param poolDesc Pointer to a pooling layer descriptor (output)\n @return miopenStatus_t"]
pub fn miopenCreatePoolingDescriptor(
poolDesc: *mut miopenPoolingDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set index data type for pooling layer. The default indexing type is uint8_t.\n Users can set the index type to any of the miopenIndexType_t sizes; 8, 16, 32, or 64 bit\n unsigned integers.\n\n @param poolDesc Pointer to a pooling layer descriptor (input)\n @param index_type Index type (input)\n @return miopenStatus_t"]
pub fn miopenSetPoolingIndexType(
poolDesc: miopenPoolingDescriptor_t,
index_type: miopenIndexType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the index data type for pooling layer. The index type to any of the\n miopenIndexType_t sizes; 8, 16, 32, or 64 bit unsigned integers.\n\n @param poolDesc Pointer to a pooling layer descriptor (input)\n @param index_type Index type (output)\n @return miopenStatus_t"]
pub fn miopenGetPoolingIndexType(
poolDesc: miopenPoolingDescriptor_t,
index_type: *mut miopenIndexType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set workspace index mode for pooling layer. The default mode is\n miopenPoolingWorkSpaceIndexMask.\n\n @param poolDesc Pointer to a pooling layer descriptor (input/output)\n @param workspace_index Workspace index mode (input)\n @return miopenStatus_t"]
pub fn miopenSetPoolingWorkSpaceIndexMode(
poolDesc: miopenPoolingDescriptor_t,
workspace_index: miopenPoolingWorkspaceIndexMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get workspace index mode for pooling layer.\n\n @param poolDesc Pointer to a pooling layer descriptor (input)\n @param workspace_index Workspace index mode (output)\n @return miopenStatus_t"]
pub fn miopenGetPoolingWorkSpaceIndexMode(
poolDesc: miopenPoolingDescriptor_t,
workspace_index: *mut miopenPoolingWorkspaceIndexMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets a 2-D pooling layer descriptor details.\n\n Sets the window shape, padding, and stride for a previously created 2-D pooling descriptor.\n\n @param poolDesc Pointer to a pooling layer descriptor (output)\n @param mode Pooling mode enum (input)\n @param windowHeight Input window height dimension (input)\n @param windowWidth Input window width dimension (input)\n @param pad_h Number of elements to pad height (input)\n @param pad_w Number of elements to pad width (input)\n @param stride_h Vertical stride (input)\n @param stride_w Horizontal stride (input)\n @return miopenStatus_t"]
pub fn miopenSet2dPoolingDescriptor(
poolDesc: miopenPoolingDescriptor_t,
mode: miopenPoolingMode_t,
windowHeight: ::std::os::raw::c_int,
windowWidth: ::std::os::raw::c_int,
pad_h: ::std::os::raw::c_int,
pad_w: ::std::os::raw::c_int,
stride_h: ::std::os::raw::c_int,
stride_w: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets a 2-D pooling layer descriptor details\n\n Gets the window shape, padding, and stride for a previously created 2-D pooling descriptor.\n\n @param poolDesc Pointer to a pooling layer descriptor (input)\n @param mode Pooling mode enum (output)\n @param windowHeight Input window height dimension (output)\n @param windowWidth Input window width dimension (output)\n @param pad_h Number of elements to pad height (output)\n @param pad_w Number of elements to pad width (output)\n @param stride_h Vertical stride (output)\n @param stride_w Horizontal stride (output)\n @return miopenStatus_t"]
pub fn miopenGet2dPoolingDescriptor(
poolDesc: miopenPoolingDescriptor_t,
mode: *mut miopenPoolingMode_t,
windowHeight: *mut ::std::os::raw::c_int,
windowWidth: *mut ::std::os::raw::c_int,
pad_h: *mut ::std::os::raw::c_int,
pad_w: *mut ::std::os::raw::c_int,
stride_h: *mut ::std::os::raw::c_int,
stride_w: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets the shape of the output tensor for 2-D pooling\n\n Retrieve the tensor dimensions for the forward 2-D pooling. This call is required for\n the forward if the output dimensions are different than the input tensor\n dimensions.\n\n @param poolDesc Pointer to a pooling layer descriptor (input)\n @param tensorDesc Input tensor descriptor (input)\n @param n\t Mini-batch dim (output)\n @param c\t Number of channels (output)\n @param h Heights of input map (output)\n @param w Width of input map (output)\n @return miopenStatus_t"]
pub fn miopenGetPoolingForwardOutputDim(
poolDesc: miopenPoolingDescriptor_t,
tensorDesc: miopenTensorDescriptor_t,
n: *mut ::std::os::raw::c_int,
c: *mut ::std::os::raw::c_int,
h: *mut ::std::os::raw::c_int,
w: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set details of a N-D pooling layer descriptor\n\n Set the window shape, padding, and stride for a previously created N-D pooling descriptor.\n\n @param poolDesc Pointer to a pooling layer descriptor (input/output)\n @param mode Pooling mode enum (input)\n @param nbDims Dimension of the pooling (input)\n @param windowDimA Array of input window dimensions with length equal to or larger than\n dimsRequested (input)\n @param padA Array of number of elements to padding with length equal to or larger than\n dimsRequested (input)\n @param stridesA Array of stride parameter with length equal to or larger than dimsRequested\n (input)\n @return miopenStatus_t"]
pub fn miopenSetNdPoolingDescriptor(
poolDesc: miopenPoolingDescriptor_t,
mode: miopenPoolingMode_t,
nbDims: ::std::os::raw::c_int,
windowDimA: *const ::std::os::raw::c_int,
padA: *const ::std::os::raw::c_int,
stridesA: *const ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get details of a N-D pooling layer descriptor\n\n Get the window shape, padding, and stride for a previously created N-D pooling descriptor.\n\n @param poolDesc Pointer to a pooling layer descriptor (input)\n @param nbDimsRequested Dimension of the expected pooling descriptor (input)\n @param mode Pooling mode enum (output)\n @param nbDims Actual dimension of the pooling descriptor (output)\n @param windowDimA Array of input window dimensions with length equal to or larger than\n dimsRequested (output)\n @param padA Array of number of elements to padding with length equal to or larger\n than dimsRequested (output)\n @param stridesA Array of stride parameter with length equal to or larger than\n dimsRequested (output)\n @return miopenStatus_t"]
pub fn miopenGetNdPoolingDescriptor(
poolDesc: miopenPoolingDescriptor_t,
nbDimsRequested: ::std::os::raw::c_int,
mode: *mut miopenPoolingMode_t,
nbDims: *mut ::std::os::raw::c_int,
windowDimA: *mut ::std::os::raw::c_int,
padA: *mut ::std::os::raw::c_int,
stridesA: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets the shape of the output tensor for N-D pooling\n\n Retrieve the tensor dimensions for the forward N-D pooling. This call is required for\n the forward if the output dimensions are different than the input tensor\n dimensions.\n\n @param poolDesc Pointer to a pooling layer descriptor (input)\n @param tensorDesc Input tensor descriptor (input)\n @param dims Dimension of the pooling (input)\n @param tensorDimArr Array of tensor dimension (output)\n @return miopenStatus_t"]
pub fn miopenGetPoolingNdForwardOutputDim(
poolDesc: miopenPoolingDescriptor_t,
tensorDesc: miopenTensorDescriptor_t,
dims: ::std::os::raw::c_int,
tensorDimArr: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the amount of GPU memory required for pooling\n\n Retrieves the amount of workspace in bytes require for pooling. This call is required to\n determine the amount of GPU memory needed for the backwards pooling algorithms. For max-\n pooling, an assumption is that index data type is uint8_t, therefore the returned\n workspace size will be based on this assumption even if the user sets the index type with\n miopenSetPoolingIndexType().\n\n @param yDesc Descriptor for pooling layer (input)\n @param workSpaceSize Pointer to workSpaceSize (output)\n @return miopenStatus_t"]
pub fn miopenPoolingGetWorkSpaceSize(
yDesc: miopenTensorDescriptor_t,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the amount of GPU memory required for pooling\n\n Retrieves the amount of workspace in bytes require for pooling. This call is required to\n determine the amount of GPU memory needed for the backwards pooling algorithms. For max-\n pooling, there is no assumption on index data type. As the user can set the index datatype\n size using miopenSetPoolingIndexType().\n\n @param poolDesc Pointer to a pooling layer descriptor (input)\n @param yDesc Descriptor for pooling layer (input)\n @param workSpaceSize Pointer to workSpaceSize (output)\n @return miopenStatus_t"]
pub fn miopenPoolingGetWorkSpaceSizeV2(
poolDesc: miopenPoolingDescriptor_t,
yDesc: miopenTensorDescriptor_t,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a forward pooling layer\n\n Runs forward pooling. miopenGetPoolingForwardOutputDim() should be called before\n miopenPoolingForward().\n If the parameter do_backward == 0, then set workSpace = nullptr and workSpaceSize = 0. However,\n for back-propagation do_backwards must be set to 1 in miopenPoolingForward().\n\n @param handle MIOpen handle (input)\n @param poolDesc Descriptor for pooling layer (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param do_backward Boolean to toggle save data in workspace for backwards pass (input)\n @param workSpace Pointer user allocated memory (input)\n @param workSpaceSize Size in bytes of the memory needed (input)\n @return miopenStatus_t"]
pub fn miopenPoolingForward(
handle: miopenHandle_t,
poolDesc: miopenPoolingDescriptor_t,
alpha: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
do_backward: bool,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a backward pooling layer\n\n Runs backward pooling. miopenPoolingGetWorkSpaceSize() must be called before\n miopenPoolingBackward() to determine the amount of workSpace to be allocated.\n\n @param handle MIOpen handle (input)\n @param poolDesc Descriptor for pooling layer (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param xDesc Tensor descriptor for output data tensor x (input)\n @param x Data tensor x (output)\n @param beta Floating point shift factor, allocated on the host (input)\n @param dxDesc Tensor descriptor for tensor dx (input)\n @param dx Weights delta tensor dx (output)\n @param workSpace Pointer to user allocated workspace (input)\n @return miopenStatus_t"]
pub fn miopenPoolingBackward(
handle: miopenHandle_t,
poolDesc: miopenPoolingDescriptor_t,
alpha: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the pooling descriptor object\n\n @param poolDesc Pooling tensor descriptor type (input)\n @return miopenStatus_t"]
pub fn miopenDestroyPoolingDescriptor(poolDesc: miopenPoolingDescriptor_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @addtogroup LRN\n\n @{\n/\n/*! @brief Creates a local response normalization (LRN) layer descriptor\n\n @param lrnDesc Pointer to a local response normalization layer descriptor type\n @return miopenStatus_t"]
pub fn miopenCreateLRNDescriptor(lrnDesc: *mut miopenLRNDescriptor_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets a LRN layer descriptor details\n\n Sets all of the descriptor details for the LRN layer. The number of window elements lrnN is\n a diameter and always odd.\n\n @param lrnDesc Pointer to a LRN layer descriptor (output)\n @param mode LRN mode enum (input)\n @param lrnN Number of normalization window elements (input)\n @param lrnAlpha Scaling factor (input)\n @param lrnBeta Shift factor (input)\n @param lrnK K factor (input)\n @return miopenStatus_t"]
pub fn miopenSetLRNDescriptor(
lrnDesc: miopenLRNDescriptor_t,
mode: miopenLRNMode_t,
lrnN: ::std::os::raw::c_uint,
lrnAlpha: f64,
lrnBeta: f64,
lrnK: f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets a LRN layer descriptor details\n\n Retrieve the LRN descriptor details.\n\n @param lrnDesc Pointer to a LRN layer descriptor (input)\n @param mode LRN mode enum (output)\n @param lrnN Number of normalization window elements (output)\n @param lrnAlpha Scaling factor (output)\n @param lrnBeta Shift factor (output)\n @param lrnK K factor (output)\n @return miopenStatus_t"]
pub fn miopenGetLRNDescriptor(
lrnDesc: miopenLRNDescriptor_t,
mode: *mut miopenLRNMode_t,
lrnN: *mut ::std::os::raw::c_uint,
lrnAlpha: *mut f64,
lrnBeta: *mut f64,
lrnK: *mut f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Determine the workspace requirements.\n\n This function determines the GPU memory allocation required to execute the LRN layer based on the\n LRN descriptor.\n\n @param yDesc Pointer to a LRN layer descriptor (input)\n @param workSpaceSize Output variable for workspace size (output)\n @return miopenStatus_t"]
pub fn miopenLRNGetWorkSpaceSize(
yDesc: miopenTensorDescriptor_t,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a LRN forward layer\n\n Runs the forward layer normalization in the forward direction. If do_backward == 0, then\n set workSpace = nullptr and workSpaceSize = 0. However, if the user wishes to execute backwards,\n then they must set do_backwards = 1 in miopenLRNForward().\n\n @param handle MIOpen handle (input)\n @param lrnDesc Descriptor for LRN layer (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param do_backward Boolean to toggle save data in workspace for backwards pass (input)\n @param workSpace Pointer user allocated memory (input)\n @return miopenStatus_t"]
pub fn miopenLRNForward(
handle: miopenHandle_t,
lrnDesc: miopenLRNDescriptor_t,
alpha: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
do_backward: bool,
workSpace: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a LRN backward layer\n\n @param handle MIOpen handle (input)\n @param lrnDesc Descriptor for LRN layer (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param yDesc Tensor descriptor for data input tensor y (input)\n @param y Data tensor y (input)\n @param dyDesc Tensor descriptor for data input tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param xDesc Tensor descriptor for input data tensor x (input)\n @param x Data tensor x (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param dxDesc Tensor descriptor for output data tensor dx(input)\n @param dx Data delta tensor x (output)\n @param workSpace Pointer user allocated memory (input)\n @return miopenStatus_t"]
pub fn miopenLRNBackward(
handle: miopenHandle_t,
lrnDesc: miopenLRNDescriptor_t,
alpha: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
workSpace: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the LRN descriptor object\n\n @param lrnDesc LRN tensor descriptor type (input)\n @return miopenStatus_t"]
pub fn miopenDestroyLRNDescriptor(lrnDesc: miopenLRNDescriptor_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Derive tensor for gamma and beta from input tensor descriptor\n\n This function takes the input tensor descriptor and outputs a derived tensor for the\n normalization scale (gamma) and shift (beta) tensors.\n\n For an input tensor NCHW and spatial mode, the output derived tensor is 1C11, while for\n per-activation the derived tensor is 1CHW.\n\n For an input tensor NCDHW and spatial mode, the output derived tensor is 1C111, while for\n per-activation the derived tensor is 1CDHW.\n\n @param derivedBnDesc Output derived tensor descriptor (output)\n @param xDesc Input tensor descriptor (input)\n @param bn_mode Batch Normalization mode (input)\n @return miopenStatus_t"]
pub fn miopenDeriveBNTensorDescriptor(
derivedBnDesc: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
bn_mode: miopenBatchNormMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward training layer for batch normalization\n\n Batch normalization pass for forward training pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either resultSaveMean, or resultSaveInvVariance are null pointers then the values for the mean\n and inverse variance will not be used.\n\n Likewise, if either resultRunningMean, or resultRunningVariance are null pointers then the values\n for the running mean and variance will not be saved.\n Running averages and variances are scaled using an exponential averaging factor: \\f[\n \\mu_{old} = \\mu_{new}*factor + \\mu_{old}*(1-factor)\n \\f]\n where \\f[\n factor=1/(1+iteration)\n \\f]\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param bnScaleBiasMeanVarDesc Tensor descriptor for BN scaling, shifting, saved variance and\n mean (input)\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param expAvgFactor Exponential averaging factor (input)\n @param resultRunningMean Running average saved for inference (output)\n @param resultRunningVariance Running variance saved for inference (output)\n @param epsilon Value to stablize inverse variance calculation (input)\n @param resultSaveMean Saved mini-batch mean for backwards pass (output)\n @param resultSaveInvVariance Saved mini-batch inverse variance for backwards pass (output)\n @return miopenStatus_t"]
pub fn miopenBatchNormalizationForwardTraining(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
bnScaleBiasMeanVarDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
expAvgFactor: f64,
resultRunningMean: *mut ::std::os::raw::c_void,
resultRunningVariance: *mut ::std::os::raw::c_void,
epsilon: f64,
resultSaveMean: *mut ::std::os::raw::c_void,
resultSaveInvVariance: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward training layer for batch normalization\n\n Batch normalization pass for forward training pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either resultSaveMean, or resultSaveInvVariance are null pointers then the values for the mean\n and inverse variance will not be used.\n\n Likewise, if either resultRunningMean, or resultRunningVariance are null pointers then the values\n for the running mean and variance will not be saved.\n Running averages and variances are scaled using an exponential averaging factor: \\f[\n \\mu_{old} = \\mu_{new}*factor + \\mu_{old}*(1-factor)\n \\f]\n where \\f[\n factor=1/(1+iteration)\n \\f]\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param ScaleDesc Tensor descriptor for BN scaling\n @param biasVarDesc Tensor descriptor for BN bias\n @param savedMeanDesc Tensor descriptor for BN saved Mean\n @param savedVarDesc Tensor descriptor for BN saved Variance\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param expAvgFactor Exponential averaging factor (input)\n @param resultRunningMean Running average saved for inference (output)\n @param resultRunningVariance Running variance saved for inference (output)\n @param epsilon Value to stablize inverse variance calculation (input)\n @param resultSaveMean Saved mini-batch mean for backwards pass (output)\n @param resultSaveInvVariance Saved mini-batch inverse variance for backwards pass (output)\n @return miopenStatus_t"]
pub fn miopenBatchNormalizationForwardTraining_V2(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasVarDesc: miopenTensorDescriptor_t,
savedMeanDesc: miopenTensorDescriptor_t,
savedVarDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
expAvgFactor: f64,
resultRunningMean: *mut ::std::os::raw::c_void,
resultRunningVariance: *mut ::std::os::raw::c_void,
epsilon: f64,
resultSaveMean: *mut ::std::os::raw::c_void,
resultSaveInvVariance: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward training layer for batch normalization\n\n Batch normalization pass for forward training pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either resultSaveMean, or resultSaveInvVariance are null pointers then the values for the mean\n and inverse variance will not be used.\n\n Likewise, if either resultRunningMean, or resultRunningVariance are null pointers then the values\n for the running mean and variance will not be saved.\n Running averages and variances are scaled using an exponential averaging factor: \\f[\n \\mu_{old} = \\mu_{new}*factor + \\mu_{old}*(1-factor)\n \\f]\n where \\f[\n factor=1/(1+iteration)\n \\f]\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param ScaleDesc Tensor descriptor for BN scaling\n @param biasVarDesc Tensor descriptor for BN bias\n @param savedMeanDesc Tensor descriptor for BN saved Mean\n @param savedVarDesc Tensor descriptor for BN saved Variance\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param expAvgFactor Exponential averaging factor (input)\n @param prevResultRunningMean Running mean from previous iteration, read-only (input)\n @param prevResultRunningVariance Running variance from previous iteration, read-only (input)\n @param nextResultRunningMean Updated running mean for current iteration (output)\n @param nextResultRunningVariance Updated running variance for current iteration (output)\n @param epsilon Value to stablize inverse variance calculation (input)\n @param resultSaveMean Saved mini-batch mean for backwards pass (output)\n @param resultSaveInvVariance Saved mini-batch inverse variance for backwards pass (output)\n @return miopenStatus_t"]
pub fn miopenBatchNormalizationForwardTraining_V3(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasVarDesc: miopenTensorDescriptor_t,
savedMeanDesc: miopenTensorDescriptor_t,
savedVarDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
expAvgFactor: f64,
prevResultRunningMean: *const ::std::os::raw::c_void,
prevResultRunningVariance: *const ::std::os::raw::c_void,
nextResultRunningMean: *mut ::std::os::raw::c_void,
nextResultRunningVariance: *mut ::std::os::raw::c_void,
epsilon: f64,
resultSaveMean: *mut ::std::os::raw::c_void,
resultSaveInvVariance: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward training layer for batch normalization with fused activation\n\n Batch normalization pass for forward training pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either resultSaveMean, or resultSaveInvVariance are null pointers then the values for the mean\n and inverse variance will not be used.\n\n Likewise, if either resultRunningMean, or resultRunningVariance are null pointers then the values\n for the running mean and variance will not be saved.\n Running averages and variances are scaled using an exponential averaging factor: \\f[\n \\mu_{old} = \\mu_{new}*factor + \\mu_{old}*(1-factor)\n \\f]\n where \\f[\n factor=1/(1+iteration)\n \\f]\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param ScaleDesc Tensor descriptor for BN scaling\n @param biasVarDesc Tensor descriptor for BN bias\n @param savedMeanDesc Tensor descriptor for BN saved Mean\n @param savedVarDesc Tensor descriptor for BN saved Variance\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param expAvgFactor Exponential averaging factor (input)\n @param resultRunningMean Running average saved for inference (output)\n @param resultRunningVariance Running variance saved for inference (output)\n @param epsilon Value to stablize inverse variance calculation (input)\n @param resultSaveMean Saved mini-batch mean for backwards pass (output)\n @param resultSaveInvVariance Saved mini-batch inverse variance for backwards pass (output)\n @param activDesc Activation descriptor\n @return miopenStatus_t"]
pub fn miopenBatchNormForwardTrainingActivation(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasVarDesc: miopenTensorDescriptor_t,
savedMeanDesc: miopenTensorDescriptor_t,
savedVarDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
expAvgFactor: f64,
resultRunningMean: *mut ::std::os::raw::c_void,
resultRunningVariance: *mut ::std::os::raw::c_void,
epsilon: f64,
resultSaveMean: *mut ::std::os::raw::c_void,
resultSaveInvVariance: *mut ::std::os::raw::c_void,
activDesc: miopenActivationDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward training layer for batch normalization with fused activation\n\n Batch normalization pass for forward training pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either resultSaveMean, or resultSaveInvVariance are null pointers then the values for the mean\n and inverse variance will not be used.\n\n Likewise, if either resultRunningMean, or resultRunningVariance are null pointers then the values\n for the running mean and variance will not be saved.\n Running averages and variances are scaled using an exponential averaging factor: \\f[\n \\mu_{old} = \\mu_{new}*factor + \\mu_{old}*(1-factor)\n \\f]\n where \\f[\n factor=1/(1+iteration)\n \\f]\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param ScaleDesc Tensor descriptor for BN scaling\n @param biasVarDesc Tensor descriptor for BN bias\n @param savedMeanDesc Tensor descriptor for BN saved Mean\n @param savedVarDesc Tensor descriptor for BN saved Variance\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param expAvgFactor Exponential averaging factor (input)\n @param prevResultRunningMean Running mean from previous iteration, read-only (input)\n @param prevResultRunningVariance Running variance from previous iteration, read-only (input)\n @param nextResultRunningMean Updated running mean for current iteration (output)\n @param nextResultRunningVariance Updated running variance for current iteration (output)\n @param epsilon Value to stablize inverse variance calculation (input)\n @param resultSaveMean Saved mini-batch mean for backwards pass (output)\n @param resultSaveInvVariance Saved mini-batch inverse variance for backwards pass (output)\n @param activDesc Activation descriptor\n @return miopenStatus_t"]
pub fn miopenBatchNormForwardTrainingActivation_V2(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasVarDesc: miopenTensorDescriptor_t,
savedMeanDesc: miopenTensorDescriptor_t,
savedVarDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
expAvgFactor: f64,
prevResultRunningMean: *const ::std::os::raw::c_void,
prevResultRunningVariance: *const ::std::os::raw::c_void,
nextResultRunningMean: *mut ::std::os::raw::c_void,
nextResultRunningVariance: *mut ::std::os::raw::c_void,
epsilon: f64,
resultSaveMean: *mut ::std::os::raw::c_void,
resultSaveInvVariance: *mut ::std::os::raw::c_void,
activDesc: miopenActivationDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward inference layer for batch normalization\n\n Batch normalization pass for forward inference pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either estimatedMean, or estimatedVariance are null pointers then the values for the mean and\n variance will be calculated from input data and this calculated mean and variance will be used\n to update input values.\n If variance is zero and epsilon is also zero, this function outputs NaN values. Input epsilon\n value should always be non zero positive value.\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param bnScaleBiasMeanVarDesc Tensor descriptor for BN scaling, shifting, saved variance and\n mean (input)\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param estimatedMean Running average saved during forward training (input)\n @param estimatedVariance Running variance saved during forward training (input)\n @param epsilon Value to stabilize inverse variance calculation (input)\n @return miopenStatus_t"]
pub fn miopenBatchNormalizationForwardInference(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
bnScaleBiasMeanVarDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
estimatedMean: *mut ::std::os::raw::c_void,
estimatedVariance: *mut ::std::os::raw::c_void,
epsilon: f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward inference layer for batch normalization\n\n Batch normalization pass for forward inference pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either estimatedMean, or estimatedVariance are null pointers then the values for the mean and\n variance will be calculated from input data and this calculated mean and variance will be used\n to update input values.\n If variance is zero and epsilon is also zero, this function outputs NaN values. Input epsilon\n value should always be non zero positive value.\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param ScaleDesc Tensor descriptor for BN scaling\n @param biasVarDesc Tensor descriptor for BN bias\n @param estMeanDesc Tensor descriptor for BN estimated Mean\n @param estVarianceDesc Tensor descriptor for BN estimated Variance\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param estimatedMean Running average saved during forward training (input)\n @param estimatedVariance Running variance saved during forward training (input)\n @param epsilon Value to stabilize inverse variance calculation (input)\n @return miopenStatus_t"]
pub fn miopenBatchNormalizationForwardInference_V2(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasDesc: miopenTensorDescriptor_t,
estMeanDesc: miopenTensorDescriptor_t,
estVarianceDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
estimatedMean: *mut ::std::os::raw::c_void,
estimatedVariance: *mut ::std::os::raw::c_void,
epsilon: f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward inference layer for batch normalization using inverse variance\n\n Batch normalization pass for forward inference pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either estimatedMean, or estimatedInvVariance are null pointers then the values for the mean\n and inverse variance will be calculated from input data using an epsilon of 1e-5, and this\n calculated mean and inverse variance will be used to update input values.\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param ScaleDesc Tensor descriptor for BN scaling\n @param biasVarDesc Tensor descriptor for BN bias\n @param estMeanDesc Tensor descriptor for BN estimated Mean\n @param estInvVarianceDesc Tensor descriptor for BN estimated inverse variance\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param estimatedMean Running average saved during forward training (input)\n @param estimatedInvVariance Running inverse variance saved during forward training (input)\n @return miopenStatus_t"]
pub fn miopenBatchNormalizationForwardInferenceInvVariance(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasDesc: miopenTensorDescriptor_t,
estMeanDesc: miopenTensorDescriptor_t,
estInvVarianceDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
estimatedMean: *mut ::std::os::raw::c_void,
estimatedInvVariance: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward inference layer for batch normalization with fused activation using\n inverse variance\n\n Batch normalization pass for forward inference pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either estimatedMean, or estimatedInvVariance are null pointers then the values for the mean\n and inverse variance will be calculated from input data using an epsilon of 1e-5 and this\n calculated mean and inverse variance will be used to update input values.\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param ScaleDesc Tensor descriptor for BN scaling\n @param biasVarDesc Tensor descriptor for BN bias\n @param estMeanDesc Tensor descriptor for BN estimated Mean\n @param estInvVarianceDesc Tensor descriptor for BN estimated inverse variance\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param estimatedMean Running average saved during forward training (input)\n @param estimatedInvVariance Running inverse variance saved during forward training (input)\n @param activDesc Activation descriptor\n @return miopenStatus_t"]
pub fn miopenBatchNormForwardInferenceActivationInvVariance(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasDesc: miopenTensorDescriptor_t,
estMeanDesc: miopenTensorDescriptor_t,
estInvVarianceDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
estimatedMean: *mut ::std::os::raw::c_void,
estimatedInvVariance: *mut ::std::os::raw::c_void,
activDesc: miopenActivationDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward inference layer for batch normalization with fused activation\n\n Batch normalization pass for forward inference pass.\n Takes in batch normalization mode bn_mode and input tensor x, output tensor y, bnBias and bnScale\n with their descriptor.\n\n If either estimatedMean, or estimatedVariance are null pointers then the values for the mean and\n variance will be calculated from input data and this calculated mean and variance will be used\n to update input values.\n If variance is zero and epsilon is also zero, this function outputs NaN values. Input epsilon\n value should always be non zero positive value.\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param ScaleDesc Tensor descriptor for BN scaling\n @param biasVarDesc Tensor descriptor for BN bias\n @param estMeanDesc Tensor descriptor for BN estimated Mean\n @param estVarianceDesc Tensor descriptor for BN estimated Variance\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias, beta, tensor (input)\n @param estimatedMean Running average saved during forward training (input)\n @param estimatedVariance Running variance saved during forward training (input)\n @param epsilon Value to stabilize inverse variance calculation (input)\n @param activDesc Activation descriptor\n @return miopenStatus_t"]
pub fn miopenBatchNormForwardInferenceActivation(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alpha: *mut ::std::os::raw::c_void,
beta: *mut ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasDesc: miopenTensorDescriptor_t,
estMeanDesc: miopenTensorDescriptor_t,
estVarianceDesc: miopenTensorDescriptor_t,
bnScale: *mut ::std::os::raw::c_void,
bnBias: *mut ::std::os::raw::c_void,
estimatedMean: *mut ::std::os::raw::c_void,
estimatedVariance: *mut ::std::os::raw::c_void,
epsilon: f64,
activDesc: miopenActivationDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute backwards propagation layer for batch normalization\n\n Batch normalization pass for backwards propagation training pass.\n The method for backwards propagation batch normalization.\n\n Takes in batch normalization mode bn_mode and input tensor data x, input activation tensor dy,\n output tensor dx, the learned tensors resultBNBiasDiff and resultBNScaleDiff with their\n descriptor.\n\n If BOTH savedMean, and savedVariance are not null pointers then the method will use the saved\n mean and variance calculated by the forward training phase.\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alphaDataDiff Floating point scaling factor, allocated on the host (input)\n @param betaDataDiff Floating point shift factor, allocated on the host (input)\n @param alphaParamDiff Floating point scaling factor, allocated on the host (input)\n @param betaParamDiff Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param dyDesc Tensor descriptor for output data tensor y (input)\n @param dy Data tensor y (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param dx Data delta tensor dx (output)\n @param bnScaleBiasDiffDesc Tensor descriptor for BN scaling, shifting, saved variance and\n mean (input)\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param resultBnScaleDiff Tensor for dscale (output)\n @param resultBnBiasDiff Tensor for dbias (output)\n @param epsilon Value to stabilize inverse variance calculation (input)\n @param savedMean Saved mini-batch mean for backwards pass (input)\n @param savedInvVariance Saved mini-batch inverse variance for backwards pass (input)\n @return miopenStatus_t"]
pub fn miopenBatchNormalizationBackward(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alphaDataDiff: *const ::std::os::raw::c_void,
betaDataDiff: *const ::std::os::raw::c_void,
alphaParamDiff: *const ::std::os::raw::c_void,
betaParamDiff: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
bnScaleBiasDiffDesc: miopenTensorDescriptor_t,
bnScale: *const ::std::os::raw::c_void,
resultBnScaleDiff: *mut ::std::os::raw::c_void,
resultBnBiasDiff: *mut ::std::os::raw::c_void,
epsilon: f64,
savedMean: *const ::std::os::raw::c_void,
savedInvVariance: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute backwards propagation layer for batch normalization\n\n Batch normalization pass for backwards propagation training pass.\n The method for backwards propagation batch normalization.\n\n Takes in batch normalization mode bn_mode and input tensor data x, input activation tensor dy,\n output tensor dx, the learned tensors resultBNBiasDiff and resultBNScaleDiff with their\n descriptor.\n\n If BOTH savedMean, and savedVariance are not null pointers then the method will use the saved\n mean and variance calculated by the forward training phase.\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alphaDataDiff Floating point scaling factor, allocated on the host (input)\n @param betaDataDiff Floating point shift factor, allocated on the host (input)\n @param alphaParamDiff Floating point scaling factor, allocated on the host (input)\n @param betaParamDiff Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param dyDesc Tensor descriptor for output data tensor y (input)\n @param dy Data tensor y (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param dx Data delta tensor dx (output)\n @param scaleDesc Tensor descriptor for scaling descriptor (input)\n @param biasDesc Tensor descriptor for bias/shift descriptor (input)\n @param savedMeanDesc Tensor descriptor for saved Mean descriptor (input)\n @param savedVarDesc Tensor descriptor for saved Variance descriptor (input)\n , shifting, saved variance and\n mean (input)\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param resultBnScaleDiff Tensor for dscale (output)\n @param resultBnBiasDiff Tensor for dbias (output)\n @param epsilon Value to stabilize inverse variance calculation (input)\n @param savedMean Saved mini-batch mean for backwards pass (input)\n @param savedInvVariance Saved mini-bathc inverse variance for backwards pass (input)\n @return miopenStatus_t"]
pub fn miopenBatchNormalizationBackward_V2(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alphaDataDiff: *const ::std::os::raw::c_void,
betaDataDiff: *const ::std::os::raw::c_void,
alphaParamDiff: *const ::std::os::raw::c_void,
betaParamDiff: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasDesc: miopenTensorDescriptor_t,
savedMeanDesc: miopenTensorDescriptor_t,
savedVarDesc: miopenTensorDescriptor_t,
bnScale: *const ::std::os::raw::c_void,
resultBnScaleDiff: *mut ::std::os::raw::c_void,
resultBnBiasDiff: *mut ::std::os::raw::c_void,
epsilon: f64,
savedMean: *const ::std::os::raw::c_void,
savedInvVariance: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute backwards propagation layer for batch normalization with fused activation\n\n Batch normalization pass for backwards propagation training pass.\n The method for backwards propagation batch normalization.\n\n Takes in batch normalization mode bn_mode and input tensor data x, input activation tensor dy,\n output tensor dx, the learned tensors resultBNBiasDiff and resultBNScaleDiff with their\n descriptor.\n\n If BOTH savedMean, and savedVariance are not null pointers then the method will use the saved\n mean and variance calculated by the forward training phase.\n\n @param handle MIOpen handle (input)\n @param bn_mode Batch normalization mode (input)\n @param alphaDataDiff Floating point scaling factor, allocated on the host (input)\n @param betaDataDiff Floating point shift factor, allocated on the host (input)\n @param alphaParamDiff Floating point scaling factor, allocated on the host (input)\n @param betaParamDiff Floating point shift factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param dyDesc Tensor descriptor for output data tensor y (input)\n @param dy Data tensor y (input)\n @param dxDesc Tensor descriptor for output data tensor dx (input)\n @param dx Data delta tensor dx (output)\n @param scaleDesc Tensor descriptor for scaling descriptor (input)\n @param biasDesc Tensor descriptor for bias/shift descriptor (input)\n @param savedMeanDesc Tensor descriptor for saved Mean descriptor (input)\n @param savedVarDesc Tensor descriptor for saved Variance descriptor (input)\n , shifting, saved variance and\n mean (input)\n @param bnScale Batch norm scaling, gamma, tensor (input)\n @param bnBias Batch norm bias (input)\n @param resultBnScaleDiff Tensor for dscale (output)\n @param resultBnBiasDiff Tensor for dbias (output)\n @param epsilon Value to stabilize inverse variance calculation (input)\n @param savedMean Saved mini-batch mean for backwards pass (input)\n @param savedInvVariance Saved mini-bathc inverse variance for backwards pass (input)\n @param activDesc Activation descriptor\n @return miopenStatus_t"]
pub fn miopenBatchNormBackwardActivation(
handle: miopenHandle_t,
bn_mode: miopenBatchNormMode_t,
alphaDataDiff: *const ::std::os::raw::c_void,
betaDataDiff: *const ::std::os::raw::c_void,
alphaParamDiff: *const ::std::os::raw::c_void,
betaParamDiff: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
scaleDesc: miopenTensorDescriptor_t,
biasDesc: miopenTensorDescriptor_t,
savedMeanDesc: miopenTensorDescriptor_t,
savedVarianceDesc: miopenTensorDescriptor_t,
bnScale: *const ::std::os::raw::c_void,
bnBias: *const ::std::os::raw::c_void,
resultBnScaleDiff: *mut ::std::os::raw::c_void,
resultBnBiasDiff: *mut ::std::os::raw::c_void,
epsilon: f64,
savedMean: *const ::std::os::raw::c_void,
savedInvVariance: *const ::std::os::raw::c_void,
activDesc: miopenActivationDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @addtogroup activation\n\n @{\n/\n/*! @brief Creates the Activation descriptor object\n\n @param activDesc Pointer to an activation tensor descriptor type\n @return miopenStatus_t"]
pub fn miopenCreateActivationDescriptor(
activDesc: *mut miopenActivationDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the activation layer descriptor details\n\n Sets all of the descriptor details for the activation layer\n\n @param activDesc Pointer to a activation layer descriptor (output)\n @param mode Activation mode enum (input)\n @param activAlpha Alpha value for some activation modes (input)\n @param activBeta Beta value for some activation modes (input)\n @param activGamma Gamma value for some activation modes (input)\n @return miopenStatus_t"]
pub fn miopenSetActivationDescriptor(
activDesc: miopenActivationDescriptor_t,
mode: miopenActivationMode_t,
activAlpha: f64,
activBeta: f64,
activGamma: f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets the activation layer descriptor details\n\n Retrieves all of the descriptor details for the activation layer.\n\n @param activDesc Pointer to a activation layer descriptor (input)\n @param mode Activation mode enum (output)\n @param activAlpha Alpha value for some activation modes (output)\n @param activBeta Beta value for some activation modes (output)\n @param activGamma Gamma value for some activation modes (output)\n @return miopenStatus_t"]
pub fn miopenGetActivationDescriptor(
activDesc: miopenActivationDescriptor_t,
mode: *mut miopenActivationMode_t,
activAlpha: *mut f64,
activBeta: *mut f64,
activGamma: *mut f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute an activation forward layer\n\n @param handle MIOpen handle (input)\n @param activDesc Descriptor for activation layer (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @return miopenStatus_t"]
pub fn miopenActivationForward(
handle: miopenHandle_t,
activDesc: miopenActivationDescriptor_t,
alpha: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a activation backwards layer\n\n @param handle MIOpen handle (input)\n @param activDesc Descriptor for activation layer (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param yDesc Tensor descriptor for input data tensor y (input)\n @param y Data tensor y (input)\n @param dyDesc Tensor descriptor for input data tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param dxDesc Tensor descriptor for data output tensor dx (input)\n @param dx Output data delta tensor dx (output)\n @return miopenStatus_t"]
pub fn miopenActivationBackward(
handle: miopenHandle_t,
activDesc: miopenActivationDescriptor_t,
alpha: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the activation descriptor object\n\n @param activDesc Activation tensor descriptor type (input)\n @return miopenStatus_t"]
pub fn miopenDestroyActivationDescriptor(
activDesc: miopenActivationDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @addtogroup softmax\n\n @{\n/\n/*! @brief Execute a softmax forward layer\n\n This API only implements the SOFTMAX_MODE_CHANNEL in SOFTMAX_ACCURATE path.\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @return miopenStatus_t"]
pub fn miopenSoftmaxForward(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a softmax backwards layer\n\n This API only implements the SOFTMAX_MODE_CHANNEL in SOFTMAX_ACCURATE path.\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param yDesc Tensor descriptor for input data tensor y (input)\n @param y Data tensor y (input)\n @param dyDesc Tensor descriptor for input data tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param dxDesc Tensor descriptor for data output tensor dx (input)\n @param dx Output data delta tensor dx (output)\n @return miopenStatus_t"]
pub fn miopenSoftmaxBackward(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a softmax forward layer with expanded modes and algorithms\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param xDesc Tensor descriptor for data input tensor x (input)\n @param x Data tensor x (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Data tensor y (output)\n @param algorithm Softmax implementation algorithm (input)\n @param mode Softmax mode (input)\n @return miopenStatus_t"]
pub fn miopenSoftmaxForward_V2(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
algorithm: miopenSoftmaxAlgorithm_t,
mode: miopenSoftmaxMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute a softmax backwards layer with expanded modes and algorithms\n\n @param handle MIOpen handle (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param yDesc Tensor descriptor for input data tensor y (input)\n @param y Data tensor y (input)\n @param dyDesc Tensor descriptor for input data tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param dxDesc Tensor descriptor for data output tensor dx (input)\n @param dx Output data delta tensor dx (output)\n @param algorithm Softmax implementation algorithm (input)\n @param mode Softmax mode (input)\n @return miopenStatus_t"]
pub fn miopenSoftmaxBackward_V2(
handle: miopenHandle_t,
alpha: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
algorithm: miopenSoftmaxAlgorithm_t,
mode: miopenSoftmaxMode_t,
) -> miopenStatus_t;
}
#[doc = " @ingroup FUSION\n @brief MIOpen fusion interface"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenFusionPlanDescriptor {
pub _address: u8,
}
#[doc = " @ingroup FUSION\n @brief MIOpen fusion interface"]
pub type miopenFusionPlanDescriptor_t = *mut miopenFusionPlanDescriptor;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenOperatorDescriptor {
pub _address: u8,
}
pub type miopenOperatorDescriptor_t = *mut miopenOperatorDescriptor;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenOperatorArgs {
pub _address: u8,
}
pub type miopenOperatorArgs_t = *mut miopenOperatorArgs;
#[doc = "< fuses layers vertically, current the only supported mode"]
pub const miopenFusionDirection_t_miopenVerticalFusion: miopenFusionDirection_t = 0;
#[doc = "< fuses layers horizontally, this is unimplemented"]
pub const miopenFusionDirection_t_miopenHorizontalFusion: miopenFusionDirection_t = 1;
#[doc = " @enum miopenFusionDirection_t\n @brief Kernel fusion direction in the network"]
pub type miopenFusionDirection_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Creates the kenrel fusion plan descriptor object\n\n @param fusePlanDesc Pointer to a fusion plan (output)\n @param fuseDirection Horizontal or Vertical fusion (input)\n @param inputDesc Descriptor to tensor for the input (input)\n @return miopenStatus_t"]
pub fn miopenCreateFusionPlan(
fusePlanDesc: *mut miopenFusionPlanDescriptor_t,
fuseDirection: miopenFusionDirection_t,
inputDesc: miopenTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy the fusion plan descriptor object\n\n @param fusePlanDesc A fusion plan descriptor type\n @return miopenStatus_t"]
pub fn miopenDestroyFusionPlan(fusePlanDesc: miopenFusionPlanDescriptor_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Compiles the fusion plan\n\n @param handle MIOpen handle (input)\n @param fusePlanDesc A fusion plan descriptor (input)\n @return miopenStatus_t"]
pub fn miopenCompileFusionPlan(
handle: miopenHandle_t,
fusePlanDesc: miopenFusionPlanDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Allows access to the operators in a fusion plan\n @details This api call does bounds checking on the supplied op_idx and would\n return miopenStatusError if the index is out of bounds\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param op_idx Index of the required operator in the fusion plan, in the order of insertion\n @param op returned pointer to the operator\n @return miopenStatus_t"]
pub fn miopenFusionPlanGetOp(
fusePlanDesc: miopenFusionPlanDescriptor_t,
op_idx: ::std::os::raw::c_int,
op: *mut miopenFusionOpDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the workspace size required for the fusion plan\n @param handle MIOpen handle (input)\n @param fusePlanDesc A fusion plan descriptor (input)\n @param workSpaceSize Pointer to memory to return size in bytes (output)\n @param algo Algorithm selected (inputs)\n @return miopenStatus_t"]
pub fn miopenFusionPlanGetWorkSpaceSize(
handle: miopenHandle_t,
fusePlanDesc: miopenFusionPlanDescriptor_t,
workSpaceSize: *mut usize,
algo: miopenConvFwdAlgorithm_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Returns the supported algorithms for the convolution operator in the Fusion Plan\n\n @details A Convolution operator in a fusion plan may be implemented by different algorithms\n representing different tradeoffs of memory and performance. The returned list of algorithms\n is sorted in decreasing order of priority. Therefore, if the user does not request an\n algorithm to be set using the miopenFusionPlanConvolutionSetAlgo call, the first algorithm\n in the list would be used to execute the convolution in the fusion plan. Moreover this call\n must be immediately preceded by the miopenCreateOpConvForward call for the op in question.\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param requestAlgoCount Number of algorithms to return (input)\n @param returnedAlgoCount The actual number of returned algorithms; always be less than\n equal to requestAlgoCount (output)\n @param returnedAlgos Pointer to the list of supported algorithms\n @return miopenStatus_t"]
pub fn miopenFusionPlanConvolutionGetAlgo(
fusePlanDesc: miopenFusionPlanDescriptor_t,
requestAlgoCount: ::std::os::raw::c_int,
returnedAlgoCount: *mut ::std::os::raw::c_int,
returnedAlgos: *mut miopenConvFwdAlgorithm_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Requests the fusion runtime to choose a particular algorithm for the added convolution\n operation\n\n @details Please see the description for miopenFusionPlanConvolutionGetAlgo\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param algo Requested algorithm for the convolution operator (input)\n @return miopenStatus_t"]
pub fn miopenFusionPlanConvolutionSetAlgo(
fusePlanDesc: miopenFusionPlanDescriptor_t,
algo: miopenConvFwdAlgorithm_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates forward convolution operator.\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param convOp Pointer to an operator type (output)\n @param convDesc Convolution layer descriptor (input)\n @param wDesc Descriptor for the weights tensor (input)\n @return miopenStatus_t"]
pub fn miopenCreateOpConvForward(
fusePlanDesc: miopenFusionPlanDescriptor_t,
convOp: *mut miopenFusionOpDescriptor_t,
convDesc: miopenConvolutionDescriptor_t,
wDesc: miopenTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a forward activation operator.\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param activFwdOp Pointer to an operator type (output)\n @param mode Activation version (input)\n @return miopenStatus_t"]
pub fn miopenCreateOpActivationForward(
fusePlanDesc: miopenFusionPlanDescriptor_t,
activFwdOp: *mut miopenFusionOpDescriptor_t,
mode: miopenActivationMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a backward activation operator.\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param activBwdOp Pointer to an operator type (output)\n @param mode Activation version (input)\n @return miopenStatus_t"]
pub fn miopenCreateOpActivationBackward(
fusePlanDesc: miopenFusionPlanDescriptor_t,
activBwdOp: *mut miopenFusionOpDescriptor_t,
mode: miopenActivationMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a forward bias operator.\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param biasOp Pointer to an operator type (output)\n @param bDesc bias tensor descriptor (input)\n @return miopenStatus_t"]
pub fn miopenCreateOpBiasForward(
fusePlanDesc: miopenFusionPlanDescriptor_t,
biasOp: *mut miopenFusionOpDescriptor_t,
bDesc: miopenTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a forward inference batch normalization operator.\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param bnOp Pointer to an operator type (output)\n @param bn_mode Batch normalization layer mode (input)\n @param bnScaleBiasMeanVarDesc Gamma, beta, mean, variance tensor descriptor (input)\n @return miopenStatus_t"]
pub fn miopenCreateOpBatchNormInference(
fusePlanDesc: miopenFusionPlanDescriptor_t,
bnOp: *mut miopenFusionOpDescriptor_t,
bn_mode: miopenBatchNormMode_t,
bnScaleBiasMeanVarDesc: miopenTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a forward training batch normalization operator.\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param bnFwdOp Pointer to an operator type (output)\n @param bn_mode Batch normalization layer mode (input)\n @param runningMeanVariance Toggles whether or not to save population statistics for inference;\n batch statistic are required (input)\n @return miopenStatus_t"]
pub fn miopenCreateOpBatchNormForward(
fusePlanDesc: miopenFusionPlanDescriptor_t,
bnFwdOp: *mut miopenFusionOpDescriptor_t,
bn_mode: miopenBatchNormMode_t,
runningMeanVariance: bool,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates a back propagation batch normalization operator.\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param bnBwdOp Pointer to an operator type (output)\n @param bn_mode Batch normalization layer mode (input)\n @return miopenStatus_t"]
pub fn miopenCreateOpBatchNormBackward(
fusePlanDesc: miopenFusionPlanDescriptor_t,
bnBwdOp: *mut miopenFusionOpDescriptor_t,
bn_mode: miopenBatchNormMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates an operator argument object\n\n @param args Pointer to an operator argument type (output)\n @return miopenStatus_t"]
pub fn miopenCreateOperatorArgs(args: *mut miopenOperatorArgs_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys an operator argument object\n\n @param args An operator argument type (output)\n @return miopenStatus_t"]
pub fn miopenDestroyOperatorArgs(args: miopenOperatorArgs_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the arguments for forward convolution op\n\n @param args An arguments object type (output)\n @param convOp Forward convolution operator (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param w Pointer to tensor memory (input)\n @return miopenStatus_t"]
pub fn miopenSetOpArgsConvForward(
args: miopenOperatorArgs_t,
convOp: miopenFusionOpDescriptor_t,
alpha: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
w: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the arguments for forward activation op\n\n @param args An arguments object type (output)\n @param activFwdOp Activation backwards operator (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param activAlpha Double precision activation parameter which depends on activation mode (input)\n @param activBeta Double precision activation parameter which depends on activation mode (input)\n @param activGamma Double precision activation parameter which depends on activation mode (input)\n @return miopenStatus_t"]
pub fn miopenSetOpArgsActivForward(
args: miopenOperatorArgs_t,
activFwdOp: miopenFusionOpDescriptor_t,
alpha: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
activAlpha: f64,
activBeta: f64,
activGamma: f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the arguments for backward activation op\n\n @param args An arguments object type (output)\n @param activBwdOp Activation backwards operator (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param y Data tensor y, output of activations in the forward direction (input)\n @param reserved Data tensor reserved memory space; currently should be nullptr (input)\n @param activAlpha Double precision activation parameter which depends on activation mode (input)\n @param activBeta Double precision activation parameter which depends on activation mode (input)\n @param activGamma Double precision activation parameter which depends on activation mode (input)\n @return miopenStatus_t"]
pub fn miopenSetOpArgsActivBackward(
args: miopenOperatorArgs_t,
activBwdOp: miopenFusionOpDescriptor_t,
alpha: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
y: *const ::std::os::raw::c_void,
reserved: *const ::std::os::raw::c_void,
activAlpha: f64,
activBeta: f64,
activGamma: f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the arguments for inference batch normalization op\n\n @param args An arguments object type (output)\n @param bnOp Batch normalization inference operator (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param bnScale Pointer to the gamma tensor memory (input)\n @param bnBias Pointer to the beta tensor memory (input)\n @param estimatedMean Pointer to population mean memory (input)\n @param estimatedVariance Pointer to population variance memory (input)\n @param epsilon Scalar value for numerical stability (input)\n @return miopenStatus_t"]
pub fn miopenSetOpArgsBatchNormInference(
args: miopenOperatorArgs_t,
bnOp: miopenFusionOpDescriptor_t,
alpha: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
bnScale: *const ::std::os::raw::c_void,
bnBias: *const ::std::os::raw::c_void,
estimatedMean: *const ::std::os::raw::c_void,
estimatedVariance: *const ::std::os::raw::c_void,
epsilon: f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the arguments for forward batch normalization op\n\n @param args An arguments object type (output)\n @param bnOp Batch normalization forward operator (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param bnScale Pointer to the gamma tensor memory (input)\n @param bnBias Pointer to the beta tensor memory (input)\n @param savedMean Pointer to batch mean memory (input)\n @param savedInvVariance Pointer to batch inverse variance memory (input)\n @param runningMean Pointer to population mean memory (input)\n @param runningVariance Pointer to population variance memory (input)\n @param expAvgFactor Scalar value for control of population statistics (input)\n @param epsilon Scalar value for numerical stability (input)\n @return miopenStatus_t"]
pub fn miopenSetOpArgsBatchNormForward(
args: miopenOperatorArgs_t,
bnOp: miopenFusionOpDescriptor_t,
alpha: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
bnScale: *const ::std::os::raw::c_void,
bnBias: *const ::std::os::raw::c_void,
savedMean: *mut ::std::os::raw::c_void,
savedInvVariance: *mut ::std::os::raw::c_void,
runningMean: *mut ::std::os::raw::c_void,
runningVariance: *mut ::std::os::raw::c_void,
expAvgFactor: f64,
epsilon: f64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the arguments for backward batch normalization op\n\n @param args An arguments object type (output)\n @param bnOp Batch normalization forward operator (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param x Pointer to the forward input tensor memory (input)\n @param bnScale Pointer to the gamma tensor memory (input)\n @param bnBias Pointer to the beta tensor memory (input)\n @param resultBnScaleDiff Pointer to the gamma gradient tensor memory (output)\n @param resultBnBiasDiff Pointer to the beta gradient tensor memory (output)\n @param savedMean Pointer to batch mean memory (input)\n @param savedInvVariance Pointer to batch inverse variance memory (input)\n @return miopenStatus_t"]
pub fn miopenSetOpArgsBatchNormBackward(
args: miopenOperatorArgs_t,
bnOp: miopenFusionOpDescriptor_t,
alpha: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
x: *const ::std::os::raw::c_void,
bnScale: *const ::std::os::raw::c_void,
bnBias: *const ::std::os::raw::c_void,
resultBnScaleDiff: *mut ::std::os::raw::c_void,
resultBnBiasDiff: *mut ::std::os::raw::c_void,
savedMean: *const ::std::os::raw::c_void,
savedInvVariance: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the arguments for forward bias op\n\n @param args An arguments object type (output)\n @param biasOp Forward bias operator (input)\n @param alpha Floating point scaling factor, allocated on the host (input)\n @param beta Floating point shift factor, allocated on the host (input)\n @param bias Pointer to the forward bias input tensor memory (input)\n @return miopenStatus_t"]
pub fn miopenSetOpArgsBiasForward(
args: miopenOperatorArgs_t,
biasOp: miopenFusionOpDescriptor_t,
alpha: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
bias: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Executes the fusion plan. Only compatible with NHWC/NDHWC tensor layouts.\n\n @deprecated This function is deprecated and may be removed in a future release.\n Use miopenExecuteFusionPlan_v2 instead.\n\n @param handle MIOpen handle (input)\n @param fusePlanDesc fused plan descriptor (input)\n @param inputDesc Descriptor of the input tensor (input)\n @param input Source data tensor (input)\n @param outputDesc Descriptor of the output tensor (input)\n @param output Destination data tensor (output)\n @param args An argument object of the fused kernel (input)\n @return miopenStatus_t"]
pub fn miopenExecuteFusionPlan(
handle: miopenHandle_t,
fusePlanDesc: miopenFusionPlanDescriptor_t,
inputDesc: miopenTensorDescriptor_t,
input: *const ::std::os::raw::c_void,
outputDesc: miopenTensorDescriptor_t,
output: *mut ::std::os::raw::c_void,
args: miopenOperatorArgs_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Executes the fusion plan with a workspace buffer for layout transformations.\n\n\n @param handle MIOpen handle (input)\n @param fusePlanDesc fused plan descriptor (input)\n @param inputDesc Descriptor of the input tensor (input)\n @param input Source data tensor (input)\n @param outputDesc Descriptor of the output tensor (input)\n @param output Destination data tensor (output)\n @param args An argument object of the fused kernel (input)\n @param workspace A pointer to an intermediate workspace (input)\n @param workspaceSize Size of the memory in bytes pointed to by workSpace above (input)\n @return miopenStatus_t"]
pub fn miopenExecuteFusionPlan_v2(
handle: miopenHandle_t,
fusePlanDesc: miopenFusionPlanDescriptor_t,
inputDesc: miopenTensorDescriptor_t,
input: *const ::std::os::raw::c_void,
outputDesc: miopenTensorDescriptor_t,
output: *mut ::std::os::raw::c_void,
args: miopenOperatorArgs_t,
workspace: *mut ::std::os::raw::c_void,
workspaceSize: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Prepares and executes the Convlution+Bias+Activation Fusion.\n\n\n @param handle MIOpen handle (input)\n @param alpha1 floating point scaling factor, allocated on the host (input)\n @param xDesc Tensor descriptor for input data tensor x (input)\n @param x Data tensor x (input)\n @param wDesc Tensor descriptor for weight tensor w (input)\n @param w Weights tensor w (input)\n @param convDesc Convolution layer descriptor (input)\n @param algo Algorithm selected (inputs)\n @param workspace Pointer to workspace required (input)\n @param workspaceSizeInBytes Size of the memory in bytes pointed to by workSpace above\n @param alpha2 floating point scaling factor, allocated on the host (input)\n @param zDesc Tensor descriptor for tensor z (input)\n @param z Data tensor z (input)\n @param biasDesc Tensor descriptor for input data tensor x (input)\n @param bias Data tensor bias (input)\n @param activationDesc Activation descriptor that specifies the activation mode\n @param yDesc Tensor descriptor for output data tensor y (input)\n @param y Output data tensor"]
pub fn miopenConvolutionBiasActivationForward(
handle: miopenHandle_t,
alpha1: *const ::std::os::raw::c_void,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
convDesc: miopenConvolutionDescriptor_t,
algo: miopenConvFwdAlgorithm_t,
workspace: *mut ::std::os::raw::c_void,
workspaceSizeInBytes: usize,
alpha2: *const ::std::os::raw::c_void,
zDesc: miopenTensorDescriptor_t,
z: *const ::std::os::raw::c_void,
biasDesc: miopenTensorDescriptor_t,
bias: *const ::std::os::raw::c_void,
activationDesc: miopenActivationDescriptor_t,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
#[doc = "< RNN with ReLU activation"]
pub const miopenRNNMode_t_miopenRNNRELU: miopenRNNMode_t = 0;
#[doc = "< RNN with tanh activation"]
pub const miopenRNNMode_t_miopenRNNTANH: miopenRNNMode_t = 1;
#[doc = "< LSTM"]
pub const miopenRNNMode_t_miopenLSTM: miopenRNNMode_t = 2;
#[doc = "< GRU"]
pub const miopenRNNMode_t_miopenGRU: miopenRNNMode_t = 3;
#[doc = " @enum miopenRNNMode_t\n RNN mode selection for rnn layer preference"]
pub type miopenRNNMode_t = ::std::os::raw::c_uint;
#[doc = "< Matrix multiplication at the input of the first layer"]
pub const miopenRNNInputMode_t_miopenRNNlinear: miopenRNNInputMode_t = 0;
#[doc = "< No operation is performed at the input of the first layer."]
pub const miopenRNNInputMode_t_miopenRNNskip: miopenRNNInputMode_t = 1;
#[doc = " @enum miopenRNNInputMode_t\n Recurrent Neural Network layer initial input mode"]
pub type miopenRNNInputMode_t = ::std::os::raw::c_uint;
#[doc = "< Use dedicated gate-operation kernel for LSTM and fundamental\nalgorithm for vanilla RNN & GRU"]
pub const miopenRNNAlgo_t_miopenRNNdefault: miopenRNNAlgo_t = 0;
#[doc = "< Deprecated, low performance. Function by basic tensor\noperations, supported for vanilla RNN, LSTM, GRU"]
pub const miopenRNNAlgo_t_miopenRNNfundamental: miopenRNNAlgo_t = 1;
#[doc = "< The algorithm rounds some RNN parameters upwards\nto utilize the most optimal GEMM kernel in the computation."]
pub const miopenRNNAlgo_t_miopenRNNroundedDynamic: miopenRNNAlgo_t = 2;
#[doc = " @enum miopenRNNAlgo_t\n Recurrent Neural Network algorithm mode"]
pub type miopenRNNAlgo_t = ::std::os::raw::c_uint;
#[doc = "< Forward in time only."]
pub const miopenRNNDirectionMode_t_miopenRNNunidirection: miopenRNNDirectionMode_t = 0;
#[doc = "< Forward and backwards in time."]
pub const miopenRNNDirectionMode_t_miopenRNNbidirection: miopenRNNDirectionMode_t = 1;
#[doc = " @enum miopenRNNDirectionMode_t\n Recurrent Neural Network bi-directional behavior"]
pub type miopenRNNDirectionMode_t = ::std::os::raw::c_uint;
#[doc = "< No Biases will be applied to GEMM operations"]
pub const miopenRNNBiasMode_t_miopenRNNNoBias: miopenRNNBiasMode_t = 0;
#[doc = "< Biases will be applied to GEMM operations"]
pub const miopenRNNBiasMode_t_miopenRNNwithBias: miopenRNNBiasMode_t = 1;
#[doc = " @enum miopenRNNBiasMode_t\n Recurrent Neural Network add on bias"]
pub type miopenRNNBiasMode_t = ::std::os::raw::c_uint;
pub const miopenRNNGEMMalgoMode_t_miopenRNNAlgoGEMM: miopenRNNGEMMalgoMode_t = 0;
#[doc = " @enum miopenRNNGEMMalgoMode_t\n Recurrent Neural Network add on bias"]
pub type miopenRNNGEMMalgoMode_t = ::std::os::raw::c_uint;
#[doc = "< Not padded data at RNN input/output"]
pub const miopenRNNPaddingMode_t_miopenRNNIONotPadded: miopenRNNPaddingMode_t = 0;
#[doc = "< Padded data at RNN input/output"]
pub const miopenRNNPaddingMode_t_miopenRNNIOWithPadding: miopenRNNPaddingMode_t = 1;
#[doc = " @enum miopenRNNPaddingMode_t\n Recurrent Neural Network input/output data padding mode"]
pub type miopenRNNPaddingMode_t = ::std::os::raw::c_uint;
#[doc = "< FWD, BWD, WRW"]
pub const miopenRNNFWDMode_t_miopenRNNTraining: miopenRNNFWDMode_t = 0;
#[doc = "< Only FWD-inference no back-propagation"]
pub const miopenRNNFWDMode_t_miopenRNNInference: miopenRNNFWDMode_t = 1;
#[doc = " @enum miopenRNNFWDMode_t\n Recurrent Neural Network Training/Inference mode"]
pub type miopenRNNFWDMode_t = ::std::os::raw::c_uint;
pub const miopenRNNBaseLayout_t_miopenRNNDataUnknownLayout: miopenRNNBaseLayout_t = 0;
pub const miopenRNNBaseLayout_t_miopenRNNDataSeqMajorNotPadded: miopenRNNBaseLayout_t = 1;
pub const miopenRNNBaseLayout_t_miopenRNNDataSeqMajorPadded: miopenRNNBaseLayout_t = 2;
pub const miopenRNNBaseLayout_t_miopenRNNDataBatchMajorPadded: miopenRNNBaseLayout_t = 3;
#[doc = " @enum miopenRNNBaseLayout_t\n Data layouts for RNN operations"]
pub type miopenRNNBaseLayout_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Create a RNN layer Descriptor\n\n API for creating an uninitialized RNN layer descriptor.\n @param rnnDesc Pointer to a tensor descriptor type\n @return miopenStatus_t"]
pub fn miopenCreateRNNDescriptor(rnnDesc: *mut miopenRNNDescriptor_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Retrieves a RNN layer descriptor's details\n\n @param rnnDesc RNN layer descriptor (input)\n @param rnnMode RNN mode (output)\n @param algoMode RNN algorithm mode (output)\n @param inputMode RNN data input mode (output)\n @param dirMode Uni or bi direction mode (output)\n @param biasMode Bias used (output)\n @param hiddenSize Size of hidden state (output)\n @param layer Number of stacked layers (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNDescriptor(
rnnDesc: miopenRNNDescriptor_t,
rnnMode: *mut miopenRNNMode_t,
algoMode: *mut miopenRNNAlgo_t,
inputMode: *mut miopenRNNInputMode_t,
dirMode: *mut miopenRNNDirectionMode_t,
biasMode: *mut miopenRNNBiasMode_t,
hiddenSize: *mut ::std::os::raw::c_int,
layer: *mut ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Retrieves a RNN layer descriptor's details version 2. This version enables retrieving\n information of the dropout descriptor of the rnn descriptor.\n\n @param rnnDesc RNN layer descriptor (input)\n @param hiddenSize Size of hidden state (output)\n @param layer Number of stacked layers (output)\n @param dropoutDesc Pre-configured dropout descriptor for dropout layer in between RNN layers\n (output)\n @param inputMode RNN data input mode (output)\n @param dirMode Uni or bi direction mode (output)\n @param rnnMode RNN mode (output)\n @param biasMode Bias used (output)\n @param algoMode RNN algorithm mode (output)\n @param dataType Data type of RNN (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNDescriptor_V2(
rnnDesc: miopenRNNDescriptor_t,
hiddenSize: *mut ::std::os::raw::c_int,
layer: *mut ::std::os::raw::c_int,
dropoutDesc: *mut miopenDropoutDescriptor_t,
inputMode: *mut miopenRNNInputMode_t,
dirMode: *mut miopenRNNDirectionMode_t,
rnnMode: *mut miopenRNNMode_t,
biasMode: *mut miopenRNNBiasMode_t,
algoMode: *mut miopenRNNAlgo_t,
dataType: *mut miopenDataType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the tensor descriptor object\n\n @param rnnDesc RNN tensor descriptor type (input)\n @return miopenStatus_t"]
pub fn miopenDestroyRNNDescriptor(rnnDesc: miopenRNNDescriptor_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set the details of the RNN descriptor\n\n Interface for setting the values of the RNN descriptor object. This function requires specific\n algorithm selection.\n @param rnnDesc RNN layer descriptor type (input)\n @param hsize Hidden layer size (input)\n @param nlayers Number of layers (input)\n @param inMode RNN first layer input mode (input)\n @param direction RNN direction (input)\n @param rnnMode RNN model type (input)\n @param biasMode RNN bias included (input)\n @param algo RNN algorithm selected (input)\n @param dataType MIOpen datatype (input)\n @return miopenStatus_t"]
pub fn miopenSetRNNDescriptor(
rnnDesc: miopenRNNDescriptor_t,
hsize: ::std::os::raw::c_int,
nlayers: ::std::os::raw::c_int,
inMode: miopenRNNInputMode_t,
direction: miopenRNNDirectionMode_t,
rnnMode: miopenRNNMode_t,
biasMode: miopenRNNBiasMode_t,
algo: miopenRNNAlgo_t,
dataType: miopenDataType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set the details of the RNN descriptor version 2. This version enables the use of dropout\n in rnn.\n\n Interface for setting the values of the RNN descriptor object. This function requires specific\n algorithm selection.\n @param rnnDesc RNN layer descriptor type (input/output)\n @param hsize Hidden layer size (input)\n @param nlayers Number of layers (input)\n @param dropoutDesc Pre-initialized dropout descriptor for dropout layer in between RNN layers\n (input)\n @param inMode RNN first layer input mode (input)\n @param direction RNN direction (input)\n @param rnnMode RNN model type (input)\n @param biasMode RNN bias included (input)\n @param algo RNN algorithm selected (input)\n @param dataType MIOpen datatype (input)\n @return miopenStatus_t"]
pub fn miopenSetRNNDescriptor_V2(
rnnDesc: miopenRNNDescriptor_t,
hsize: ::std::os::raw::c_int,
nlayers: ::std::os::raw::c_int,
dropoutDesc: miopenDropoutDescriptor_t,
inMode: miopenRNNInputMode_t,
direction: miopenRNNDirectionMode_t,
rnnMode: miopenRNNMode_t,
biasMode: miopenRNNBiasMode_t,
algo: miopenRNNAlgo_t,
dataType: miopenDataType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set shape of RNN seqData tensor\n\n Interface for setting tensor shape to be used as RNN input data\n\n @param seqTensorDesc Tensor descriptor (input/output)\n @param dataType MIOpen datatype (input)\n @param layout One of the main supported layouts for RNN data(input)\n @param maxSequenceLen Sequence length limit within this SeqTensor(input)\n @param batchSize Number of sequences within this SeqTensor (input)\n @param vectorSize Vector size (input)\n @param sequenceLenArray Array containing the length of each sequence in the SeqTensor(input)\n @param paddingMarker Not used, should be NULL (input)\n @return miopenStatus_t"]
pub fn miopenSetRNNDataSeqTensorDescriptor(
seqTensorDesc: miopenSeqTensorDescriptor_t,
dataType: miopenDataType_t,
layout: miopenRNNBaseLayout_t,
maxSequenceLen: ::std::os::raw::c_int,
batchSize: ::std::os::raw::c_int,
vectorSize: ::std::os::raw::c_int,
sequenceLenArray: *const ::std::os::raw::c_int,
paddingMarker: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get shape of RNN seqData tensor\n\n Interface for setting tensor shape to be used as RNN input data\n\n @param seqTensorDesc Tensor descriptor (input)\n @param dataType MIOpen datatype (output)\n @param layout One of the main supported layouts for RNN data(output)\n @param maxSequenceLen Sequence length limit within this SeqTensor(output)\n @param batchSize Number of sequences within this SeqTensor (output)\n @param vectorSize Vector size (output)\n @param sequenceLenArrayLimit Limit for number of elements that can be returned to user\n by sequenceLenArray (input)\n @param sequenceLenArray Array containing the length of each sequence in the\n SeqTensor. This is allowed to be a NULL pointer if sequenceLenArrayLimit is 0 (output)\n @param paddingMarker Not used, should be NULL (input)\n @return miopenStatus_t"]
pub fn miopenGetRNNDataSeqTensorDescriptor(
seqTensorDesc: miopenSeqTensorDescriptor_t,
dataType: *mut miopenDataType_t,
layout: *mut miopenRNNBaseLayout_t,
maxSequenceLen: *mut ::std::os::raw::c_int,
batchSize: *mut ::std::os::raw::c_int,
vectorSize: *mut ::std::os::raw::c_int,
sequenceLenArrayLimit: ::std::os::raw::c_int,
sequenceLenArray: *mut ::std::os::raw::c_int,
paddingMarker: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the amount of memory required to execute the RNN layer\n\n This function calculates the amount of memory required to run the RNN layer given an RNN\n descriptor and a tensor descriptor.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param sequenceLen Number of iteration unrolls (input)\n @param xDesc An array of tensor descriptors. These are the\n input descriptors to each time step. The first dimension of each descriptor is the\n batch size and may decrease from element n to element n+1 and not increase in size.\n The second dimension is the same for all descriptors in the array and is the input\n vector length. (input)\n @param numBytes Number of bytes required for RNN layer execution (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNWorkspaceSize(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
sequenceLen: ::std::os::raw::c_int,
xDesc: *const miopenTensorDescriptor_t,
numBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the amount of memory required for RNN training\n\n This function calculates the amount of memory required to train the RNN layer given an\n RNN descriptor and a tensor descriptor.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param sequenceLen Number of iteration unrolls (input)\n @param xDesc An array of tensor descriptors. These are the\n input descriptors to each time step. The first dimension of each descriptor is the\n batch size and may decrease from element n to element n+1 and not increase in size.\n The second dimension is the same for all descriptors in the array and is the input\n vector length. (input)\n @param numBytes Number of bytes required for RNN layer execution (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNTrainingReserveSize(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
sequenceLen: ::std::os::raw::c_int,
xDesc: *const miopenTensorDescriptor_t,
numBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the amount of additional memory required for this RNN layer execution.\n\n This function calculates the size of extra buffers, depending on the layer configuration, which\n is determined by: RNN descriptor, isInference, and data descriptor. If isInference is True,\n reserve_space_size is always zero, because the reserve_space buffer is not used in Inference\n computation.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param xDesc Sequence data tensor descriptor (input)\n @param fwdMode Specifies in which mode the buffers will be used.\n @param workSpaceSize Minimum WorkSpace buffer size required for RNN layer execution (output)\n @param reserveSpaceSize Minimum ReserveSpaceSize buffer size required for RNN layer execution\n (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNTempSpaceSizes(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
xDesc: miopenSeqTensorDescriptor_t,
fwdMode: miopenRNNFWDMode_t,
workSpaceSize: *mut usize,
reserveSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the amount of parameter memory required for RNN training\n\n This function calculates the amount of parameter memory required to train the RNN layer given an\n RNN descriptor and a tensor descriptor.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param xDesc A tensor descriptor (input)\n @param numBytes Number of bytes required for RNN layer execution (output)\n @param dtype MIOpen data type enum (input)\n @return miopenStatus_t"]
pub fn miopenGetRNNParamsSize(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
xDesc: miopenTensorDescriptor_t,
numBytes: *mut usize,
dtype: miopenDataType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Obtain a weight tensor descriptor for RNNs\n\n This function populates a weight descriptor that describes the memory layout of the\n weight matrix.\n\n @param handle MIOpen handle (input)\n @param rnnDesc Fully populated RNN layer descriptor type (input)\n @param xDesc A previously populated tensor descriptor (input)\n @param wDesc A previously allocated tensor descriptor (output)\n @param dtype MIOpen data type enum (input)\n @return miopenStatus_t"]
pub fn miopenGetRNNParamsDescriptor(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
xDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
dtype: miopenDataType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Obtain the size in bytes of the RNN input tensor\n\n This function determines the size in bytes of the allocation needed for the input data\n tensor for an RNN layer. The number of bytes is derived from the array of\n tensor descriptors.\n\n @param handle MIOpen handle (input)\n @param rnnDesc Fully populated RNN layer descriptor (input)\n @param seqLen Number of iteration unrolls (input)\n @param xDesc An array of tensor descriptors. These are the\n input descriptors to each time step. The first dimension of each descriptor is the\n batch size and may decrease from element n to element n+1 and not increase in size.\n The second dimension is the same for all descriptors in the array and is the input\n vector length. (input)\n @param numBytes Number of bytes required for input tensor (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNInputTensorSize(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
seqLen: ::std::os::raw::c_int,
xDesc: *mut miopenTensorDescriptor_t,
numBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Obtain the size in bytes of the RNN hidden tensor\n\n This function determines the size in bytes of the allocation needed for the\n hidden tensor over all layers\n\n @param handle MIOpen handle (input)\n @param rnnDesc Fully populated RNN layer descriptor type (input)\n @param seqLen Number of iteration unrolls (input)\n @param xDesc An array of previously populated tensor descriptors (input)\n @param numBytes Number of bytes required for input tensor (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNHiddenTensorSize(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
seqLen: ::std::os::raw::c_int,
xDesc: *mut miopenTensorDescriptor_t,
numBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets the number of bytes of a parameter matrix\n\n\n For RNN vanilla miopenRNNRELU and miopenRNNTANH, paramID == 0 retrieves the\n weight matrix associated with the in input GEMM, while paramID == 1 retrieves\n the weight matrix associated with the hidden state GEMM.\n\n For miopenLSTM paramID 0 to 3 refer to the weight matrices associated\n with the input GEMM, 4-7 are associated with matrices associated with the\n hidden state GEMM.\n\n * paramID 0 and 4 are for the input gate.\n\n * paramID 1 and 5 are for the forget gate.\n\n * paramID 2 and 6 are for the output gate.\n\n * paramID 3 and 7 are for the new memory gate.\n\n For miopenGRU paramID 0 to 2 refer to the weight matrix offset associated\n with the input GEMM, while 3 through 5 are associated with the hidden state\n GEMM.\n\n * paramID 0 and 3 are for the update gate.\n\n * paramID 1 and 4 are for the reset gate.\n\n * paramID 2 and 5 are for the new memory gate.\n\n For bi-directional RNNs the backwards in time direction is numbered as the layer\n directly after the forward in time direction.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param layer The layer number in the RNN stack (input)\n @param xDesc A tensor descriptor to input (input)\n @param paramID ID of the internal parameter tensor (input)\n @param numBytes The number of bytes of the layer's parameter matrix (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNLayerParamSize(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
layer: ::std::os::raw::c_int,
xDesc: miopenTensorDescriptor_t,
paramID: ::std::os::raw::c_int,
numBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets the number of bytes of a bias\n\n For RNN vanilla miopenRNNRELU and miopenRNNTANH, biasID == 0 retrieves the\n weight matrix associated with the in input GEMM, while biasID == 1 retrieves\n the bias associated with the hidden state GEMM.\n\n For miopenLSTM biasID 0 to 3 refer to the biases associated\n with the input GEMM, 4-7 are associated with biases associated with the\n hidden state GEMM.\n\n * biasID 0 and 4 are for the input gate.\n\n * biasID 1 and 5 are for the forget gate.\n\n * biasID 2 and 6 are for the output gate.\n\n * biasID 3 and 7 are for the new memory gate.\n\n For miopenGRU biasID 0 to 2 refer to the biases associated with the input GEMM,\n while 3 through 5 are associated with the hidden state GEMM.\n\n * biasID 0 and 3 are for the update gate.\n\n * biasID 1 and 4 are for the reset gate.\n\n * biasID 2 and 5 are for the new memory gate.\n\n For bi-directional RNNs the backwards in time direction is numbered as the layer\n directly after the forward in time direction.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param layer The layer number in the RNN stack (input)\n @param biasID ID of the internal parameter tensor (input)\n @param numBytes The number of bytes of the layer's bias (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNLayerBiasSize(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
layer: ::std::os::raw::c_int,
biasID: ::std::os::raw::c_int,
numBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets a weight matrix for a specific layer in an RNN stack\n\n This function retrieves the weight matrix data for a specific layer and parameter ID\n and copies the data into previously allocated device memory.\n\n For RNN vanilla miopenRNNRELU and miopenRNNTANH, paramID == 0 retrieves the\n weight matrix associated with the in input GEMM, while paramID == 1 retrieves\n the weight matrix associated with the hidden state GEMM.\n\n For miopenLSTM paramID 0 to 3 refer to the weight matrices associated\n with the input GEMM, 4-7 are associated with matrices associated with the\n hidden state GEMM.\n\n * paramID 0 and 4 are for the input gate.\n\n * paramID 1 and 5 are for the forget gate.\n\n * paramID 2 and 6 are for the output gate.\n\n * paramID 3 and 7 are for the new memory gate.\n\n For miopenGRU paramID 0 to 2 refer to the weight matrix offset associated\n with the input GEMM, while 3 through 5 are associated with the hidden state\n GEMM.\n\n * paramID 0 and 3 are for the update gate.\n\n * paramID 1 and 4 are for the reset gate.\n\n * paramID 2 and 5 are for the new memory gate.\n\n For bi-directional RNNs the backwards in time direction is numbered as the layer\n directly after the forward in time direction.\n\n The output argument paramDesc is a previously created tensor descriptor that is populated\n to describe the memory layout of the parameter matrix. It is full packed and is used when\n calling to miopenSetRNNLayerParam()\n\n The argument layerParam should either be nullptr, or have device memory allocated\n to allow copying of the entire layer parameter matrix into it. If layerParam is\n nullptr then only the paramDesc is populated and returned. The size in bytes of the\n layer parameter matrix can be determined by using miopenGetRNNLayerParamSize().\n\n Note: When inputSkip mode is selected there is no input layer matrix operation,\n and therefore no associated memory. In this case miopenGetRNNLayerParam() will return\n a error status miopenStatusBadParm for input paramID associated with the input GEMM.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param layer The layer number in the RNN stack (input)\n @param xDesc A tensor descriptor to input (input)\n @param wDesc A tensor descriptor to the parameter tensor (input)\n @param w Pointer to memory containing parameter tensor (input)\n @param paramID ID of the internal parameter tensor (input)\n @param paramDesc Tensor descriptor for the fully packed output parameter tensor (output)\n @param layerParam Pointer to the memory location of the parameter tensor (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNLayerParam(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
layer: ::std::os::raw::c_int,
xDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
paramID: ::std::os::raw::c_int,
paramDesc: miopenTensorDescriptor_t,
layerParam: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets a bias for a specific layer in an RNN stack\n\n This function retrieves the bias data for a specific layer and bias ID and copies\n the data into previously allocated device memory.\n\n For RNN vanilla miopenRNNRELU and miopenRNNTANH, biasID == 0 retrieves the\n bias associated with the in input GEMM, while biasID == 1 retrieves\n the bias associated with the hidden state GEMM.\n\n For miopenLSTM biasID 0 to 3 refer to the biases associated\n with the input GEMM, 4-7 are associated with biases associated with the\n hidden state GEMM.\n\n * biasID 0 and 4 are for the input gate.\n\n * biasID 1 and 5 are for the forget gate.\n\n * biasID 2 and 6 are for the output gate.\n\n * biasID 3 and 7 are for the new memory gate.\n\n For miopenGRU biasID 0 to 2 refer to the biases associated with the input GEMM,\n while 3 through 5 are associated with the hidden state GEMM.\n\n * biasID 0 and 3 are for the update gate.\n\n * biasID 1 and 4 are for the reset gate.\n\n * biasID 2 and 5 are for the new memory gate.\n\n For bi-directional RNNs the backwards in time direction is numbered as the layer\n directly after the forward in time direction.\n\n The output argument biasDesc is a previously created tensor descriptor that is populated\n to describe the memory layout of the bias. It is full packed and is used when\n calling to miopenSetRNNLayerBias()\n\n The argument layerBias should either be nullptr, or have device memory allocated\n to allow copying of the entire layer bias into it. If layerBias is\n nullptr then only the biasDesc is populated and returned. The size in bytes of the\n layer bias can be determined by using miopenGetRNNLayerBiasSize().\n\n Note: When inputSkip mode is selected there is no input layer matrix operation,\n and therefore no associated memory. In this case miopenGetRNNLayerBias() will return\n a error status miopenStatusBadParm for input biasID associated with the input GEMM.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param layer The layer number in the RNN stack (input)\n @param xDesc A tensor descriptor to input (input)\n @param wDesc A tensor descriptor to the parameter tensor (input)\n @param w Pointer to memory containing parameter tensor (input)\n @param biasID ID of the internal parameter tensor (input)\n @param biasDesc Descriptor of the parameter tensor (output)\n @param layerBias Pointer to the memory location of the bias tensor (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNLayerBias(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
layer: ::std::os::raw::c_int,
xDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
biasID: ::std::os::raw::c_int,
biasDesc: miopenTensorDescriptor_t,
layerBias: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets an index offset for a specific weight matrix for a layer in the\n RNN stack\n\n This function retrieves the index offset for a weight matrix in a layer.\n\n For RNN vanilla miopenRNNRELU and miopenRNNTANH, paramID == 0 retrieves the\n weight matrix offset associated with the in input GEMM, while paramID == 1\n retrieves the weight matrix offset associated with the hidden state GEMM.\n\n For miopenLSTM paramID 0 to 3 refer to the weight matrix offsets associated\n with the input GEMM, 4-7 are associated with matrix offset associated with the\n hidden state GEMM.\n\n * paramID 0 and 4 are for the input gate.\n\n * paramID 1 and 5 are for the forget gate.\n\n * paramID 2 and 6 are for the output gate.\n\n * paramID 3 and 7 are for the new memory gate.\n\n For miopenGRU paramID 0 to 2 refer to the weight matrix offset associated\n with the input GEMM, while 3 through 5 are associated with the hidden state\n GEMM.\n\n * paramID 0 and 3 are for the update gate.\n\n * paramID 1 and 4 are for the reset gate.\n\n * paramID 2 and 5 are for the new memory gate.\n\n For bi-directional RNNs the backwards in time direction is numbered as the layer\n directly after the forward in time direction.\n\n The output argument paramDesc is a previously created tensor descriptor that is populated\n to describe the memory layout of the parameter matrix. It is full packed and is used when\n calling to miopenSetRNNLayerParam().\n\n The argument layerParamOffset should either be nullptr, or an address to place the\n offset. If layerParamOffset is nullptr then only the paramDesc is populated and returned.\n\n Note: When inputSkip mode is selected there is no input layer matrix operation,\n and therefore no associated memory. In this case miopenGetRNNLayerParamOffset() will return\n a error status miopenStatusBadParm for input paramID associated with the input GEMM.\n\n\n @param rnnDesc RNN layer descriptor type (input)\n @param layer The layer number in the RNN stack (input)\n @param xDesc A tensor descriptor to input (input)\n @param paramID ID of the internal parameter tensor (input)\n @param paramDesc Tensor descriptor for the fully packed output parameter tensor (output)\n @param layerParamOffset Location for the parameter offset (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNLayerParamOffset(
rnnDesc: miopenRNNDescriptor_t,
layer: ::std::os::raw::c_int,
xDesc: miopenTensorDescriptor_t,
paramID: ::std::os::raw::c_int,
paramDesc: miopenTensorDescriptor_t,
layerParamOffset: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets a bias index offset for a specific layer in an RNN stack\n\n This function retrieves the bias index offset for a specific layer and bias ID.\n\n For RNN vanilla miopenRNNRELU and miopenRNNTANH, biasID == 0 retrieves the\n bias associated with the in input GEMM, while biasID == 1 retrieves\n the weight matrix associated with the hidden state GEMM.\n\n For miopenLSTM biasID 0 to 3 refer to the bias offset associated\n with the input GEMM, 4-7 are the bias offsets associated with the hidden state GEMM.\n\n * biasID 0 and 4 are for the input gate.\n\n * biasID 1 and 5 are for the forget gate.\n\n * biasID 2 and 6 are for the output gate.\n\n * biasID 3 and 7 are for the new memory gate.\n\n For miopenGRU biasID 0 to 2 refer to the biases associated with the input GEMM,\n while 3 through 5 are associated with the hidden state GEMM.\n\n * biasID 0 and 3 are for the update gate.\n\n * biasID 1 and 4 are for the reset gate.\n\n * biasID 2 and 5 are for the new memory gate.\n\n For bi-directional RNNs the backwards in time direction is numbered as the layer\n directly after the forward in time direction.\n\n The output argument biasDesc is a previously created tensor descriptor that is populated\n to describe the memory layout of the bias. It is full packed and is used when\n calling to miopenSetRNNLayerBias()\n\n The argument layerBiasOffset should either be nullptr, or point to an output address.\n If layerBias is nullptr then only the biasDesc is populated and returned.\n\n Note: When inputSkip mode is selected there is no input layer matrix operation,\n and therefore no associated memory. In this case miopenGetRNNLayerBiasOffset() will return\n a error status miopenStatusBadParm for input biasID associated with the input GEMM.\n\n @param rnnDesc RNN layer descriptor type (input)\n @param layer The layer number in the RNN stack (input)\n @param xDesc A tensor descriptor to input (input)\n @param biasID ID of the internal parameter tensor (input)\n @param biasDesc Descriptor of the parameter tensor (output)\n @param layerBiasOffset Pointer to the memory location of the bias tensor (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNLayerBiasOffset(
rnnDesc: miopenRNNDescriptor_t,
layer: ::std::os::raw::c_int,
xDesc: miopenTensorDescriptor_t,
biasID: ::std::os::raw::c_int,
biasDesc: miopenTensorDescriptor_t,
layerBiasOffset: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets a weight matrix for a specific layer in an RNN stack\n\n This function sets the weight matrix data for a specific layer and parameter ID.\n\n For RNN vanilla miopenRNNRELU and miopenRNNTANH, paramID == 0 sets the\n weight matrix associated with the in input GEMM, while paramID == 1 sets\n the weight matrix associated with the hidden state GEMM.\n\n\n For miopenLSTM paramID 0 to 3 refer to the weight matrices associated\n with the input GEMM, 4-7 are associated with matrices associated with the\n hidden state GEMM.\n\n * paramID 0 and 4 are for the input gate.\n\n * paramID 1 and 5 are for the forget gate.\n\n * paramID 2 and 6 are for the output gate.\n\n * paramID 3 and 7 are for the new memory gate.\n\n For miopenGRU paramID 0 to 2 refer to the weight matrix offset associated\n with the input GEMM, while 3 through 5 are associated with the hidden state\n GEMM.\n\n * paramID 0 and 3 are for the update gate.\n\n * paramID 1 and 4 are for the reset gate.\n\n * paramID 2 and 5 are for the new memory gate.\n\n For bi-directional RNNs the backwards in time direction is numbered as the layer\n directly after the forward in time direction.\n\n The input argument paramDesc is a previously populated tensor descriptor typically\n by first calling miopenGetRNNLayerParam().\n\n Note: When inputSkip mode is selected there is no input layer matrix operation,\n and therefore no associated memory. In this case miopenSetRNNLayerParam() will return\n a error status miopenStatusBadParm for input paramID associated with the input GEMM.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param layer The layer number in the RNN stack (input)\n @param xDesc A tensor descriptor to input (input)\n @param wDesc A tensor descriptor to the parameter tensor (input)\n @param w Pointer to memory containing parameter tensor (input)\n @param paramID ID of the internal parameter tensor (input)\n @param paramDesc Descriptor of the parameter tensor (input)\n @param layerParam Pointer to the memory location of the parameter tensor (input)\n @return miopenStatus_t"]
pub fn miopenSetRNNLayerParam(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
layer: ::std::os::raw::c_int,
xDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
w: *mut ::std::os::raw::c_void,
paramID: ::std::os::raw::c_int,
paramDesc: miopenTensorDescriptor_t,
layerParam: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets a bias for a specific layer in an RNN stack\n\n This function sets the bias data for a specific layer and bias ID.\n\n For RNN vanilla miopenRNNRELU and miopenRNNTANH, biasID == 0 retrieves the\n weight matrix associated with the in input GEMM, while biasID == 1 retrieves\n the bias associated with the hidden state GEMM.\n\n For miopenLSTM biasID 0 to 3 refer to the biases associated\n with the input GEMM, 4-7 are associated with the biases associated with the\n hidden state GEMM.\n\n * biasID 0 and 4 are for the input gate.\n\n * biasID 1 and 5 are for the forget gate.\n\n * biasID 2 and 6 are for the output gate.\n\n * biasID 3 and 7 are for the new memory gate.\n\n For miopenGRU biasID 0 to 2 refer to the biases associated with the input GEMM,\n while 3 through 5 are associated with the hidden state GEMM.\n\n * biasID 0 and 3 are for the update gate.\n\n * biasID 1 and 4 are for the reset gate.\n\n * biasID 2 and 5 are for the new new memory gate.\n\n For bi-directional RNNs the backwards in time direction is numbered as the layer\n directly after the forward in time direction.\n\n The input argument biasDesc is a previously populated tensor descriptor typically\n by first calling miopenGetRNNLayeBias().\n\n Note: When inputSkip mode is selected there is no input layer matrix operation,\n and therefore no associated memory. In this case miopenSetRNNLayerBias will return\n a error status miopenStatusBadParm for input biasID associated with the input GEMM.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param layer The layer number in the RNN stack (input)\n @param xDesc A tensor descriptor to input (input)\n @param wDesc A tensor descriptor to the bias tensor (input)\n @param w Pointer to memory containing bias tensor (input)\n @param biasID ID of the internal bias tensor (input)\n @param biasDesc Descriptor of the bias tensor (output)\n @param layerBias Pointer to the memory location of the bias tensor (output)\n @return miopenStatus_t"]
pub fn miopenSetRNNLayerBias(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
layer: ::std::os::raw::c_int,
xDesc: miopenTensorDescriptor_t,
wDesc: miopenTensorDescriptor_t,
w: *mut ::std::os::raw::c_void,
biasID: ::std::os::raw::c_int,
biasDesc: miopenTensorDescriptor_t,
layerBias: *const ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets a bias for a specific layer in an RNN stack\n\n This function changes padidng mode at previously created and initialized RNN descriptor.\n This function must be called before using miopenGetRNNWorkspaceSize()\n and miopenGetRNNTrainingReserveSize() functions.\n By default, not padded data is expected at the RNN input/output.\n\n @param rnnDesc RNN layer descriptor type (input/output)\n @param paddingMode RNN input/output data padding mode (input)\n @return miopenStatus_t"]
pub fn miopenSetRNNPaddingMode(
rnnDesc: miopenRNNDescriptor_t,
paddingMode: miopenRNNPaddingMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief This function retrieves the RNN padding mode from the RNN descriptor.\n\n @param rnnDesc RNN layer descriptor type (input)\n @param paddingMode Pointer to the RNN padding mode (output)\n @return miopenStatus_t"]
pub fn miopenGetRNNPaddingMode(
rnnDesc: miopenRNNDescriptor_t,
paddingMode: *mut miopenRNNPaddingMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward training for recurrent layer.\n\n Interface for executing the forward training / inference pass on a RNN.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param fwdMode Specifies in which mode the buffers will be used.\n @param xDesc An input tensor descriptor for sequenced RNN data. This\n miopenSeqTensorDescriptor_t should be initialized by `miopenSetRNNDataSeqTensorDescriptor`\n function.(input)\n @param x Pointer to input tensor (input)\n\n @param hDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hx Pointer to the hidden layer input tensor. If hx is NULL,\n then the initial hidden state will be zero initialized. (input)\n @param hy Pointer to the hidden layer output tensor. If hy is NULL,\n then the final hidden state will not be saved. (output)\n\n @param cDesc A cell tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param cx Pointer to the cell layer input tensor. If cx is NULL,\n then the initial cell state will be zero initialized. (input)\n @param cy Pointer to the cell layer output tensor. If hy is NULL,\n then the final cell state will not be saved. (output)\n\n @param yDesc An array of fully packed tensor descriptors associated\n with the output from each time step. The first dimension of the tensor descriptors\n must equal the first dimension of the first descriptor (batch size) in the xDesc\n tensor array. The second dimension of the element of the descriptor array\n depends on the direction mode selected. If the direction mode is unidirectional,\n the second dimension is the hiddenSize. If direction mode is bidirectional\n the second dimension is twice the hiddenSize. (input)\n @param y Pointer to output tensor (output)\n\n @param w Pointer to input weights tensor (input)\n @param weightSpaceSize Number of allocated bytes in memory for the weights tensor\n @param workSpace Pointer to memory allocated for forward (input / output)\n @param workSpaceNumBytes Number of allocated bytes in memory for the workspace (input)\n @param reserveSpace Pointer to memory allocated for hidden states used during training\n (input / output)\n @param reserveSpaceNumBytes Number of allocated bytes in memory for use in the forward (input)\n @return miopenStatus_t"]
pub fn miopenRNNForward(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
fwdMode: miopenRNNFWDMode_t,
xDesc: miopenSeqTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
hDesc: miopenTensorDescriptor_t,
hx: *const ::std::os::raw::c_void,
hy: *mut ::std::os::raw::c_void,
cDesc: miopenTensorDescriptor_t,
cx: *const ::std::os::raw::c_void,
cy: *mut ::std::os::raw::c_void,
yDesc: miopenSeqTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
w: *const ::std::os::raw::c_void,
weightSpaceSize: usize,
workSpace: *mut ::std::os::raw::c_void,
workSpaceNumBytes: usize,
reserveSpace: *mut ::std::os::raw::c_void,
reserveSpaceNumBytes: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute backward data for recurrent layer\n\n Interface for executing the backward data pass on a RNN.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n\n @param yDesc An output tensor descriptor for sequenced RNN data. This\n miopenSeqTensorDescriptor_t should be initialized by `miopenSetRNNDataSeqTensorDescriptor`\nfunction.(input)\n @param y Pointer to input tensor (input)\n @param dy Pointer to the hidden layer input tensor (input)\n\n @param hDesc An input hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hx Pointer to the hidden layer input tensor. If hx is NULL,\n then the initial hidden state will be zero initialized. (input)\n @param dhy Pointer to the cell layer input tensor (input)\n @param dhx Pointer to the delta hidden layer output tensor. If dhx is NULL\n the hidden gradient will not ouput. (output)\n\n @param cDesc A input cell tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param cx Pointer to the hidden layer input tensor. If cx is NULL,\n then the initial cell state will be zero initialized. (input)\n @param dcy Pointer to the cell layer input tensor. If dcy is NULL,\n then the initial delta cell state will be zero initialized. (input)\n @param dcx Pointer to the cell layer output tensor. If dcx is NULL\n the cell gradient will not ouput. (output)\n\n @param xDesc An input tensor descriptor for sequenced RNN data. This\n miopenSeqTensorDescriptor_t should be initialized by `miopenSetRNNDataSeqTensorDescriptor`\nfunction.(input)\n @param dx Pointer to the cell layer output tensor (output)\n\n @param w Pointer to input weights tensor (input)\n @param weightSpaceSize Number of allocated bytes in memory for the weights tensor\n @param workSpace Pointer to memory allocated for forward training (input)\n @param workSpaceNumBytes Number of allocated bytes in memory for the workspace (input)\n @param reserveSpace Pointer to memory allocated for random states (input / output)\n @param reserveSpaceNumBytes Number of allocated bytes in memory for use in the forward (input)\n @return miopenStatus_t"]
pub fn miopenRNNBackwardSeqData(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
yDesc: miopenSeqTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dy: *const ::std::os::raw::c_void,
hDesc: miopenTensorDescriptor_t,
hx: *const ::std::os::raw::c_void,
dhy: *const ::std::os::raw::c_void,
dhx: *mut ::std::os::raw::c_void,
cDesc: miopenTensorDescriptor_t,
cx: *const ::std::os::raw::c_void,
dcy: *const ::std::os::raw::c_void,
dcx: *mut ::std::os::raw::c_void,
xDesc: miopenSeqTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
w: *const ::std::os::raw::c_void,
weightSpaceSize: usize,
workSpace: *mut ::std::os::raw::c_void,
workSpaceNumBytes: usize,
reserveSpace: *mut ::std::os::raw::c_void,
reserveSpaceNumBytes: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute backward weights for recurrent layer\n\n Interface for executing the backward weights pass on a RNN.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n\n @param xDesc An input tensor descriptor for sequenced RNN data. This\n miopenSeqTensorDescriptor_t should be initialized by `miopenSetRNNDataSeqTensorDescriptor`\nfunction.(input)\n @param x Pointer to input tensor (input)\n\n @param hDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hx Pointer to the hidden layer input tensor. If hx is NULL,\n then the initial hidden state will be zero initialized. (input)\n\n @param yDesc An output tensor descriptor for sequenced RNN data. This\n miopenSeqTensorDescriptor_t should be initialized by `miopenSetRNNDataSeqTensorDescriptor`\nfunction.(input)\n @param y Pointer to the output tensor (input)\n\n @param dw Pointer to input weights tensor (input / output)\n @param weightSpaceSize Number of allocated bytes in memory for the weights tensor\n @param workSpace Pointer to memory allocated for forward training (input)\n @param workSpaceNumBytes Number of allocated bytes in memory for the workspace (input)\n @param reserveSpace Pointer to memory allocated for random states (input)\n @param reserveSpaceNumBytes Number of allocated bytes in memory for use in the forward (input)\n @return miopenStatus_t"]
pub fn miopenRNNBackwardWeightsSeqTensor(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
xDesc: miopenSeqTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
hDesc: miopenTensorDescriptor_t,
hx: *const ::std::os::raw::c_void,
yDesc: miopenSeqTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dw: *mut ::std::os::raw::c_void,
weightSpaceSize: usize,
workSpace: *mut ::std::os::raw::c_void,
workSpaceNumBytes: usize,
reserveSpace: *const ::std::os::raw::c_void,
reserveSpaceNumBytes: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward training for recurrent layer\n\n Interface for executing the forward training pass on a RNN.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param sequenceLen Temporal iterations to unroll (input)\n @param xDesc An array of tensor descriptors. These are the\n input descriptors to each time step. The first dimension of each descriptor is the\n batch size and may decrease from element n to element n+1 and not increase in size.\n The second dimension is the same for all descriptors in the array and is the input\n vector length. (input)\n @param x Pointer to input tensor (input)\n @param hxDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hx Pointer to the hidden layer input tensor. If hx is NULL,\n then the initial hidden state will be zero initialized. (input)\n @param cxDesc A cell tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param cx Pointer to the cell layer input tensor. If cx is NULL,\n then the initial cell state will be zero initialized. (input)\n @param wDesc A weights tensor descriptor (input)\n @param w Pointer to input weights tensor (input)\n @param yDesc An array of fully packed tensor descriptors associated\n with the output from each time step. The first dimension of the tensor descriptors\n must equal the first dimension of the first descriptor (batch size) in the xDesc\n tensor array. The second dimension of the element of the descriptor array\n depends on the direction mode selected. If the direction mode is unidirectional,\n the second dimension is the hiddenSize. If direction mode is bidirectional\n the second dimension is twice the hiddenSize. (input)\n @param y Pointer to output tensor (output)\n @param hyDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hy Pointer to the hidden layer output tensor. If hy is NULL,\n then the final hidden state will not be saved. (output)\n @param cyDesc A cell tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param cy Pointer to the cell layer output tensor. If hy is NULL,\n then the final cell state will not be saved. (output)\n @param workSpace Pointer to memory allocated for forward training (input)\n @param workSpaceNumBytes Number of allocated bytes in memory for the workspace (input)\n @param reserveSpace Pointer to memory allocated for random states (input / output)\n @param reserveSpaceNumBytes Number of allocated bytes in memory for use in the forward (input)\n @return miopenStatus_t"]
pub fn miopenRNNForwardTraining(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
sequenceLen: ::std::os::raw::c_int,
xDesc: *const miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
hxDesc: miopenTensorDescriptor_t,
hx: *const ::std::os::raw::c_void,
cxDesc: miopenTensorDescriptor_t,
cx: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
yDesc: *const miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
hyDesc: miopenTensorDescriptor_t,
hy: *mut ::std::os::raw::c_void,
cyDesc: miopenTensorDescriptor_t,
cy: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceNumBytes: usize,
reserveSpace: *mut ::std::os::raw::c_void,
reserveSpaceNumBytes: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute backward data for recurrent layer\n\n Interface for executing the backward data pass on a RNN.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param sequenceLen Temporal iterations to unroll (input)\n @param yDesc An array of tensor descriptors (input)\n @param y Pointer to input tensor (input)\n @param dyDesc An array of fully packed tensor descriptors associated\n with the output from each time step. The first dimension of the tensor descriptors\n must equal the first dimension of the first descriptor (batch size) in the xDesc\n tensor array. The second dimension of the element of the descriptor array\n depends on the direction mode selected. If the direction mode is unidirectional,\n the second dimension is the hiddenSize. If direction mode is bidirectional\n the second dimension is twice the hiddenSize. (input)\n @param dy Pointer to the hidden layer input tensor (input)\n @param dhyDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param dhy Pointer to the cell layer input tensor (input)\n @param dcyDesc A cell tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param dcy Pointer to the cell layer input tensor. If dcy is NULL,\n then the initial delta cell state will be zero initialized. (input)\n @param wDesc A weights tensor descriptor (input)\n @param w Pointer to input weights tensor (input)\n @param hxDesc An input hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hx Pointer to the hidden layer input tensor. If hx is NULL,\n then the initial hidden state will be zero initialized. (input)\n @param cxDesc A input cell tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param cx Pointer to the hidden layer input tensor. If cx is NULL,\n then the initial cell state will be zero initialized. (input)\n @param dxDesc An array of tensor descriptors. These are the\n input descriptors to each time step. The first dimension of each descriptor is the\n batch size and may decrease from element n to element n+1 and not increase in size.\n The second dimension is the same for all descriptors in the array and is the input\n vector length. (input)\n @param dx Pointer to the cell layer output tensor (output)\n @param dhxDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param dhx Pointer to the delta hidden layer output tensor. If dhx is NULL\n the hidden gradient will not ouput. (output)\n @param dcxDesc A tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param dcx Pointer to the cell layer output tensor. If dcx is NULL\n the cell gradient will not ouput. (output)\n @param workSpace Pointer to memory allocated for forward training (input)\n @param workSpaceNumBytes Number of allocated bytes in memory for the workspace (input)\n @param reserveSpace Pointer to memory allocated for random states (input / output)\n @param reserveSpaceNumBytes Number of allocated bytes in memory for use in the forward (input)\n @return miopenStatus_t"]
pub fn miopenRNNBackwardData(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
sequenceLen: ::std::os::raw::c_int,
yDesc: *const miopenTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dyDesc: *const miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
dhyDesc: miopenTensorDescriptor_t,
dhy: *const ::std::os::raw::c_void,
dcyDesc: miopenTensorDescriptor_t,
dcy: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
hxDesc: miopenTensorDescriptor_t,
hx: *const ::std::os::raw::c_void,
cxDesc: miopenTensorDescriptor_t,
cx: *const ::std::os::raw::c_void,
dxDesc: *const miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
dhxDesc: miopenTensorDescriptor_t,
dhx: *mut ::std::os::raw::c_void,
dcxDesc: miopenTensorDescriptor_t,
dcx: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceNumBytes: usize,
reserveSpace: *mut ::std::os::raw::c_void,
reserveSpaceNumBytes: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute backward weights for recurrent layer\n\n Interface for executing the backward weights pass on a RNN.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param sequenceLen Temporal iterations to unroll (input)\n @param xDesc An array of tensor descriptors. These are the\n input descriptors to each time step. The first dimension of each descriptor is the\n batch size and may decrease from element n to element n+1 and not increase in size.\n The second dimension is the same for all descriptors in the array and is the input\n vector length. (input)\n @param x Pointer to input tensor (input)\n @param hxDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hx Pointer to the hidden layer input tensor. If hx is NULL,\n then the initial hidden state will be zero initialized. (input)\n @param yDesc An array of fully packed tensor descriptors associated\n with the output from each time step. The first dimension of the tensor descriptors\n must equal the first dimension of the first descriptor (batch size) in the xDesc\n tensor array. The second dimension of the element of the descriptor array\n depends on the direction mode selected. If the direction mode is unidirectional,\n the second dimension is the hiddenSize. If direction mode is bidirectional\n the second dimension is twice the hiddenSize. (input)\n @param y Pointer to the output tensor (input)\n @param dwDesc A weights tensor descriptor (input)\n @param dw Pointer to input weights tensor (input / output)\n @param workSpace Pointer to memory allocated for forward training (input)\n @param workSpaceNumBytes Number of allocated bytes in memory for the workspace (input)\n @param reserveSpace Pointer to memory allocated for random states (input)\n @param reserveSpaceNumBytes Number of allocated bytes in memory for use in the forward (input)\n @return miopenStatus_t"]
pub fn miopenRNNBackwardWeights(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
sequenceLen: ::std::os::raw::c_int,
xDesc: *const miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
hxDesc: miopenTensorDescriptor_t,
hx: *const ::std::os::raw::c_void,
yDesc: *const miopenTensorDescriptor_t,
y: *const ::std::os::raw::c_void,
dwDesc: miopenTensorDescriptor_t,
dw: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceNumBytes: usize,
reserveSpace: *const ::std::os::raw::c_void,
reserveSpaceNumBytes: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward inference for RNN layer\n\n Interface for executing the forward inference pass on a RNN.\n\n @param handle MIOpen handle (input)\n @param rnnDesc RNN layer descriptor type (input)\n @param sequenceLen Temporal iterations to unroll (input)\n @param xDesc An array of tensor descriptors. These are the\n input descriptors to each time step. The first dimension of each descriptor is the\n batch size and may decrease from element n to element n+1 and not increase in size.\n The second dimension is the same for all descriptors in the array and is the input\n vector length. (input)\n @param x Pointer to input tensor (input)\n @param hxDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hx Pointer to the hidden layer input tensor. If hx is NULL,\n then the initial hidden state will be zero initialized. (input)\n @param cxDesc A cell tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param cx Pointer to the cell layer input tensor. If cx is NULL,\n then the initial cell state will be zero initialized. (input)\n @param wDesc A weights tensor descriptor (input)\n @param w Pointer to input weights tensor (input)\n @param yDesc An array of fully packed tensor descriptors associated\n with the output from each time step. The first dimension of the tensor descriptors\n must equal the first dimension of the first descriptor (batch size) in the xDesc\n tensor array. The second dimension of the element of the descriptor array\n depends on the direction mode selected. If the direction mode is unidirectional,\n the second dimension is the hiddenSize. If direction mode is bidirectional\n the second dimension is twice the hiddenSize. (input)\n @param y Pointer to output tensor (output)\n @param hyDesc A hidden tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param hy Pointer to the hidden layer output tensor. If hy is NULL,\n then the final hidden state will not be saved. (output)\n @param cyDesc A output cell tensor descriptor that has as its first dimension\n of the number of layers if the direction mode is unidirectional and twice the\n number of layers if the direction mode is bidirectional. The second dimension of\n the descriptor must equal the largest first dimension of the xDesc tensor descriptor\n array. The third dimension equals the hiddenSize. (input)\n @param cy Pointer to the cell layer output tensor. If cy is NULL,\n then the final cell state will not be saved. (output)\n @param workSpace Pointer to memory allocated for forward training (input)\n @param workSpaceNumBytes Number of allocated bytes in memory for the workspace (input)\n @return miopenStatus_t"]
pub fn miopenRNNForwardInference(
handle: miopenHandle_t,
rnnDesc: miopenRNNDescriptor_t,
sequenceLen: ::std::os::raw::c_int,
xDesc: *const miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
hxDesc: miopenTensorDescriptor_t,
hx: *const ::std::os::raw::c_void,
cxDesc: miopenTensorDescriptor_t,
cx: *const ::std::os::raw::c_void,
wDesc: miopenTensorDescriptor_t,
w: *const ::std::os::raw::c_void,
yDesc: *const miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
hyDesc: miopenTensorDescriptor_t,
hy: *mut ::std::os::raw::c_void,
cyDesc: miopenTensorDescriptor_t,
cy: *mut ::std::os::raw::c_void,
workSpace: *mut ::std::os::raw::c_void,
workSpaceNumBytes: usize,
) -> miopenStatus_t;
}
#[doc = "< Results are guaranteed to be reproducible"]
pub const miopenCTCLossAlgo_t_MIOPEN_CTC_LOSS_ALGO_DETERMINISTIC: miopenCTCLossAlgo_t = 0;
#[doc = " @enum miopenCTCLossAlgo_t\n Algorithms available to execute the CTC loss operation"]
pub type miopenCTCLossAlgo_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Create a CTC loss function Descriptor\n\n API for creating an uninitialized CTC loss function descriptor.\n @param ctcLossDesc Pointer to the CTC loss function descriptor type (output)\n @return miopenStatus_t"]
pub fn miopenCreateCTCLossDescriptor(
ctcLossDesc: *mut miopenCTCLossDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Retrieves a CTC loss function descriptor's details\n\n @param ctcLossDesc CTC loss function descriptor (input)\n @param dataType Data type used in this CTC loss operation, only fp32 currently\n supported (output)\n @param blank_label_id User defined index for blank label (output)\n @param apply_softmax_layer Boolean to toggle input layer property (output)\n @return miopenStatus_t"]
pub fn miopenGetCTCLossDescriptor(
ctcLossDesc: miopenCTCLossDescriptor_t,
dataType: *mut miopenDataType_t,
blank_label_id: *mut ::std::os::raw::c_int,
apply_softmax_layer: *mut bool,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys a CTC loss function descriptor object\n\n @param ctcLossDesc CTC loss function descriptor type (input)\n @return miopenStatus_t"]
pub fn miopenDestroyCTCLossDescriptor(ctcLossDesc: miopenCTCLossDescriptor_t)
-> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Set the details of a CTC loss function descriptor\n\n @param ctcLossDesc CTC loss function descriptor type (input)\n @param dataType Data type used in this CTC loss operation, only fp32 currently\n supported (input)\n @param blank_label_id User defined index for blank label, default 0 (input)\n @param apply_softmax_layer Boolean to toggle input layer property (input)\n @return miopenStatus_t"]
pub fn miopenSetCTCLossDescriptor(
ctcLossDesc: miopenCTCLossDescriptor_t,
dataType: miopenDataType_t,
blank_label_id: ::std::os::raw::c_int,
apply_softmax_layer: bool,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the amount of memory required to execute miopenCTCLoss\n\n This function calculates the amount of memory required to run the CTC loss function given a CTC\n loss function descriptor with the specified algorithm.\n @param handle MIOpen handle (input)\n @param probsDesc Tensor descriptor for probabilities (input)\n @param gradientsDesc Tensor descriptor for gradients (input)\n @param labels Pointer to the flattened labels list (input)\n @param labelLengths Pointer to the lengths list for \"labels\" (input)\n @param inputLengths Pointer to the list of the time steps in each batch (input)\n @param algo CTC loss algorithm selected (input)\n @param ctcLossDesc CTC loss function descriptor type (input)\n @param workSpaceSize Number of bytes of workspace required for CTC loss operation with selected\n algorithm (output)\n @return miopenStatus_t"]
pub fn miopenGetCTCLossWorkspaceSize(
handle: miopenHandle_t,
probsDesc: miopenTensorDescriptor_t,
gradientsDesc: miopenTensorDescriptor_t,
labels: *const ::std::os::raw::c_int,
labelLengths: *const ::std::os::raw::c_int,
inputLengths: *const ::std::os::raw::c_int,
algo: miopenCTCLossAlgo_t,
ctcLossDesc: miopenCTCLossDescriptor_t,
workSpaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward inference for CTCLoss layer\n\n Interface for executing the forward inference pass on a CTCLoss.\n @param handle MIOpen handle (input)\n @param probsDesc Tensor descriptor for probabilities (input)\n @param probs Pointer to the probabilities tensor (input)\n @param labels Pointer to the flattened labels list (input)\n @param labelLengths Pointer to the lengths list for \"labels\" (input)\n @param inputLengths Pointer to the list of the time steps in each batch (input)\n @param losses Pointer to the computed losses of CTC (Output)\n @param gradientsDesc Tensor descriptor for gradients (input)\n @param gradients Pointer to the computed gradients of CTC (Output)\n @param algo CTC loss algorithm selected (input)\n @param ctcLossDesc CTC loss function descriptor type (input)\n @param workSpace Pointer to memory allocated for execute CTC loss operation (input)\n @param workSpaceSize Number of bytes of workspace required for CTC loss operation with selected\n algorithm (input)\n @return miopenStatus_t"]
pub fn miopenCTCLoss(
handle: miopenHandle_t,
probsDesc: miopenTensorDescriptor_t,
probs: *const ::std::os::raw::c_void,
labels: *const ::std::os::raw::c_int,
labelLengths: *const ::std::os::raw::c_int,
inputLengths: *const ::std::os::raw::c_int,
losses: *mut ::std::os::raw::c_void,
gradientsDesc: miopenTensorDescriptor_t,
gradients: *mut ::std::os::raw::c_void,
algo: miopenCTCLossAlgo_t,
ctcLossDesc: miopenCTCLossDescriptor_t,
workSpace: *mut ::std::os::raw::c_void,
workSpaceSize: usize,
) -> miopenStatus_t;
}
#[doc = "< XORWOW pseudorandom generator"]
pub const miopenRNGType_t_MIOPEN_RNG_PSEUDO_XORWOW: miopenRNGType_t = 0;
#[doc = " @enum miopenRNGType_t\n random number generator type"]
pub type miopenRNGType_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Creates the dropout descriptor object\n\n @param dropoutDesc Pointer to a dropout descriptor type\n @return miopenStatus_t"]
pub fn miopenCreateDropoutDescriptor(
dropoutDesc: *mut miopenDropoutDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys the dropout descriptor object\n\n @param dropoutDesc Dropout descriptor type (input)\n @return miopenStatus_t"]
pub fn miopenDestroyDropoutDescriptor(dropoutDesc: miopenDropoutDescriptor_t)
-> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the amount of memory required to run dropout\n\n This function calculates the amount of memory required to run dropout.\n @param xDesc Tensor descriptor for data tensor x (input)\n @param reserveSpaceSizeInBytes Number of bytes of reservespace required for executing dropout\n (Output)\n @return miopenStatus_t"]
pub fn miopenDropoutGetReserveSpaceSize(
xDesc: miopenTensorDescriptor_t,
reserveSpaceSizeInBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query the amount of memory required to store the states of the random number generators\n\n This function calculates the amount of memory required to store the states of the random number\n generators used by miopenDropoutForward.\n @param handle MIOpen handle (input)\n @param stateSizeInBytes Number of bytes required to store random generator states (Output)\n @return miopenStatus_t"]
pub fn miopenDropoutGetStatesSize(
handle: miopenHandle_t,
stateSizeInBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Get the details of the dropout descriptor\n\n Interface for querying the dropout descriptor\n @param dropoutDesc Dropout layer descriptor (input)\n @param handle MIOpen handle (input)\n @param dropout The probability by which the input is set to 0 in the dropout layer (Output)\n @param states Pointer to memory that holds random number generator states (Output)\n @param seed Seed used to initialize random number generator states (Output)\n @param use_mask Boolean flag indicating whether to use a saved mask (an existing or\n user-defined dropout layout) in reserveSpace (Output)\n @param state_evo Boolean flag indicating whether to adopt state evolution strategy to update\n the PRNG states by the end of each implementation (Output placeholder, currently not enabled)\n @param rng_mode Random number generator used to generate parallel random number sequences\n (Output)\n @return miopenStatus_t"]
pub fn miopenGetDropoutDescriptor(
dropoutDesc: miopenDropoutDescriptor_t,
handle: miopenHandle_t,
dropout: *mut f32,
states: *mut *mut ::std::os::raw::c_void,
seed: *mut ::std::os::raw::c_ulonglong,
use_mask: *mut bool,
state_evo: *mut bool,
rng_mode: *mut miopenRNGType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Restore the dropout descriptor to a saved state\n\n This function restores the state of dropout descriptor using the address of a state buffer with\n previously saved PRNG state pattern, without launching the expensive PRNG initialization process.\n\n Interface for restoring the dropout descriptor\n @param dropoutDesc Dropout layer descriptor (input/Output)\n @param handle MIOpen handle (input)\n @param dropout The probability by which the input is set to 0 in the dropout layer\n (input)\n @param states Pointer to memory that holds random number generator states (input)\n @param stateSizeInBytes Number of bytes holding random generator states (input)\n @param seed Seed used to initialize random number generator states (input)\n @param use_mask Boolean flag indicating whether to use a saved mask (an existing or\n user-defined dropout layout) in reserveSpace (input)\n @param state_evo Boolean flag indicating whether to adopt state evolution strategy to\n update the PRNG states by the end of each implementation (input placeholder, currently not\n enabled)\n @param rng_mode Random number generator used to generate parallel random number\n sequences (input)\n @return miopenStatus_t"]
pub fn miopenRestoreDropoutDescriptor(
dropoutDesc: miopenDropoutDescriptor_t,
handle: miopenHandle_t,
dropout: f32,
states: *mut ::std::os::raw::c_void,
stateSizeInBytes: usize,
seed: ::std::os::raw::c_ulonglong,
use_mask: bool,
state_evo: bool,
rng_mode: miopenRNGType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Initialize the dropout descriptor\n\n Interface for setting up the dropout descriptor\n @param dropoutDesc Dropout layer descriptor (input/Output)\n @param handle MIOpen handle (input)\n @param dropout The probability by which the input is set to 0 in the dropout layer\n (input)\n @param states Pointer to memory that holds random number generator states (input)\n @param stateSizeInBytes Number of bytes provided for random generator states (input)\n @param seed Seed used to initialize random number generator states (input)\n @param use_mask Boolean flag indicating whether to use a saved mask (an existing or\n user-defined dropout layout) in reserveSpace (input)\n @param state_evo Boolean flag indicating whether to adopt state evolution strategy to\n update the PRNG states by the end of each implementation (input placeholder, currently not\n enabled)\n @param rng_mode Random number generator used to generate parallel random number\n sequences (input)\n @return miopenStatus_t"]
pub fn miopenSetDropoutDescriptor(
dropoutDesc: miopenDropoutDescriptor_t,
handle: miopenHandle_t,
dropout: f32,
states: *mut ::std::os::raw::c_void,
stateSizeInBytes: usize,
seed: ::std::os::raw::c_ulonglong,
use_mask: bool,
state_evo: bool,
rng_mode: miopenRNGType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute forward dropout operation\n\n Interface for executing the forward pass on a Dropout.\n @param handle MIOpen handle (input)\n @param dropoutDesc Dropout layer descriptor (input)\n @param noise_shape Tensor descriptor for noise shape (input placeholder, currently\n not enabled)\n @param xDesc Tensor descriptor for data tensor x (input)\n @param x Data tensor x (input)\n @param yDesc Tensor descriptor for data tensor y (input)\n @param y Data tensor y (Output)\n @param reserveSpace Pointer to memory allocated for executing forward dropout,\n expecting reserveSpace unchanged before next call of miopenDropoutBackward (Output)\n @param reserveSpaceSizeInBytes Number of bytes of reservespace required for executing forward\n dropout (input)\n @return miopenStatus_t"]
pub fn miopenDropoutForward(
handle: miopenHandle_t,
dropoutDesc: miopenDropoutDescriptor_t,
noise_shape: miopenTensorDescriptor_t,
xDesc: miopenTensorDescriptor_t,
x: *const ::std::os::raw::c_void,
yDesc: miopenTensorDescriptor_t,
y: *mut ::std::os::raw::c_void,
reserveSpace: *mut ::std::os::raw::c_void,
reserveSpaceSizeInBytes: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Execute backward dropout operation\n\n Interface for executing the backward pass on a Dropout.\n @param handle MIOpen handle (input)\n @param dropoutDesc Dropout layer descriptor (input)\n @param noise_shape Tensor descriptor for noise shape (input placeholder, currently\n not enabled)\n @param dyDesc Tensor descriptor for data delta tensor dy (input)\n @param dy Data delta tensor dy (input)\n @param dxDesc Tensor descriptor for data delta tensor dx (input)\n @param dx Data delta tensor dx (Output)\n @param reserveSpace Pointer to memory allocated for executing backward dropout,\n expecting reserveSpace unchanged after previous call of miopenDropoutForward (input)\n @param reserveSpaceSizeInBytes Number of bytes of reservespace required for executing backward\n dropout (input)\n @return miopenStatus_t"]
pub fn miopenDropoutBackward(
handle: miopenHandle_t,
dropoutDesc: miopenDropoutDescriptor_t,
noise_shape: miopenTensorDescriptor_t,
dyDesc: miopenTensorDescriptor_t,
dy: *const ::std::os::raw::c_void,
dxDesc: miopenTensorDescriptor_t,
dx: *mut ::std::os::raw::c_void,
reserveSpace: *mut ::std::os::raw::c_void,
reserveSpaceSizeInBytes: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates the ReduceTensor descriptor object\n\n @param reduceTensorDesc Pointer to a ReduceTensor descriptor type\n @return miopenStatus_t"]
pub fn miopenCreateReduceTensorDescriptor(
reduceTensorDesc: *mut miopenReduceTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy the ReduceTensor descriptor object\n\n @param reduceTensorDesc ReduceTensor descriptor type (input)\n @return miopenStatus_t"]
pub fn miopenDestroyReduceTensorDescriptor(
reduceTensorDesc: miopenReduceTensorDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Initialize a ReduceTensor descriptor object\n\n @param reduceTensorDesc Pointer to the ReduceTensor descriptor object (output)\n @param reduceTensorOp Enumerant specifying the operation used by ReduceTensor (input)\n @param reduceTensorCompType Enumerant specifying the data type used with ReduceTensor\n operation (input)\n @param reduceTensorNanOpt Enumerant specifying the NaN number propagation mode (input)\n @param reduceTensorIndices Enumerant specifying the indices modes used by ReduceTensor\n (input)\n @param reduceTensorIndicesType Enumerant specifying the data type of the indices (input)\n @return miopenStatus_t"]
pub fn miopenSetReduceTensorDescriptor(
reduceTensorDesc: miopenReduceTensorDescriptor_t,
reduceTensorOp: miopenReduceTensorOp_t,
reduceTensorCompType: miopenDataType_t,
reduceTensorNanOpt: miopenNanPropagation_t,
reduceTensorIndices: miopenReduceTensorIndices_t,
reduceTensorIndicesType: miopenIndicesType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Query a ReduceTensor descriptor object\n\n @param reduceTensorDesc Pointer to the ReduceTensor descriptor object (input)\n @param reduceTensorOp Pointer to enumerant specifying the operation used by\n ReduceTensor (output)\n @param reduceTensorCompType Pointer to enumerant specifying the data type used with\n ReduceTensor operation (output)\n @param reduceTensorNanOpt Pointer to enumerant specifying the NaN number propagation mode\n (output)\n @param reduceTensorIndices Pointer to enumerant specifying the indices modes used by\n ReduceTensor (output)\n @param reduceTensorIndicesType Pointer to enumerant specifying the data type of the indices\n (output)\n @return miopenStatus_t"]
pub fn miopenGetReduceTensorDescriptor(
reduceTensorDesc: miopenReduceTensorDescriptor_t,
reduceTensorOp: *mut miopenReduceTensorOp_t,
reduceTensorCompType: *mut miopenDataType_t,
reduceTensorNanOpt: *mut miopenNanPropagation_t,
reduceTensorIndices: *mut miopenReduceTensorIndices_t,
reduceTensorIndicesType: *mut miopenIndicesType_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Helper function to query the minimum index space size required by the ReduceTensor call\n\n @param handle MIOpen Handle (input)\n @param reduceTensorDesc Pointer to the ReduceTensor descriptor object (input)\n @param aDesc Pointer to the input tensor descriptor (input)\n @param cDesc Pointer to the output tensor descriptor (input)\n @param sizeInBytes Pointer to data to return the minimum index space size\n @return miopenStatus_t"]
pub fn miopenGetReductionIndicesSize(
handle: miopenHandle_t,
reduceTensorDesc: miopenReduceTensorDescriptor_t,
aDesc: miopenTensorDescriptor_t,
cDesc: miopenTensorDescriptor_t,
sizeInBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Helper function to query the minimum workspace size required by the ReduceTensor call\n\n @param handle MIOpen Handle (input)\n @param reduceTensorDesc Pointer to the ReduceTensor descriptor object (input)\n @param aDesc Pointer to the input tensor descriptor (input)\n @param cDesc Pointer to the output tensor descriptor (input)\n @param sizeInBytes Pointer to data to return the minimum workspace size\n @return miopenStatus_t"]
pub fn miopenGetReductionWorkspaceSize(
handle: miopenHandle_t,
reduceTensorDesc: miopenReduceTensorDescriptor_t,
aDesc: miopenTensorDescriptor_t,
cDesc: miopenTensorDescriptor_t,
sizeInBytes: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief TensorReduce function doing reduction on tensor A by implementing C = alpha * reduceOp(A)\n + beta * C\n\n The length of each dimension of output tensor C must match the length of the corresponding\n dimension of\n input tensor A or must be equal to 1. The dimensions with length equal to 1 indicate the\n dimensions\n of A to be reduced.\n\n @param handle MIOpen Handle (input)\n @param reduceTensorDesc Pointer to the ReduceTensor descriptor object (input)\n @param indices Address of the allocated indices data space (output)\n @param indicesSizeInBytes Size in bytes of the allocated indices data space (input)\n @param workspace Address of the allocated workspace data (input)\n @param workspaceSizeInBytes Size in bytes of the allocated workspace data (input)\n @param alpha Pointer to scale factor for data in input tensor A (input)\n @param aDesc Pointer to the tensor descriptor for input tensor A (input)\n @param A Pointer to the data of input tensor A (input)\n @param beta Pointer to scale factor for data in output tensor C (input)\n @param cDesc Pointer to the tensor descriptor for output tensor C (input)\n @param C Pointer to the data of output tensor C (output)\n @return miopenStatus_t"]
pub fn miopenReduceTensor(
handle: miopenHandle_t,
reduceTensorDesc: miopenReduceTensorDescriptor_t,
indices: *mut ::std::os::raw::c_void,
indicesSizeInBytes: usize,
workspace: *mut ::std::os::raw::c_void,
workspaceSizeInBytes: usize,
alpha: *const ::std::os::raw::c_void,
aDesc: miopenTensorDescriptor_t,
A: *const ::std::os::raw::c_void,
beta: *const ::std::os::raw::c_void,
cDesc: miopenTensorDescriptor_t,
C: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
#[doc = " @brief Describes a problem for different miopen operations.\n\n For now, this is only used for convolution, but could be used for other\n operators in the future(such as GEMM, Pooling, etc)"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenProblem {
pub _address: u8,
}
#[doc = " @brief Describes a problem for different miopen operations.\n\n For now, this is only used for convolution, but could be used for other\n operators in the future(such as GEMM, Pooling, etc)"]
pub type miopenProblem_t = *mut miopenProblem;
pub const miopenProblemDirection_t_miopenProblemDirectionForward: miopenProblemDirection_t = 0;
pub const miopenProblemDirection_t_miopenProblemDirectionBackward: miopenProblemDirection_t = 1;
pub const miopenProblemDirection_t_miopenProblemDirectionBackwardWeights: miopenProblemDirection_t =
2;
#[doc = " @enum miopenProblemDirection_t\n Directions of miopen operation."]
pub type miopenProblemDirection_t = ::std::os::raw::c_uint;
pub const miopenTensorArgumentId_t_miopenTensorArgumentIdInvalid: miopenTensorArgumentId_t = 0;
pub const miopenTensorArgumentId_t_miopenTensorConvolutionX: miopenTensorArgumentId_t = 1;
pub const miopenTensorArgumentId_t_miopenTensorConvolutionW: miopenTensorArgumentId_t = 2;
pub const miopenTensorArgumentId_t_miopenTensorConvolutionY: miopenTensorArgumentId_t = 3;
pub const miopenTensorArgumentId_t_miopenTensorMhaK: miopenTensorArgumentId_t = 4;
pub const miopenTensorArgumentId_t_miopenTensorMhaQ: miopenTensorArgumentId_t = 5;
pub const miopenTensorArgumentId_t_miopenTensorMhaV: miopenTensorArgumentId_t = 6;
pub const miopenTensorArgumentId_t_miopenTensorMhaDescaleK: miopenTensorArgumentId_t = 7;
pub const miopenTensorArgumentId_t_miopenTensorMhaDescaleQ: miopenTensorArgumentId_t = 8;
pub const miopenTensorArgumentId_t_miopenTensorMhaDescaleV: miopenTensorArgumentId_t = 9;
pub const miopenTensorArgumentId_t_miopenTensorMhaDescaleS: miopenTensorArgumentId_t = 10;
pub const miopenTensorArgumentId_t_miopenTensorMhaScaleS: miopenTensorArgumentId_t = 11;
pub const miopenTensorArgumentId_t_miopenTensorMhaScaleO: miopenTensorArgumentId_t = 12;
pub const miopenTensorArgumentId_t_miopenTensorMhaDropoutProbability: miopenTensorArgumentId_t = 13;
pub const miopenTensorArgumentId_t_miopenTensorMhaDropoutSeed: miopenTensorArgumentId_t = 14;
pub const miopenTensorArgumentId_t_miopenTensorMhaDropoutOffset: miopenTensorArgumentId_t = 15;
pub const miopenTensorArgumentId_t_miopenTensorMhaO: miopenTensorArgumentId_t = 16;
pub const miopenTensorArgumentId_t_miopenTensorMhaAmaxO: miopenTensorArgumentId_t = 17;
pub const miopenTensorArgumentId_t_miopenTensorMhaAmaxS: miopenTensorArgumentId_t = 18;
pub const miopenTensorArgumentId_t_miopenTensorMhaM: miopenTensorArgumentId_t = 19;
pub const miopenTensorArgumentId_t_miopenTensorMhaZInv: miopenTensorArgumentId_t = 20;
pub const miopenTensorArgumentId_t_miopenTensorMhaDO: miopenTensorArgumentId_t = 21;
pub const miopenTensorArgumentId_t_miopenTensorMhaDescaleO: miopenTensorArgumentId_t = 22;
pub const miopenTensorArgumentId_t_miopenTensorMhaDescaleDO: miopenTensorArgumentId_t = 23;
pub const miopenTensorArgumentId_t_miopenTensorMhaDescaleDS: miopenTensorArgumentId_t = 24;
pub const miopenTensorArgumentId_t_miopenTensorMhaScaleDS: miopenTensorArgumentId_t = 25;
pub const miopenTensorArgumentId_t_miopenTensorMhaScaleDQ: miopenTensorArgumentId_t = 26;
pub const miopenTensorArgumentId_t_miopenTensorMhaScaleDK: miopenTensorArgumentId_t = 27;
pub const miopenTensorArgumentId_t_miopenTensorMhaScaleDV: miopenTensorArgumentId_t = 28;
pub const miopenTensorArgumentId_t_miopenTensorMhaDQ: miopenTensorArgumentId_t = 29;
pub const miopenTensorArgumentId_t_miopenTensorMhaDK: miopenTensorArgumentId_t = 30;
pub const miopenTensorArgumentId_t_miopenTensorMhaDV: miopenTensorArgumentId_t = 31;
pub const miopenTensorArgumentId_t_miopenTensorMhaAmaxDQ: miopenTensorArgumentId_t = 32;
pub const miopenTensorArgumentId_t_miopenTensorMhaAmaxDK: miopenTensorArgumentId_t = 33;
pub const miopenTensorArgumentId_t_miopenTensorMhaAmaxDV: miopenTensorArgumentId_t = 34;
pub const miopenTensorArgumentId_t_miopenTensorMhaAmaxDS: miopenTensorArgumentId_t = 35;
pub const miopenTensorArgumentId_t_miopenTensorMhaBias: miopenTensorArgumentId_t = 36;
pub const miopenTensorArgumentId_t_miopenTensorArgumentIsScalar: miopenTensorArgumentId_t =
2147483648;
pub const miopenTensorArgumentId_t_miopenTensorMhaMask: miopenTensorArgumentId_t = 2147483649;
#[doc = " @enum miopenTensorArgumentId_t\n Identifiers for tensor arguments of problems and operations."]
pub type miopenTensorArgumentId_t = ::std::os::raw::c_uint;
pub const miopenFindResultsOrder_t_miopenFindResultsOrderByTime: miopenFindResultsOrder_t = 0;
pub const miopenFindResultsOrder_t_miopenFindResultsOrderByWorkspaceSize: miopenFindResultsOrder_t =
1;
#[doc = " @enum miopenTensorArgumentId_t\n Different ways to sort results of the find call."]
pub type miopenFindResultsOrder_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Initializes a problem object describing a convolution operation.\n\n @param problem Pointer to the problem to initialize\n @param operatorDesc Descriptor of the operator to be used\n @param direction Direction of the operation\n @return miopenStatus_t"]
pub fn miopenCreateConvProblem(
problem: *mut miopenProblem_t,
operatorDesc: miopenConvolutionDescriptor_t,
direction: miopenProblemDirection_t,
) -> miopenStatus_t;
}
pub const miopenMhaMask_t_miopenMhaMaskNone: miopenMhaMask_t = 0;
pub const miopenMhaMask_t_miopenMhaMaskCausal: miopenMhaMask_t = 1;
#[doc = " @enum miopenMhaMask_t\n Different masks for Mha."]
pub type miopenMhaMask_t = ::std::os::raw::c_uint;
unsafe extern "C" {
pub fn miopenCreateMhaProblem(
problem: *mut miopenProblem_t,
operatorDesc: miopenMhaDescriptor_t,
direction: miopenProblemDirection_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates the mha descriptor object\n\n @param mhaDesc Pointer to a mha descriptor type\n @return miopenStatus_t"]
pub fn miopenCreateMhaDescriptor(mhaDesc: *mut miopenMhaDescriptor_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the Mha descriptor details\n\n Sets all of the descriptor details for the Mha\n\n @param mhaDesc Pointer to a Mha descriptor\n @param scale Scale\n @return miopenStatus_t"]
pub fn miopenSetMhaDescriptor(mhaDesc: miopenMhaDescriptor_t, scale: f32) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets the Mha descriptor details\n\n Retrieves all of the descriptor details for the Mha.\n\n @param mhaDesc Pointer to a Mha descriptor\n @param scale Scale (output)\n @return miopenStatus_t"]
pub fn miopenGetMhaDescriptor(
mhaDesc: miopenMhaDescriptor_t,
scale: *mut f32,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Creates the Softmax descriptor object\n\n @param softmaxDesc Pointer to an softmax descriptor type\n @return miopenStatus_t"]
pub fn miopenCreateSoftmaxDescriptor(
softmaxDesc: *mut miopenSoftmaxDescriptor_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the softmax descriptor details\n\n Sets all of the descriptor details for the softmax layer\n\n @param softmaxDesc Pointer to a softmax layer descriptor\n @param alpha Softmax alpha parameter\n @param beta Softmax beta parameter\n @param algorithm Softmax algorithm\n @param mode Softmax mode\n @return miopenStatus_t"]
pub fn miopenSetSoftmaxDescriptor(
softmaxDesc: miopenSoftmaxDescriptor_t,
alpha: f32,
beta: f32,
algorithm: miopenSoftmaxAlgorithm_t,
mode: miopenSoftmaxMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets the softmax layer descriptor details\n\n Retrieves all of the descriptor details for the softmax layer.\n\n @param softmaxDesc Pointer to a softmax layer descriptor (input)\n @param alpha Softmax alpha parameter (output)\n @param beta Softmax beta parameter (output)\n @param algorithm Softmax algorithm (output)\n @param mode Softmax mode (output)\n @return miopenStatus_t"]
pub fn miopenGetSoftmaxDescriptor(
softmaxDesc: miopenSoftmaxDescriptor_t,
alpha: *mut f32,
beta: *mut f32,
algorithm: *mut miopenSoftmaxAlgorithm_t,
mode: *mut miopenSoftmaxMode_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys a problem object.\n\n @param problem Problem to destroy\n @return miopenStatus_t"]
pub fn miopenDestroyProblem(problem: miopenProblem_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets a tensor descriptor for the specified argument.\n\n @param problem Problem to update\n @param id Id of the argument for the descriptor\n @param descriptor Tensor descriptor to set\n @return miopenStatus_t"]
pub fn miopenSetProblemTensorDescriptor(
problem: miopenProblem_t,
id: miopenTensorArgumentId_t,
descriptor: miopenTensorDescriptor_t,
) -> miopenStatus_t;
}
#[doc = " @brief The miopenFindOptions allows the user to configure how find will be used."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenFindOptions {
pub _address: u8,
}
#[doc = " @brief The miopenFindOptions allows the user to configure how find will be used."]
pub type miopenFindOptions_t = *mut miopenFindOptions;
unsafe extern "C" {
#[doc = " @brief Initializes miopenFindOptions object.\n\n @param options Pointer to options object to initialze\n @return miopenStatus_t"]
pub fn miopenCreateFindOptions(options: *mut miopenFindOptions_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys miopenFindOptions object.\n\n @param options Options object to destroy\n @return miopenStatus_t"]
pub fn miopenDestroyFindOptions(options: miopenFindOptions_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the tuning find option. Default value is zero.\n\n @param options Options object to update\n @param value Value of zero means no tuning, value of one means tuning enabled\n @return miopenStatus_t"]
pub fn miopenSetFindOptionTuning(
options: miopenFindOptions_t,
value: ::std::os::raw::c_int,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the results order find option. Default value is miopenFindResultsOrderByTime.\n\n @param options Options object to update\n @param value Specifies what order should find results have\n @return miopenStatus_t"]
pub fn miopenSetFindOptionResultsOrder(
options: miopenFindOptions_t,
value: miopenFindResultsOrder_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Sets the workspace limit find option. Default value is maximum of size_t\n\n @param options Options object to update\n @param value Specifies the workspace limit for find call. All solvers exceeding the limit\n would be ignored.\n @return miopenStatus_t"]
pub fn miopenSetFindOptionWorkspaceLimit(
options: miopenFindOptions_t,
value: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Attaches the preallocated workspace to find options. Allocated by the library by default.\n\n @param options Options object to update\n @param buffer Specifies the workspace for find call\n @param size Specifies the size of the buffer passed\n @return miopenStatus_t"]
pub fn miopenSetFindOptionPreallocatedWorkspace(
options: miopenFindOptions_t,
buffer: *mut ::std::os::raw::c_void,
size: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Attaches a preallocated tensor to find options. If not used, buffers are allocated by\n MIOpen internally, which is not recommended.\n\n @param options Options object to update\n @param id Specifies the id of the tensor passed\n @param buffer Specifies the tensor for find call\n @return miopenStatus_t"]
pub fn miopenSetFindOptionPreallocatedTensor(
options: miopenFindOptions_t,
id: miopenTensorArgumentId_t,
buffer: *mut ::std::os::raw::c_void,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Forces library to attach kernel binaries to solutions for later saving. This allows zero\n lookup miopenRunSolution calls after miopenLoadSolution. Default value is 0.\n\n @param options Options object to update\n @param attach 1 means attaching, 0 - skipping, any other value - reserved for future use\n @return miopenStatus_t"]
pub fn miopenSetFindOptionAttachBinaries(
options: miopenFindOptions_t,
attach: ::std::os::raw::c_uint,
) -> miopenStatus_t;
}
#[doc = " @brief The miopenSolution object describes a prepared solution."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenSolution {
pub _address: u8,
}
#[doc = " @brief The miopenSolution object describes a prepared solution."]
pub type miopenSolution_t = *mut miopenSolution;
unsafe extern "C" {
#[doc = " @brief Finds solutions to a problem by running different applicable solutions. Memory is\n automatically allocated.\n\n @param handle Handle to execute the kernels\n @param problem Problem to solve\n @param options Find options. When null default values would be used\n @param solutions Pointer to the first result. Must not be null\n @param numSolutions Pointer to the amount of results. Ignored if null\n @param maxSolutions Limits the amount of results\n @return miopenStatus_t"]
pub fn miopenFindSolutions(
handle: miopenHandle_t,
problem: miopenProblem_t,
options: miopenFindOptions_t,
solutions: *mut miopenSolution_t,
numSolutions: *mut usize,
maxSolutions: usize,
) -> miopenStatus_t;
}
#[doc = " @brief Values of a tensor or scalar argument for the miopenRunSolution function."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct miopenTensorArgument_t {
pub id: miopenTensorArgumentId_t,
pub descriptor: *mut miopenTensorDescriptor_t,
pub buffer: *mut ::std::os::raw::c_void,
}
unsafe extern "C" {
#[doc = " @brief Runs the solution using the passed in buffers.\n\n @param handle Handle to execute the kernels\n @param solution Solution to execute\n @param nInputs Amount to inputs for the solution\n @param tensors Tensor arguments described by miopenTensorArgument_t\n @param workspace Pointer to device buffer used as workspace. May be null when not required.\n Should not be less than expected\n @param workspaceSize Size of the workspace buffer\n @return miopenStatus_t"]
pub fn miopenRunSolution(
handle: miopenHandle_t,
solution: miopenSolution_t,
nInputs: usize,
tensors: *const miopenTensorArgument_t,
workspace: *mut ::std::os::raw::c_void,
workspaceSize: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Destroys solution object.\n\n @param solution Solution to destroy\n @return miopenStatus_t"]
pub fn miopenDestroySolution(solution: miopenSolution_t) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Loads solution object from binary data.\n\n @param solution Pointer to the solution to load\n @param data Data to load the solution from\n @param size Size of the solution blob\n @return miopenStatus_t"]
pub fn miopenLoadSolution(
solution: *mut miopenSolution_t,
data: *const ::std::os::raw::c_char,
size: usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Saves a solution object as binary data.\n\n @param solution Solution to save\n @param data Pointer to a buffer to save solution to\n @return miopenStatus_t"]
pub fn miopenSaveSolution(
solution: miopenSolution_t,
data: *mut ::std::os::raw::c_char,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Reads the expected size of a solution.\n\n @param solution Solution to get size\n @param size Pointer to a location where to write the size of the solution blob\n @return miopenStatus_t"]
pub fn miopenGetSolutionSize(solution: miopenSolution_t, size: *mut usize) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Reads the amount of workspace required to execute the solution.\n\n @param solution Solution to get required workspace size\n @param workspaceSize Pointer to a location where to write the workspace size\n @return miopenStatus_t"]
pub fn miopenGetSolutionWorkspaceSize(
solution: miopenSolution_t,
workspaceSize: *mut usize,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Reads the time spent to execute the solution the last it was run.\n\n @param solution Solution to get execution time\n @param time Pointer to a location where to write the execution time\n @return miopenStatus_t"]
pub fn miopenGetSolutionTime(solution: miopenSolution_t, time: *mut f32) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Reads id of the solver referred by the solution.\n\n @param solution Solution to get solver id from\n @param solverId Pointer to a location where to write the solver id\n @return miopenStatus_t"]
pub fn miopenGetSolutionSolverId(
solution: miopenSolution_t,
solverId: *mut u64,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @brief Gets the convolution algorithm implemented by a solver.\n\n @param solverId Solver id to get convolution algorithm of\n @param result Pointer to a location where to write the algorithm\n @return miopenStatus_t"]
pub fn miopenGetSolverIdConvAlgorithm(
solverId: u64,
result: *mut miopenConvAlgorithm_t,
) -> miopenStatus_t;
}
pub const miopenAlphaBetaCase_t_DEFAULT: miopenAlphaBetaCase_t = 0;
pub const miopenAlphaBetaCase_t_SCALE: miopenAlphaBetaCase_t = 1;
pub const miopenAlphaBetaCase_t_BILINEAR: miopenAlphaBetaCase_t = 2;
pub const miopenAlphaBetaCase_t_ERROR_STATE: miopenAlphaBetaCase_t = 3;
#[doc = " @brief Enum for specifying the alpha-beta case for convolution operations.\n\n Describes how alpha and beta scaling factors are applied in convolution operations."]
pub type miopenAlphaBetaCase_t = ::std::os::raw::c_uint;
#[doc = "< do not enforce anything"]
pub const miopenTuningPolicy_t_miopenTuningPolicyNone: miopenTuningPolicy_t = 1;
#[doc = "< tune and update the db"]
pub const miopenTuningPolicy_t_miopenTuningPolicyDbUpdate: miopenTuningPolicy_t = 2;
pub const miopenTuningPolicy_t_miopenTuningPolicySearch: miopenTuningPolicy_t = 3;
#[doc = "< combination of Search and DbUpdate"]
pub const miopenTuningPolicy_t_miopenTuningPolicySearchDbUpdate: miopenTuningPolicy_t = 4;
#[doc = "< remove existing entry, do not tune"]
pub const miopenTuningPolicy_t_miopenTuningPolicyDbClean: miopenTuningPolicy_t = 5;
#[doc = " @ingroup handle\n @enum miopenTuningPolicy_t\n Tuning policy for MIOpen Find-related calls.\n Supports the following policies of MIOPEN_FIND_ENFORCE:\n 1. None: Do not enforce anything.\n 2. DbUpdate: Do not skip auto-tune even if PerfDb already contains optimized values.\n 3. Search: Search the database first; if no record is found, tune and update the database.\n 4. SearchDbUpdate: Combination of Search and DbUpdate.\n 5. DbClean: Remove existing entry, do not tune.\n Note: TuningPolicy has higher priority over MIOPEN_FIND_ENFORCE."]
pub type miopenTuningPolicy_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @ingroup handle\n @brief Update tuning policy for a specific handle. API alternative for MIOPEN_FIND_ENFORCE\n environment variable.\n\n @param [in] handle MIOpen Handle to update\n @param [in] newValue New tuning policy value. Default value is miopenTuningPolicyNone\n @return miopenStatus_t"]
pub fn miopenSetTuningPolicy(
handle: miopenHandle_t,
newValue: miopenTuningPolicy_t,
) -> miopenStatus_t;
}
unsafe extern "C" {
#[doc = " @ingroup handle\n @brief Get tuning policy from a handle.\n\n @param [in] handle MIOpen Handle to fetch value from\n @param [in] value Would be set to the current tuning policy value. Must not be null\n @return miopenStatus_t"]
pub fn miopenGetTuningPolicy(
handle: miopenHandle_t,
value: *mut miopenTuningPolicy_t,
) -> miopenStatus_t;
}