aboutsummaryrefslogtreecommitdiffhomepage
path: root/miopen-sys
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-02-27 20:55:19 +0100
committerAndrzej Janik <[email protected]>2024-02-11 20:45:51 +0100
commit1b9ba2b2333746c5e2b05a2bf24fa6ec3828dcdf (patch)
tree0b77ca4a41d4f232bd181e2bddc886475c608784 /miopen-sys
parent60d2124a16a7a2a1a6be3707247afe82892a4163 (diff)
downloadZLUDA-1b9ba2b2333746c5e2b05a2bf24fa6ec3828dcdf.tar.gz
ZLUDA-1b9ba2b2333746c5e2b05a2bf24fa6ec3828dcdf.zip
Nobody expects the Red Teamv3
Too many changes to list, but broadly: * Remove Intel GPU support from the compiler * Add AMD GPU support to the compiler * Remove Intel GPU host code * Add AMD GPU host code * More device instructions. From 40 to 68 * More host functions. From 48 to 184 * Add proof of concept implementation of OptiX framework * Add minimal support of cuDNN, cuBLAS, cuSPARSE, cuFFT, NCCL, NVML * Improve ZLUDA launcher for Windows
Diffstat (limited to 'miopen-sys')
-rw-r--r--miopen-sys/Cargo.toml8
-rw-r--r--miopen-sys/README1
-rw-r--r--miopen-sys/build.rs4
-rw-r--r--miopen-sys/src/lib.rs3
-rw-r--r--miopen-sys/src/miopen.rs2991
5 files changed, 3007 insertions, 0 deletions
diff --git a/miopen-sys/Cargo.toml b/miopen-sys/Cargo.toml
new file mode 100644
index 0000000..a2d90da
--- /dev/null
+++ b/miopen-sys/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "miopen-sys"
+version = "0.0.0"
+authors = ["Andrzej Janik <[email protected]>"]
+edition = "2018"
+links = "MIOpen"
+
+[lib]
diff --git a/miopen-sys/README b/miopen-sys/README
new file mode 100644
index 0000000..980e9e8
--- /dev/null
+++ b/miopen-sys/README
@@ -0,0 +1 @@
+bindgen /opt/rocm/include/miopen/miopen.h -o src/miopen.rs --no-layout-tests --size_t-is-usize --default-enum-style=newtype --no-derive-debug --allowlist-function "miopen.*" --allowlist-var "MIOPEN_*" --must-use-type miopenStatus_t -- -D__HIP_PLATFORM_AMD__ -DMIOPEN_BACKEND_HIP=1 -I/opt/rocm/include -x c++ \ No newline at end of file
diff --git a/miopen-sys/build.rs b/miopen-sys/build.rs
new file mode 100644
index 0000000..f6c0300
--- /dev/null
+++ b/miopen-sys/build.rs
@@ -0,0 +1,4 @@
+fn main() {
+ println!("cargo:rustc-link-lib=dylib=MIOpen");
+ println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
+}
diff --git a/miopen-sys/src/lib.rs b/miopen-sys/src/lib.rs
new file mode 100644
index 0000000..67d5e40
--- /dev/null
+++ b/miopen-sys/src/lib.rs
@@ -0,0 +1,3 @@
+#![allow(warnings)]
+mod miopen;
+pub use miopen::*; \ No newline at end of file
diff --git a/miopen-sys/src/miopen.rs b/miopen-sys/src/miopen.rs
new file mode 100644
index 0000000..4240400
--- /dev/null
+++ b/miopen-sys/src/miopen.rs
@@ -0,0 +1,2991 @@
+/* automatically generated by rust-bindgen 0.64.0 */
+
+#[repr(C)]
+#[derive(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(Copy, Clone)]
+pub struct miopenHandle {
+ pub _address: u8,
+}
+pub type miopenHandle_t = *mut miopenHandle;
+impl miopenStatus_t {
+ #[doc = "< No errors"]
+ pub const miopenStatusSuccess: miopenStatus_t = miopenStatus_t(0);
+}
+impl miopenStatus_t {
+ #[doc = "< Data not initialized."]
+ pub const miopenStatusNotInitialized: miopenStatus_t = miopenStatus_t(1);
+}
+impl miopenStatus_t {
+ #[doc = "< Incorrect variable value."]
+ pub const miopenStatusInvalidValue: miopenStatus_t = miopenStatus_t(2);
+}
+impl miopenStatus_t {
+ #[doc = "< Incorrect parameter detected."]
+ pub const miopenStatusBadParm: miopenStatus_t = miopenStatus_t(3);
+}
+impl miopenStatus_t {
+ #[doc = "< Memory allocation error."]
+ pub const miopenStatusAllocFailed: miopenStatus_t = miopenStatus_t(4);
+}
+impl miopenStatus_t {
+ #[doc = "< MIOpen failure."]
+ pub const miopenStatusInternalError: miopenStatus_t = miopenStatus_t(5);
+}
+impl miopenStatus_t {
+ #[doc = "< Use of unimplemented feature."]
+ pub const miopenStatusNotImplemented: miopenStatus_t = miopenStatus_t(6);
+}
+impl miopenStatus_t {
+ #[doc = "< Unknown error occurred."]
+ pub const miopenStatusUnknownError: miopenStatus_t = miopenStatus_t(7);
+}
+impl miopenStatus_t {
+ #[doc = "< Unsupported operator for fusion."]
+ pub const miopenStatusUnsupportedOp: miopenStatus_t = miopenStatus_t(8);
+}
+impl miopenStatus_t {
+ #[doc = "< This is not an error."]
+ pub const miopenStatusGpuOperationsSkipped: miopenStatus_t = miopenStatus_t(9);
+}
+impl miopenStatus_t {
+ #[doc = "< Version mismatch of the supplied binary data argment."]
+ pub const miopenStatusVersionMismatch: miopenStatus_t = miopenStatus_t(10);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenStatus_t\n Error codes that are returned by all MIOpen API calls."]
+#[must_use]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenStatus_t(pub ::std::os::raw::c_uint);
+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),
+>;
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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(Copy, Clone)]
+pub struct miopenFusionOpDescriptor {
+ pub _address: u8,
+}
+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. Currently only 4-D fully packed tensors are supported.\n"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct miopenTensorDescriptor {
+ pub _address: u8,
+}
+pub type miopenTensorDescriptor_t = *mut miopenTensorDescriptor;
+#[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(Copy, Clone)]
+pub struct miopenConvolutionDescriptor {
+ pub _address: u8,
+}
+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(Copy, Clone)]
+pub struct miopenPoolingDescriptor {
+ pub _address: u8,
+}
+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(Copy, Clone)]
+pub struct miopenLRNDescriptor {
+ pub _address: u8,
+}
+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(Copy, Clone)]
+pub struct miopenActivationDescriptor {
+ pub _address: u8,
+}
+pub type miopenActivationDescriptor_t = *mut miopenActivationDescriptor;
+#[doc = " @ingroup RNN\n @brief Creates the miopenRNNDescriptor_t type"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct miopenRNNDescriptor {
+ pub _address: u8,
+}
+pub type miopenRNNDescriptor_t = *mut miopenRNNDescriptor;
+#[doc = " @ingroup LossFunction\n @brief Creates the miopenCTCLossDescriptor_t type"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct miopenCTCLossDescriptor {
+ pub _address: u8,
+}
+pub type miopenCTCLossDescriptor_t = *mut miopenCTCLossDescriptor;
+#[doc = " @ingroup Dropout\n @brief Creates the miopenDropoutDescriptor_t type"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct miopenDropoutDescriptor {
+ pub _address: u8,
+}
+pub type miopenDropoutDescriptor_t = *mut miopenDropoutDescriptor;
+#[doc = " @ingroup TensorReduce\n @brief Creates the miopenReduceTensorDescriptor_t type"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct miopenReduceTensorDescriptor {
+ pub _address: u8,
+}
+pub type miopenReduceTensorDescriptor_t = *mut miopenReduceTensorDescriptor;
+impl miopenDataType_t {
+ #[doc = "< 16-bit floating point (Fully supported)"]
+ pub const miopenHalf: miopenDataType_t = miopenDataType_t(0);
+}
+impl miopenDataType_t {
+ #[doc = "< 32-bit floating point (Fully supported)"]
+ pub const miopenFloat: miopenDataType_t = miopenDataType_t(1);
+}
+impl miopenDataType_t {
+ #[doc = "< 32-bit int point (Partially supported)"]
+ pub const miopenInt32: miopenDataType_t = miopenDataType_t(2);
+}
+impl miopenDataType_t {
+ #[doc = "< 8-bit int point (Partially supported)"]
+ pub const miopenInt8: miopenDataType_t = miopenDataType_t(3);
+}
+impl miopenDataType_t {
+ pub const miopenInt8x4: miopenDataType_t = miopenDataType_t(4);
+}
+impl miopenDataType_t {
+ #[doc = "< 16-bit binary floating point (8-bit exponent, 7-bit fraction)\n(Partially supported)"]
+ pub const miopenBFloat16: miopenDataType_t = miopenDataType_t(5);
+}
+impl miopenDataType_t {
+ #[doc = "< 64-bit floating point (Partially supported)"]
+ pub const miopenDouble: miopenDataType_t = miopenDataType_t(6);
+}
+#[repr(transparent)]
+#[doc = " @ingroup tensor\n @enum miopenDataType_t\n MIOpen floating point datatypes. Both 32-bit and 16-bit floats are supported in MIOpen."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenDataType_t(pub ::std::os::raw::c_uint);
+impl miopenTensorLayout_t {
+ #[doc = "< NCHW memory layout (Fully supported)"]
+ pub const miopenTensorNCHW: miopenTensorLayout_t = miopenTensorLayout_t(0);
+}
+impl miopenTensorLayout_t {
+ #[doc = "< NHWC memory layout (Fully supported)"]
+ pub const miopenTensorNHWC: miopenTensorLayout_t = miopenTensorLayout_t(1);
+}
+impl miopenTensorLayout_t {
+ #[doc = "< CHWN memory layout (Not supported)"]
+ pub const miopenTensorCHWN: miopenTensorLayout_t = miopenTensorLayout_t(2);
+}
+impl miopenTensorLayout_t {
+ #[doc = "< NCHWc4 memory layout (Partially supported)"]
+ pub const miopenTensorNCHWc4: miopenTensorLayout_t = miopenTensorLayout_t(3);
+}
+impl miopenTensorLayout_t {
+ #[doc = "< NCHWc8 memory layout (Partially supported)"]
+ pub const miopenTensorNCHWc8: miopenTensorLayout_t = miopenTensorLayout_t(4);
+}
+impl miopenTensorLayout_t {
+ #[doc = "< CHWNc4 memory layout (Partially supported)"]
+ pub const miopenTensorCHWNc4: miopenTensorLayout_t = miopenTensorLayout_t(5);
+}
+impl miopenTensorLayout_t {
+ #[doc = "< CHWNc8 memory layout (Partially supported)"]
+ pub const miopenTensorCHWNc8: miopenTensorLayout_t = miopenTensorLayout_t(6);
+}
+impl miopenTensorLayout_t {
+ #[doc = "< NCDHW memory layout (Fully supported)"]
+ pub const miopenTensorNCDHW: miopenTensorLayout_t = miopenTensorLayout_t(7);
+}
+impl miopenTensorLayout_t {
+ #[doc = "< NCDHW memory layout (Fully supported)"]
+ pub const miopenTensorNDHWC: miopenTensorLayout_t = miopenTensorLayout_t(8);
+}
+#[repr(transparent)]
+#[doc = " @ingroup tensor\n @enum miopenTensorLayout_t\n Tensor layouts supported by MIOpen.\n miopenTensorCHWNc4 and miopenTensorCHWNc8 layout only support weight tensor."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenTensorLayout_t(pub ::std::os::raw::c_uint);
+impl miopenIndexType_t {
+ #[doc = "< 8-bit unsigned"]
+ pub const miopenIndexUint8: miopenIndexType_t = miopenIndexType_t(0);
+}
+impl miopenIndexType_t {
+ #[doc = "< 16-bit unsigned"]
+ pub const miopenIndexUint16: miopenIndexType_t = miopenIndexType_t(1);
+}
+impl miopenIndexType_t {
+ #[doc = "< 32-bit unsigned"]
+ pub const miopenIndexUint32: miopenIndexType_t = miopenIndexType_t(2);
+}
+impl miopenIndexType_t {
+ #[doc = "< 64-bit unsigned"]
+ pub const miopenIndexUint64: miopenIndexType_t = miopenIndexType_t(3);
+}
+#[repr(transparent)]
+#[doc = " @ingroup pooling\n @enum miopenIndexType_t\n MIOpen index datatypes."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenIndexType_t(pub ::std::os::raw::c_uint);
+impl miopenTensorOp_t {
+ #[doc = "< Add tensors element-wise"]
+ pub const miopenTensorOpAdd: miopenTensorOp_t = miopenTensorOp_t(0);
+}
+impl miopenTensorOp_t {
+ #[doc = "< Multiply two tensors element-wise"]
+ pub const miopenTensorOpMul: miopenTensorOp_t = miopenTensorOp_t(1);
+}
+impl miopenTensorOp_t {
+ #[doc = "< Minimum of tensor element pairs"]
+ pub const miopenTensorOpMin: miopenTensorOp_t = miopenTensorOp_t(2);
+}
+impl miopenTensorOp_t {
+ #[doc = "< Maximum of tensor element pairs"]
+ pub const miopenTensorOpMax: miopenTensorOp_t = miopenTensorOp_t(3);
+}
+#[repr(transparent)]
+#[doc = " @ingroup tensor\n @enum miopenTensorOp_t\n Element-wise tensor operation modes"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenTensorOp_t(pub ::std::os::raw::c_uint);
+impl miopenConvolutionMode_t {
+ #[doc = "< Cross-Correlation convolution"]
+ pub const miopenConvolution: miopenConvolutionMode_t = miopenConvolutionMode_t(0);
+}
+impl miopenConvolutionMode_t {
+ #[doc = "< Transpose convolutions -- deconvolution"]
+ pub const miopenTranspose: miopenConvolutionMode_t = miopenConvolutionMode_t(1);
+}
+impl miopenConvolutionMode_t {
+ #[doc = "< Deprecated Group convolution legacy, ToBe Removed"]
+ pub const miopenGroupConv: miopenConvolutionMode_t = miopenConvolutionMode_t(2);
+}
+impl miopenConvolutionMode_t {
+ #[doc = "< Deprecated Depthwise convolution legacy, ToBe Removed"]
+ pub const miopenDepthwise: miopenConvolutionMode_t = miopenConvolutionMode_t(3);
+}
+#[repr(transparent)]
+#[doc = " @ingroup convolutions\n @enum miopenConvolutionMode_t\n Convolution mode selection for convolution layer preference."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenConvolutionMode_t(pub ::std::os::raw::c_uint);
+impl miopenPoolingMode_t {
+ #[doc = "< Maximum pooling"]
+ pub const miopenPoolingMax: miopenPoolingMode_t = miopenPoolingMode_t(0);
+}
+impl miopenPoolingMode_t {
+ #[doc = "< Average pooling"]
+ pub const miopenPoolingAverage: miopenPoolingMode_t = miopenPoolingMode_t(1);
+}
+impl miopenPoolingMode_t {
+ #[doc = "< Inclusive Average pooling"]
+ pub const miopenPoolingAverageInclusive: miopenPoolingMode_t = miopenPoolingMode_t(2);
+}
+#[repr(transparent)]
+#[doc = " @ingroup pooling\n @enum miopenPoolingMode_t\n Pooling layer mode"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenPoolingMode_t(pub ::std::os::raw::c_uint);
+impl miopenPoolingWorkspaceIndexMode_t {
+ #[doc = "< Use mask indices, 2D pooling only"]
+ pub const miopenPoolingWorkspaceIndexMask: miopenPoolingWorkspaceIndexMode_t =
+ miopenPoolingWorkspaceIndexMode_t(0);
+}
+impl miopenPoolingWorkspaceIndexMode_t {
+ #[doc = "< Use image indices"]
+ pub const miopenPoolingWorkspaceIndexImage: miopenPoolingWorkspaceIndexMode_t =
+ miopenPoolingWorkspaceIndexMode_t(1);
+}
+#[repr(transparent)]
+#[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."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenPoolingWorkspaceIndexMode_t(pub ::std::os::raw::c_uint);
+impl miopenLRNMode_t {
+ #[doc = "< Channel independent"]
+ pub const miopenLRNWithinChannel: miopenLRNMode_t = miopenLRNMode_t(0);
+}
+impl miopenLRNMode_t {
+ #[doc = "< Cross Channel"]
+ pub const miopenLRNCrossChannel: miopenLRNMode_t = miopenLRNMode_t(1);
+}
+#[repr(transparent)]
+#[doc = " @ingroup LRN\n @enum miopenLRNMode_t\n Local Response Normalization layer mode"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenLRNMode_t(pub ::std::os::raw::c_uint);
+impl miopenBatchNormMode_t {
+ #[doc = "< Element-wise normalization for fully connected layer"]
+ pub const miopenBNPerActivation: miopenBatchNormMode_t = miopenBatchNormMode_t(0);
+}
+impl miopenBatchNormMode_t {
+ #[doc = "< Mini-batch spatial normalization for convolutional layers"]
+ pub const miopenBNSpatial: miopenBatchNormMode_t = miopenBatchNormMode_t(1);
+}
+#[repr(transparent)]
+#[doc = " @ingroup batchnorm\n @enum miopenBatchNormMode_t\n Batch Normalization layer mode"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenBatchNormMode_t(pub ::std::os::raw::c_uint);
+impl miopenActivationMode_t {
+ #[doc = "< No activation, pass through the data"]
+ pub const miopenActivationPASTHRU: miopenActivationMode_t = miopenActivationMode_t(0);
+}
+impl miopenActivationMode_t {
+ #[doc = "< Sigmoid function: \\f$1 / (1 + e^{-x})\\f$"]
+ pub const miopenActivationLOGISTIC: miopenActivationMode_t = miopenActivationMode_t(1);
+}
+impl miopenActivationMode_t {
+ #[doc = "< Tanh activation \\f$ \\beta * tanh( \\alpha * x) \\f$"]
+ pub const miopenActivationTANH: miopenActivationMode_t = miopenActivationMode_t(2);
+}
+impl miopenActivationMode_t {
+ #[doc = "< Rectified Linear Unit \\f$ max(0, x) \\f$"]
+ pub const miopenActivationRELU: miopenActivationMode_t = miopenActivationMode_t(3);
+}
+impl miopenActivationMode_t {
+ #[doc = "< \\f$log(1 + e^x)\\f$"]
+ pub const miopenActivationSOFTRELU: miopenActivationMode_t = miopenActivationMode_t(4);
+}
+impl miopenActivationMode_t {
+ #[doc = "< Absolute value \\f$abs(x)\\f$"]
+ pub const miopenActivationABS: miopenActivationMode_t = miopenActivationMode_t(5);
+}
+impl miopenActivationMode_t {
+ #[doc = "< Scaled and shifted power \\f$(\\alpha + \\beta * x)^{gamma}\\f$"]
+ pub const miopenActivationPOWER: miopenActivationMode_t = miopenActivationMode_t(6);
+}
+impl miopenActivationMode_t {
+ pub const miopenActivationCLIPPEDRELU: miopenActivationMode_t = miopenActivationMode_t(7);
+}
+impl miopenActivationMode_t {
+ pub const miopenActivationLEAKYRELU: miopenActivationMode_t = miopenActivationMode_t(8);
+}
+impl miopenActivationMode_t {
+ pub const miopenActivationELU: miopenActivationMode_t = miopenActivationMode_t(9);
+}
+#[repr(transparent)]
+#[doc = " @ingroup activation\n @enum miopenActivationMode_t\n Activation layer modes"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenActivationMode_t(pub ::std::os::raw::c_uint);
+impl miopenSoftmaxAlgorithm_t {
+ #[doc = "< straightforward softmax"]
+ pub const MIOPEN_SOFTMAX_FAST: miopenSoftmaxAlgorithm_t = miopenSoftmaxAlgorithm_t(0);
+}
+impl miopenSoftmaxAlgorithm_t {
+ #[doc = "< scaled softmax by maximum value in input domain"]
+ pub const MIOPEN_SOFTMAX_ACCURATE: miopenSoftmaxAlgorithm_t = miopenSoftmaxAlgorithm_t(1);
+}
+impl miopenSoftmaxAlgorithm_t {
+ #[doc = "< log softmax"]
+ pub const MIOPEN_SOFTMAX_LOG: miopenSoftmaxAlgorithm_t = miopenSoftmaxAlgorithm_t(2);
+}
+#[repr(transparent)]
+#[doc = " @ingroup softmax\n @enum miopenSoftmaxAlgorithm_t\n Softmax implementation algorithms"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenSoftmaxAlgorithm_t(pub ::std::os::raw::c_uint);
+impl miopenSoftmaxMode_t {
+ #[doc = "< compute per image (N) across C, H, W"]
+ pub const MIOPEN_SOFTMAX_MODE_INSTANCE: miopenSoftmaxMode_t = miopenSoftmaxMode_t(0);
+}
+impl miopenSoftmaxMode_t {
+ pub const MIOPEN_SOFTMAX_MODE_CHANNEL: miopenSoftmaxMode_t = miopenSoftmaxMode_t(1);
+}
+#[repr(transparent)]
+#[doc = " @ingroup softmax\n @enum miopenSoftmaxMode_t\n Softmax modes"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenSoftmaxMode_t(pub ::std::os::raw::c_uint);
+impl miopenReduceTensorOp_t {
+ #[doc = "< the operation is adding the values of the reduced elements"]
+ pub const MIOPEN_REDUCE_TENSOR_ADD: miopenReduceTensorOp_t = miopenReduceTensorOp_t(0);
+}
+impl miopenReduceTensorOp_t {
+ pub const MIOPEN_REDUCE_TENSOR_MUL: miopenReduceTensorOp_t = miopenReduceTensorOp_t(1);
+}
+impl miopenReduceTensorOp_t {
+ pub const MIOPEN_REDUCE_TENSOR_MIN: miopenReduceTensorOp_t = miopenReduceTensorOp_t(2);
+}
+impl miopenReduceTensorOp_t {
+ pub const MIOPEN_REDUCE_TENSOR_MAX: miopenReduceTensorOp_t = miopenReduceTensorOp_t(3);
+}
+impl miopenReduceTensorOp_t {
+ pub const MIOPEN_REDUCE_TENSOR_AMAX: miopenReduceTensorOp_t = miopenReduceTensorOp_t(4);
+}
+impl miopenReduceTensorOp_t {
+ pub const MIOPEN_REDUCE_TENSOR_AVG: miopenReduceTensorOp_t = miopenReduceTensorOp_t(5);
+}
+impl miopenReduceTensorOp_t {
+ pub const MIOPEN_REDUCE_TENSOR_NORM1: miopenReduceTensorOp_t = miopenReduceTensorOp_t(6);
+}
+impl miopenReduceTensorOp_t {
+ #[doc = "< the operation is getting the square root of the sum of\nsquares of the reduced elements"]
+ pub const MIOPEN_REDUCE_TENSOR_NORM2: miopenReduceTensorOp_t = miopenReduceTensorOp_t(7);
+}
+#[repr(transparent)]
+#[doc = " @ingroup TensorReduce\n @enum miopenReduceTensorOp_t\n Tensor Reduction operation types"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenReduceTensorOp_t(pub ::std::os::raw::c_uint);
+impl miopenNanPropagation_t {
+ #[doc = "< does not propagate Nan number"]
+ pub const MIOPEN_NOT_PROPAGATE_NAN: miopenNanPropagation_t = miopenNanPropagation_t(0);
+}
+impl miopenNanPropagation_t {
+ #[doc = "< propagate the Nan number by the Reduction operation"]
+ pub const MIOPEN_PROPAGATE_NAN: miopenNanPropagation_t = miopenNanPropagation_t(1);
+}
+#[repr(transparent)]
+#[doc = " @ingroup TensorReduce\n @enum miopenReduceTensorOp_t\n Nan numbers propagation modes"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenNanPropagation_t(pub ::std::os::raw::c_uint);
+impl miopenReduceTensorIndices_t {
+ #[doc = "< Does not compuate indices"]
+ pub const MIOPEN_REDUCE_TENSOR_NO_INDICES: miopenReduceTensorIndices_t =
+ miopenReduceTensorIndices_t(0);
+}
+impl miopenReduceTensorIndices_t {
+ #[doc = "< Compute the relative, flatted indices"]
+ pub const MIOPEN_REDUCE_TENSOR_FLATTENED_INDICES: miopenReduceTensorIndices_t =
+ miopenReduceTensorIndices_t(1);
+}
+#[repr(transparent)]
+#[doc = " @ingroup TensorReduce\n @enum miopenReduceTensorIndices_t\n Reduction Indices computation modes"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenReduceTensorIndices_t(pub ::std::os::raw::c_uint);
+impl miopenIndicesType_t {
+ #[doc = "< unsigned integer indices"]
+ pub const MIOPEN_32BIT_INDICES: miopenIndicesType_t = miopenIndicesType_t(0);
+}
+impl miopenIndicesType_t {
+ #[doc = "< unsigned long indices"]
+ pub const MIOPEN_64BIT_INDICES: miopenIndicesType_t = miopenIndicesType_t(1);
+}
+impl miopenIndicesType_t {
+ #[doc = "< unsigned short indices"]
+ pub const MIOPEN_16BIT_INDICES: miopenIndicesType_t = miopenIndicesType_t(2);
+}
+impl miopenIndicesType_t {
+ #[doc = "< unsigned char indices"]
+ pub const MIOPEN_8BIT_INDICES: miopenIndicesType_t = miopenIndicesType_t(3);
+}
+#[repr(transparent)]
+#[doc = " @ingroup TensorReduce\n @enum miopenIndicesType_t\n Reduction Indices types"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenIndicesType_t(pub ::std::os::raw::c_uint);
+impl miopenConvolutionAttrib_t {
+ pub const MIOPEN_CONVOLUTION_ATTRIB_FP16_ALT_IMPL: miopenConvolutionAttrib_t =
+ miopenConvolutionAttrib_t(0);
+}
+impl miopenConvolutionAttrib_t {
+ pub const MIOPEN_CONVOLUTION_ATTRIB_DETERMINISTIC: miopenConvolutionAttrib_t =
+ miopenConvolutionAttrib_t(1);
+}
+#[repr(transparent)]
+#[doc = " @ingroup convolutions\n @enum miopenConvolutionAttrib_t\n Attribute for convolution descriptor, used for alternating the convolution behavior"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenConvolutionAttrib_t(pub ::std::os::raw::c_uint);
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Set shape of 4D tensor\n\n Interface for setting 4-D tensor shape. MIOpen currently only implements NCHW layout.\n\n @param tensorDesc Tensor descriptor type (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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Set shape of ND tensor with specific layout\n\n Interface for setting N-D tensor shape. This interface support NHWC, NCHW, NCHWc*, CHWNc*\n @param tensorDesc Tensor descriptor type (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: *mut ::std::os::raw::c_int,
+ num_lens: ::std::os::raw::c_int,
+ ) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Set shape and stride of 4D tensor\n\n Interface for setting 4-D tensor shape and stride.\n\n @param tensorDesc Tensor descriptor type (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;
+}
+extern "C" {
+ #[must_use]
+ #[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 type (input)\n @param dataType MIOpen datatype (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 @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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Set shape of N-dimensional tensor\n\n Interface for setting tensor shape. MIOpen has support for 1, 2, 3, 4, 5 dimensional tensor of\n layout.\n @param tensorDesc Tensor descriptor type (input)\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: *mut ::std::os::raw::c_int,
+ stridesA: *mut ::std::os::raw::c_int,
+ ) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[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 type (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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Get the details of the N-dimensional tensor descriptor.\n\n @param tensorDesc Tensor descriptor type (input)\n @param dataType MIOpen datatype (input)\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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Destroys the tensor descriptor\n\n @param tensorDesc Tensor descriptor type (input)\n @return miopenStatus_t"]
+ pub fn miopenDestroyTensorDescriptor(tensorDesc: miopenTensorDescriptor_t) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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: *mut ::std::os::raw::c_int,
+ strideA: *mut ::std::os::raw::c_int,
+ dilationA: *mut ::std::os::raw::c_int,
+ c_mode: miopenConvolutionMode_t,
+ ) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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: *mut ::std::os::raw::c_int,
+ ) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+impl miopenConvFwdAlgorithm_t {
+ #[doc = "< GEMM variant"]
+ pub const miopenConvolutionFwdAlgoGEMM: miopenConvFwdAlgorithm_t = miopenConvFwdAlgorithm_t(0);
+}
+impl miopenConvFwdAlgorithm_t {
+ #[doc = "< Direct convolutions"]
+ pub const miopenConvolutionFwdAlgoDirect: miopenConvFwdAlgorithm_t =
+ miopenConvFwdAlgorithm_t(1);
+}
+impl miopenConvFwdAlgorithm_t {
+ #[doc = "< Fast Fourier Transform indirect convolutions"]
+ pub const miopenConvolutionFwdAlgoFFT: miopenConvFwdAlgorithm_t = miopenConvFwdAlgorithm_t(2);
+}
+impl miopenConvFwdAlgorithm_t {
+ #[doc = "< Winograd indirect convolutions"]
+ pub const miopenConvolutionFwdAlgoWinograd: miopenConvFwdAlgorithm_t =
+ miopenConvFwdAlgorithm_t(3);
+}
+impl miopenConvFwdAlgorithm_t {
+ #[doc = "< Implicit GEMM convolutions, fp32 only"]
+ pub const miopenConvolutionFwdAlgoImplicitGEMM: miopenConvFwdAlgorithm_t =
+ miopenConvFwdAlgorithm_t(5);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenConvFwdAlgorithm_t\n Convolutional algorithm mode for forward propagation. MIOpen use cross-correlation for its\n convolution implementation."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenConvFwdAlgorithm_t(pub ::std::os::raw::c_uint);
+impl miopenConvBwdWeightsAlgorithm_t {
+ #[doc = "< GEMM variant"]
+ pub const miopenConvolutionBwdWeightsAlgoGEMM: miopenConvBwdWeightsAlgorithm_t =
+ miopenConvBwdWeightsAlgorithm_t(0);
+}
+impl miopenConvBwdWeightsAlgorithm_t {
+ #[doc = "< Direct convolution algorithm"]
+ pub const miopenConvolutionBwdWeightsAlgoDirect: miopenConvBwdWeightsAlgorithm_t =
+ miopenConvBwdWeightsAlgorithm_t(1);
+}
+impl miopenConvBwdWeightsAlgorithm_t {
+ #[doc = "< Winograd convolutions"]
+ pub const miopenConvolutionBwdWeightsAlgoWinograd: miopenConvBwdWeightsAlgorithm_t =
+ miopenConvBwdWeightsAlgorithm_t(3);
+}
+impl miopenConvBwdWeightsAlgorithm_t {
+ #[doc = "< Implicit GEMM convolutions"]
+ pub const miopenConvolutionBwdWeightsAlgoImplicitGEMM: miopenConvBwdWeightsAlgorithm_t =
+ miopenConvBwdWeightsAlgorithm_t(5);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenConvBwdWeightsAlgorithm_t\n Convolutional algorithm mode for back propagation on weights."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenConvBwdWeightsAlgorithm_t(pub ::std::os::raw::c_uint);
+impl miopenConvBwdDataAlgorithm_t {
+ #[doc = "< GEMM variant"]
+ pub const miopenConvolutionBwdDataAlgoGEMM: miopenConvBwdDataAlgorithm_t =
+ miopenConvBwdDataAlgorithm_t(0);
+}
+impl miopenConvBwdDataAlgorithm_t {
+ #[doc = "< Direct convolutions"]
+ pub const miopenConvolutionBwdDataAlgoDirect: miopenConvBwdDataAlgorithm_t =
+ miopenConvBwdDataAlgorithm_t(1);
+}
+impl miopenConvBwdDataAlgorithm_t {
+ #[doc = "< Fast Fourier Transform indirect convolutions"]
+ pub const miopenConvolutionBwdDataAlgoFFT: miopenConvBwdDataAlgorithm_t =
+ miopenConvBwdDataAlgorithm_t(2);
+}
+impl miopenConvBwdDataAlgorithm_t {
+ #[doc = "< Winograd indirect convolutions"]
+ pub const miopenConvolutionBwdDataAlgoWinograd: miopenConvBwdDataAlgorithm_t =
+ miopenConvBwdDataAlgorithm_t(3);
+}
+impl miopenConvBwdDataAlgorithm_t {
+ pub const miopenTransposeBwdDataAlgoGEMM: miopenConvBwdDataAlgorithm_t =
+ miopenConvBwdDataAlgorithm_t(4);
+}
+impl miopenConvBwdDataAlgorithm_t {
+ #[doc = "< Implicit GEMM convolutions, fp32 only"]
+ pub const miopenConvolutionBwdDataAlgoImplicitGEMM: miopenConvBwdDataAlgorithm_t =
+ miopenConvBwdDataAlgorithm_t(5);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenConvBwdDataAlgorithm_t\n Convolutional algorithm mode for back propagation on data."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenConvBwdDataAlgorithm_t(pub ::std::os::raw::c_uint);
+impl miopenConvAlgorithm_t {
+ #[doc = "< GEMM variant"]
+ pub const miopenConvolutionAlgoGEMM: miopenConvAlgorithm_t = miopenConvAlgorithm_t(0);
+}
+impl miopenConvAlgorithm_t {
+ #[doc = "< Direct convolutions"]
+ pub const miopenConvolutionAlgoDirect: miopenConvAlgorithm_t = miopenConvAlgorithm_t(1);
+}
+impl miopenConvAlgorithm_t {
+ #[doc = "< Fast Fourier Transform indirect convolutions"]
+ pub const miopenConvolutionAlgoFFT: miopenConvAlgorithm_t = miopenConvAlgorithm_t(2);
+}
+impl miopenConvAlgorithm_t {
+ #[doc = "< Winograd indirect convolutions"]
+ pub const miopenConvolutionAlgoWinograd: miopenConvAlgorithm_t = miopenConvAlgorithm_t(3);
+}
+impl miopenConvAlgorithm_t {
+ #[doc = "< Implicit GEMM convolutions, fp32 only"]
+ pub const miopenConvolutionAlgoImplicitGEMM: miopenConvAlgorithm_t = miopenConvAlgorithm_t(5);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenConvAlgorithm_t\n Top-level convolutional algorithm mode"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenConvAlgorithm_t(pub ::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(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,
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Query the workspace size required for a forward convolution layer\n\n This call is required and must be executed once before running\n miopenFindConvolutionForwardAlgorithm()\n in order to determine the largest required allocation for the algorithm search; i.e., the maximum\n size\n of the memory needed from the set of potential forward convolution algorithm is returned.\n\n If using Group/Depthwise convolution mode, call miopenSetConvolutionGroupCount() before running\n this.\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;
+}
+extern "C" {
+ #[must_use]
+ #[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 required for the search (output)\n @param workSpaceSize Size in bytes of the memory needed for find (output)\n @param exhaustiveSearch A boolean to toggle a full search of all algorithms and configurations\n (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;
+}
+extern "C" {
+ #[must_use]
+ #[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\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;
+}
+extern "C" {
+ #[must_use]
+ #[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\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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Get the GPU memory required for the backward data convolution algorithm.\n\n For a provided tensor descriptors and algorithm selection, this function calculates and returns\n the workspace size required for back propagation on data. This call is required and must be\n executed once before running miopenFindConvolutionBackwardDataAlgorithm() in order to determine\n the largest required allocation for the algorithm search; i.e., the maximum size of the memory\n needed from the set of potential backward convolution algorithm is returned.\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 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;
+}
+extern "C" {
+ #[must_use]
+ #[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 required for the search (output)\n @param workSpaceSize Size in bytes of the memory needed for find (output)\n @param exhaustiveSearch A boolean to toggle a full search of all algorithms and configurations\n (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;
+}
+extern "C" {
+ #[must_use]
+ #[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 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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Get the GPU memory required for the backward weights convolution algorithm.\n\n\n For a provided tensor descriptors and algorithm selection, this function calculates and returns\n the workspace size required for back propagation on data. This call is required and must be\n executed once before running miopenFindConvolutionBackwardWeightsAlgorithm() in order to\n determine\n the largest required allocation for the algorithm search; i.e., the maximum size of the memory\n needed from the set of potential backward weights convolution algorithm is returned.\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 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;
+}
+extern "C" {
+ #[must_use]
+ #[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 required for the search (output)\n @param workSpaceSize Size in bytes of the memory needed for find (output)\n @param exhaustiveSearch A boolean to toggle a full search of all algorithms and configurations\n (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;
+}
+extern "C" {
+ #[must_use]
+ #[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 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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Calculates the gradient with respect to the bias.\n\n Compute the convolution backwards gradient with respect to the bias tensor.\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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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: *mut ::std::os::raw::c_int,
+ padA: *mut ::std::os::raw::c_int,
+ stridesA: *mut ::std::os::raw::c_int,
+ ) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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 espilon\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;
+}
+extern "C" {
+ #[must_use]
+ #[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-bathc 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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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(Copy, Clone)]
+pub struct miopenFusionPlanDescriptor {
+ pub _address: u8,
+}
+pub type miopenFusionPlanDescriptor_t = *mut miopenFusionPlanDescriptor;
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct miopenOperatorArgs {
+ pub _address: u8,
+}
+pub type miopenOperatorArgs_t = *mut miopenOperatorArgs;
+impl miopenFusionDirection_t {
+ #[doc = "< fuses layers vertically, current the only supported mode"]
+ pub const miopenVerticalFusion: miopenFusionDirection_t = miopenFusionDirection_t(0);
+}
+impl miopenFusionDirection_t {
+ #[doc = "< fuses layers horizontally, this is unimplemented"]
+ pub const miopenHorizontalFusion: miopenFusionDirection_t = miopenFusionDirection_t(1);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenFusionDirection_t\n @brief Kernel fusion direction in the network"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenFusionDirection_t(pub ::std::os::raw::c_uint);
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Query the workspace size required for the fusion plan\n\n @param fusePlanDesc A fusion plan descriptor (input)\n @param workSpaceSize Pointer to memory to return size in bytes (output)\n @return miopenStatus_t"]
+ pub fn miopenFusionPlanGetWorkSpaceSize(
+ handle: miopenHandle_t,
+ fusePlanDesc: miopenFusionPlanDescriptor_t,
+ workSpaceSize: *mut usize,
+ algo: miopenConvFwdAlgorithm_t,
+ ) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Executes the fusion plan\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 Decriptor 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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Prepares and executes the Convlution+Bias+Activation Fusion\n\n\n @param handle MIOpen handle (input)\n @return miopenStatus_t"]
+ 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;
+}
+impl miopenRNNMode_t {
+ #[doc = "< RNN with ReLU activation"]
+ pub const miopenRNNRELU: miopenRNNMode_t = miopenRNNMode_t(0);
+}
+impl miopenRNNMode_t {
+ #[doc = "< RNN with tanh activation"]
+ pub const miopenRNNTANH: miopenRNNMode_t = miopenRNNMode_t(1);
+}
+impl miopenRNNMode_t {
+ #[doc = "< LSTM"]
+ pub const miopenLSTM: miopenRNNMode_t = miopenRNNMode_t(2);
+}
+impl miopenRNNMode_t {
+ #[doc = "< GRU"]
+ pub const miopenGRU: miopenRNNMode_t = miopenRNNMode_t(3);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenRNNMode_t\n RNN mode selection for rnn layer preference"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenRNNMode_t(pub ::std::os::raw::c_uint);
+impl miopenRNNInputMode_t {
+ #[doc = "< Matrix multiplication at the input of the first layer"]
+ pub const miopenRNNlinear: miopenRNNInputMode_t = miopenRNNInputMode_t(0);
+}
+impl miopenRNNInputMode_t {
+ #[doc = "< No operation is performed at the input of the first layer."]
+ pub const miopenRNNskip: miopenRNNInputMode_t = miopenRNNInputMode_t(1);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenRNNInputMode_t\n Recurrent Neural Network layer initial input mode"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenRNNInputMode_t(pub ::std::os::raw::c_uint);
+impl miopenRNNAlgo_t {
+ #[doc = "< Use dedicated gate-operation kernel for LSTM and fundamental\nalgorithm for vanilla RNN & GRU"]
+ pub const miopenRNNdefault: miopenRNNAlgo_t = miopenRNNAlgo_t(0);
+}
+impl miopenRNNAlgo_t {
+ pub const miopenRNNfundamental: miopenRNNAlgo_t = miopenRNNAlgo_t(1);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenRNNAlgo_t\n Recurrent Neural Network algorithm mode"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenRNNAlgo_t(pub ::std::os::raw::c_uint);
+impl miopenRNNDirectionMode_t {
+ #[doc = "< Forward in time only."]
+ pub const miopenRNNunidirection: miopenRNNDirectionMode_t = miopenRNNDirectionMode_t(0);
+}
+impl miopenRNNDirectionMode_t {
+ #[doc = "< Forward and backwards in time."]
+ pub const miopenRNNbidirection: miopenRNNDirectionMode_t = miopenRNNDirectionMode_t(1);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenRNNDirectionMode_t\n Recurrent Neural Network bi-directional behavior"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenRNNDirectionMode_t(pub ::std::os::raw::c_uint);
+impl miopenRNNBiasMode_t {
+ #[doc = "< No Biases will be applied to GEMM operations"]
+ pub const miopenRNNNoBias: miopenRNNBiasMode_t = miopenRNNBiasMode_t(0);
+}
+impl miopenRNNBiasMode_t {
+ #[doc = "< Biases will be applied to GEMM operations"]
+ pub const miopenRNNwithBias: miopenRNNBiasMode_t = miopenRNNBiasMode_t(1);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenRNNBiasMode_t\n Recurrent Neural Network add on bias"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenRNNBiasMode_t(pub ::std::os::raw::c_uint);
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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 Only fp32 currently supported for RNNs (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;
+}
+extern "C" {
+ #[must_use]
+ #[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 Only fp32 currently supported for RNNs (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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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, currently only fp32 is supported (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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Obtain a 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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Obtain a 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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+impl miopenCTCLossAlgo_t {
+ #[doc = "< Results are guaranteed to be reproducible"]
+ pub const MIOPEN_CTC_LOSS_ALGO_DETERMINISTIC: miopenCTCLossAlgo_t = miopenCTCLossAlgo_t(0);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenCTCLossAlgo_t\n Algorithms available to execute the CTC loss operation"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenCTCLossAlgo_t(pub ::std::os::raw::c_uint);
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+impl miopenRNGType_t {
+ #[doc = "< XORWOW pseudorandom generator"]
+ pub const MIOPEN_RNG_PSEUDO_XORWOW: miopenRNGType_t = miopenRNGType_t(0);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenRNGType_t\n random number generator type"]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenRNGType_t(pub ::std::os::raw::c_uint);
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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(Copy, Clone)]
+pub struct miopenProblem {
+ pub _address: u8,
+}
+pub type miopenProblem_t = *mut miopenProblem;
+impl miopenProblemDirection_t {
+ pub const miopenProblemDirectionForward: miopenProblemDirection_t = miopenProblemDirection_t(0);
+}
+impl miopenProblemDirection_t {
+ pub const miopenProblemDirectionBackward: miopenProblemDirection_t =
+ miopenProblemDirection_t(1);
+}
+impl miopenProblemDirection_t {
+ pub const miopenProblemDirectionBackwardWeights: miopenProblemDirection_t =
+ miopenProblemDirection_t(2);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenProblemDirection_t\n Directions of miopen operation."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenProblemDirection_t(pub ::std::os::raw::c_uint);
+impl miopenTensorArgumentId_t {
+ pub const miopenTensorArgumentIdInvalid: miopenTensorArgumentId_t = miopenTensorArgumentId_t(0);
+}
+impl miopenTensorArgumentId_t {
+ pub const miopenTensorConvolutionX: miopenTensorArgumentId_t = miopenTensorArgumentId_t(1);
+}
+impl miopenTensorArgumentId_t {
+ pub const miopenTensorConvolutionW: miopenTensorArgumentId_t = miopenTensorArgumentId_t(2);
+}
+impl miopenTensorArgumentId_t {
+ pub const miopenTensorConvolutionY: miopenTensorArgumentId_t = miopenTensorArgumentId_t(3);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenTensorArgumentId_t\n Identifiers for tensor arguments of problems and operations."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenTensorArgumentId_t(pub ::std::os::raw::c_uint);
+impl miopenFindResultsOrder_t {
+ pub const miopenFindResultsOrderByTime: miopenFindResultsOrder_t = miopenFindResultsOrder_t(0);
+}
+impl miopenFindResultsOrder_t {
+ pub const miopenFindResultsOrderByWorkspaceSize: miopenFindResultsOrder_t =
+ miopenFindResultsOrder_t(1);
+}
+#[repr(transparent)]
+#[doc = " @enum miopenTensorArgumentId_t\n Different ways to sort results of the find call."]
+#[derive(Copy, Clone, Hash, PartialEq, Eq)]
+pub struct miopenFindResultsOrder_t(pub ::std::os::raw::c_uint);
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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(Copy, Clone)]
+pub struct miopenFindOptions {
+ pub _address: u8,
+}
+pub type miopenFindOptions_t = *mut miopenFindOptions;
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Sets the tuning find option. Default value is zero.\n\n @param options Options object to upfate\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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Sets the results order find option. Default value is miopenFindResultsOrderByTime.\n\n @param options Options object to upfate\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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Sets the workspace limit find option. Default value is maximum of size_t\n\n @param options Options object to upfate\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;
+}
+#[doc = " @brief The miopenSolution object describes a prepared solution."]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct miopenSolution {
+ pub _address: u8,
+}
+pub type miopenSolution_t = *mut miopenSolution;
+extern "C" {
+ #[must_use]
+ #[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 argument for the miopenRunSolution function."]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct miopenTensorArgument_t {
+ pub id: miopenTensorArgumentId_t,
+ pub descriptor: *mut miopenTensorDescriptor_t,
+ pub buffer: *mut ::std::os::raw::c_void,
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Destroys solution object.\n\n @param solution Solution to destroy\n @return miopenStatus_t"]
+ pub fn miopenDestroySolution(solution: miopenSolution_t) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[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 soltuion to\n @return miopenStatus_t"]
+ pub fn miopenSaveSolution(
+ solution: miopenSolution_t,
+ data: *mut ::std::os::raw::c_char,
+ ) -> miopenStatus_t;
+}
+extern "C" {
+ #[must_use]
+ #[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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Reads the amount of workspace required to exectute 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;
+}
+extern "C" {
+ #[must_use]
+ #[doc = " @brief Reads the time spent to execute the solution the last it was run.\n\n @param solution Solution to get exection 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;
+}