MPSMatrixVectorMultiplication(3)

NAME
MPSMatrixVectorMultiplication

SYNOPSIS

#import <MPSMatrixMultiplication.h>

Inherits MPSMatrixBinaryKernel.

  Instance Methods
(nonnull instancetype) - initWithDevice:transpose:rows:columns:alpha:beta:
(nonnull instancetype) - initWithDevice:rows:columns:
(nonnull instancetype) - initWithDevice:
(void) - encodeToCommandBuffer:inputMatrix:inputVector:resultVector:

  Additional Inherited Members

Detailed Description

This depends on Metal.framework.

A matrix-vector multiplication kernel.

A MPSMatrixVectorMultiplication object computes:

            y = alpha * op(A) * x + beta * y
        A is a matrix represented by a MPSMatrix object. alpha and beta
        are scalar values (of the same data type as values of y) which are
        applied as shown above.  A may have an optional transposition
        operation applied.
        A MPSMatrixVectorMultiplication object is initialized with the transpose
        operator to apply to A, sizes for the operation to perform,
        and the scalar values alpha and beta.

Method Documentation

  - (void) encodeToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(MPSMatrix *__nonnull) inputMatrix(MPSVector *__nonnull) inputVector(MPSVector *__nonnull) resultVector
Encode a MPSMatrixVectorMultiplication object to a command buffer.

Parameters:
    commandBuffer A valid MTLCommandBuffer to receive the encoded kernel.
    inputMatrix A valid MPSMatrix object which specifies the input matrix A.
    inputVector A valid MPSVector object which specifies the input vector x.
    resultVector A valid MPSVector object which specifies the addend vector which will also be overwritten by the result.

The left input matrix must be large enough to hold an array of size (rows x columns) elements beginning at primarySourceMatrixOrigin.

The input vector must be large enough to hold an array of size (columns) elements beginning at secondarySourceMatrixOrigin.x secondarySourceMatrixOrigin.y and secondarySourceMatrixOrigin.z must be zero.

The result vector must be large enough to hold an array of size (rows) elements beginning at resultMatrixOrigin.x. resultMatrixOrigin.y and resultMatrixOrigin.z must be zero.

  - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device
Use the above initialization method instead.

Reimplemented from MPSKernel.

  - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(NSUInteger) rows(NSUInteger) columns
Convenience initialization for a matrix-vector multiplication with no transposition, unit scaling of the product, and no accumulation of the result. The scaling factors alpha and beta are taken to be 1.0 and 0.0 respectively.

Parameters:
    device The device on which the kernel will execute.
    rows The number of rows in the input matrix A, and the number of elements in the vector y.
    columns The number of columns in the input matrix A, and the number of elements in the input vector x.

Returns:
    A valid MPSMatrixVectorMultiplication object or nil, if failure.

  - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(BOOL) transpose(NSUInteger) rows(NSUInteger) columns(double) alpha(double) beta
Initialize an MPSMatrixVectorMultiplication object on a device for a given size and desired transpose and scale values.

Parameters:
    device The device on which the kernel will execute.
    transpose A boolean value which indicates if the input matrix should be used in transposed form. if 'YES' then op(A) == A**T, otherwise op(A) == A.
    rows The number of rows in the input matrix op(A), and the number of elements in the vector y.
    columns The number of columns in the input matrix op(A), and the number of elements in the input vector x.
    alpha The scale factor to apply to the product. Specified in double precision. Will be converted to the appropriate precision in the implementation subject to rounding and/or clamping as necessary.
    beta The scale factor to apply to the initial values of y. Specified in double precision. Will be converted to the appropriate precision in the implementation subject to rounding and/or clamping as necessary.

Returns:
    A valid MPSMatrixVectorMultiplication object or nil, if failure.

Author

Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.