Class MPSMatrixVectorMultiplication

  • All Implemented Interfaces:
    NSCoding, NSCopying, NSSecureCoding, NSObject

    public class MPSMatrixVectorMultiplication
    extends MPSMatrixBinaryKernel
    MPSMatrixVectorMultiplication [@dependency] 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.
    • Constructor Detail

      • MPSMatrixVectorMultiplication

        protected MPSMatrixVectorMultiplication​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • encodeToCommandBufferInputMatrixInputVectorResultVector

        public void encodeToCommandBufferInputMatrixInputVectorResultVector​(MTLCommandBuffer commandBuffer,
                                                                            MPSMatrix inputMatrix,
                                                                            MPSVector inputVector,
                                                                            MPSVector resultVector)
        Encode a MPSMatrixVectorMultiplication object to a command buffer. 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.
        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.
      • hash_static

        public static long hash_static()
      • initWithCoderDevice

        public MPSMatrixVectorMultiplication initWithCoderDevice​(NSCoder aDecoder,
                                                                 java.lang.Object device)
        Description copied from class: MPSKernel
        NSSecureCoding compatability While the standard NSSecureCoding/NSCoding method -initWithCoder: should work, since the file can't know which device your data is allocated on, we have to guess and may guess incorrectly. To avoid that problem, use initWithCoder:device instead.
        Overrides:
        initWithCoderDevice in class MPSMatrixBinaryKernel
        Parameters:
        aDecoder - The NSCoder subclass with your serialized MPSKernel
        device - The MTLDevice on which to make the MPSKernel
        Returns:
        A new MPSKernel object, or nil if failure.
      • initWithDevice

        public MPSMatrixVectorMultiplication initWithDevice​(java.lang.Object device)
        Description copied from class: MPSKernel
        Standard init with default properties per filter type
        Overrides:
        initWithDevice in class MPSMatrixBinaryKernel
        Parameters:
        device - The device that the filter will be used on. May not be NULL.
        Returns:
        a pointer to the newly initialized object. This will fail, returning nil if the device is not supported. Devices must be MTLFeatureSet_iOS_GPUFamily2_v1 or later.
      • initWithDeviceRowsColumns

        public MPSMatrixVectorMultiplication initWithDeviceRowsColumns​(MTLDevice device,
                                                                       long rows,
                                                                       long 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.
      • initWithDeviceTransposeRowsColumnsAlphaBeta

        public MPSMatrixVectorMultiplication initWithDeviceTransposeRowsColumnsAlphaBeta​(MTLDevice device,
                                                                                         boolean transpose,
                                                                                         long rows,
                                                                                         long 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.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
        Overrides:
        _supportsSecureCoding in class MPSMatrixBinaryKernel
      • version_static

        public static long version_static()