--- layout: stdlib-reference --- # coopVecMatMulAddPacked ## Description Multiply a matrix with a cooperative vector and add a bias vector to the result. Given a M-row by K-col matrix, a K-element column vector input, and a M-element vector bias, computes matrix*input+bias, and returns a M-element vector. ## Signature
/// Requires Capability Set 1: CoopVec<T, M> coopVecMatMulAddPacked<T, int M, int PackedK, U>( CoopVec<U, PackedK> input, CoopVecComponentType inputInterpretation, int k, RWByteAddressBuffer matrix, int matrixOffset, CoopVecComponentType matrixInterpretation, RWByteAddressBuffer bias, int biasOffset, CoopVecComponentType biasInterpretation, CoopVecMatrixLayout memoryLayout, bool transpose, uint matrixStride) where T : __BuiltinArithmeticType where U : __BuiltinArithmeticType; /// Requires Capability Set 1: CoopVec<T, M> coopVecMatMulAddPacked<T, int M, int PackedK, U>( CoopVec<U, PackedK> input, CoopVecComponentType inputInterpretation, int k, ByteAddressBuffer matrix, int matrixOffset, CoopVecComponentType matrixInterpretation, ByteAddressBuffer bias, int biasOffset, CoopVecComponentType biasInterpretation, CoopVecMatrixLayout memoryLayout, bool transpose, uint matrixStride) where T : __BuiltinArithmeticType where U : __BuiltinArithmeticType; /// Requires Capability Set 2: CoopVec<T, M> coopVecMatMulAddPacked<T, int M, int PackedK, U, IgnoredBufferElementType>( CoopVec<U, PackedK> input, CoopVecComponentType inputInterpretation, int k, RWStructuredBuffer<IgnoredBufferElementType, DefaultDataLayout> matrix, int matrixOffset, CoopVecComponentType matrixInterpretation, RWStructuredBuffer<IgnoredBufferElementType, DefaultDataLayout> bias, int biasOffset, CoopVecComponentType biasInterpretation, CoopVecMatrixLayout memoryLayout, bool transpose, uint matrixStride) where T : __BuiltinArithmeticType where U : __BuiltinArithmeticType; /// Requires Capability Set 2: CoopVec<T, M> coopVecMatMulAddPacked<T, int M, int PackedK, U, IgnoredBufferElementType>( CoopVec<U, PackedK> input, CoopVecComponentType inputInterpretation, int k, StructuredBuffer<IgnoredBufferElementType, DefaultDataLayout> matrix, int matrixOffset, CoopVecComponentType matrixInterpretation, StructuredBuffer<IgnoredBufferElementType, DefaultDataLayout> bias, int biasOffset, CoopVecComponentType biasInterpretation, CoopVecMatrixLayout memoryLayout, bool transpose, uint matrixStride) where T : __BuiltinArithmeticType where U : __BuiltinArithmeticType; /// Requires Capability Set 3: CoopVec<T, M> coopVecMatMulAddPacked<T, int M, int PackedK, U>( CoopVec<U, PackedK> input, CoopVecComponentType inputInterpretation, int k, Ptr<void, Access.ReadWrite, AddressSpace.Device> matrixPtr, CoopVecComponentType matrixInterpretation, Ptr<void, Access.ReadWrite, AddressSpace.Device> biasPtr, CoopVecComponentType biasInterpretation, CoopVecMatrixLayout memoryLayout, bool transpose, uint matrixStride) where T : __BuiltinArithmeticType where U : __BuiltinArithmeticType;## Generic Parameters #### T: [\_\_BuiltinArithmeticType](../interfaces/0_builtinarithmetictype-029j/index.html) #### M : int #### PackedK : int #### U: [\_\_BuiltinArithmeticType](../interfaces/0_builtinarithmetictype-029j/index.html) #### IgnoredBufferElementType ## Parameters #### input : [CoopVec](../types/coopvec-04/index.html)\ The input cooperative vector to multiply with the matrix. #### inputInterpretation : [CoopVecComponentType](../types/coopveccomponenttype-047g/index.html) Specifies how to interpret the values in the input vector (e.g. as packed values). #### k : int The number of columns in the matrix. #### matrix : [RWByteAddressBuffer](../types/rwbyteaddressbuffer-0126d/index.html) The matrix buffer to multiply with. #### matrixOffset : int Byte offset into the matrix buffer. #### matrixInterpretation : [CoopVecComponentType](../types/coopveccomponenttype-047g/index.html) Specifies how to interpret the values in the matrix. #### bias : [RWByteAddressBuffer](../types/rwbyteaddressbuffer-0126d/index.html) The bias buffer to add after multiplication. #### biasOffset : int Byte offset into the bias buffer. #### biasInterpretation : [CoopVecComponentType](../types/coopveccomponenttype-047g/index.html) Specifies how to interpret the values in the bias vector. #### memoryLayout : [CoopVecMatrixLayout](../types/coopvecmatrixlayout-047d/index.html) Specifies the memory layout of the matrix (row-major or column-major). #### transpose : bool Whether to transpose the matrix before multiplication. #### matrixStride : uint The stride between matrix rows/columns in bytes. #### matrix : [ByteAddressBuffer](../types/byteaddressbuffer-04b/index.html) The matrix buffer to multiply with. #### bias : [ByteAddressBuffer](../types/byteaddressbuffer-04b/index.html) The bias buffer to add after multiplication. #### matrix : [RWStructuredBuffer](../types/rwstructuredbuffer-012c/index.html)\