--- layout: stdlib-reference --- # coopVecOuterProductAccumulate ## Description Atomically accumulates the outer product of two cooperative vectors into a matrix. Given an M-element vector a, and an N-element vector b, compute the outer product of a and b, forming a M-row by N-col matrix. The elements in the matrix is then atomically accumulated to memory location represented by matrix. ## Signature
/// Requires Capability Set 1: void coopVecOuterProductAccumulate<T, int M, int N>( CoopVec<T, M> a, CoopVec<T, N> b, RWByteAddressBuffer matrix, int matrixOffset, uint matrixStride, CoopVecMatrixLayout memoryLayout, CoopVecComponentType matrixInterpretation) where T : __BuiltinArithmeticType; /// Requires Capability Set 2: void coopVecOuterProductAccumulate<T, int M, int N, IgnoredBufferElementType>( CoopVec<T, M> a, CoopVec<T, N> b, RWStructuredBuffer<IgnoredBufferElementType, DefaultDataLayout> matrix, int matrixOffset, uint matrixStride, CoopVecMatrixLayout memoryLayout, CoopVecComponentType matrixInterpretation) where T : __BuiltinArithmeticType; /// Requires Capability Set 2: void coopVecOuterProductAccumulate<T, int M, int N, U, int IgnoredBufferSize>( CoopVec<T, M> a, CoopVec<T, N> b, U[IgnoredBufferSize] matrix, int matrixOffset, uint matrixStride, CoopVecMatrixLayout memoryLayout, CoopVecComponentType matrixInterpretation) where T : __BuiltinArithmeticType where U : __BuiltinArithmeticType; /// Requires Capability Set 2: void coopVecOuterProductAccumulate<T, int M, int N>( CoopVec<T, M> a, CoopVec<T, N> b, Ptr<void, Access.ReadWrite, AddressSpace.Device> matrixPtr, uint matrixStride, CoopVecMatrixLayout memoryLayout, CoopVecComponentType matrixInterpretation) where T : __BuiltinArithmeticType;## Generic Parameters #### T: [\_\_BuiltinArithmeticType](../interfaces/0_builtinarithmetictype-029j/index.html) #### M : int #### N : int #### IgnoredBufferElementType #### U: [\_\_BuiltinArithmeticType](../interfaces/0_builtinarithmetictype-029j/index.html) #### IgnoredBufferSize : int ## Parameters #### a : [CoopVec](../types/coopvec-04/index.html)\<[T](../types/coopvec-04/index.html#typeparam-T), M\> The first cooperative vector. #### b : [CoopVec](../types/coopvec-04/index.html)\<[T](../types/coopvec-04/index.html#typeparam-T), [N](../types/coopvec-04/index.html#decl-N)\> The second cooperative vector. #### matrix : [RWByteAddressBuffer](../types/rwbyteaddressbuffer-0126d/index.html) The matrix buffer to accumulate the result into. #### matrixOffset : int Byte offset into the matrix buffer. #### matrixStride : uint The stride between matrix rows/columns in bytes. #### memoryLayout : [CoopVecMatrixLayout](../types/coopvecmatrixlayout-047d/index.html) Specifies the memory layout of the matrix (row-major or column-major). #### matrixInterpretation : [CoopVecComponentType](../types/coopveccomponenttype-047g/index.html) Specifies how to interpret the values in the matrix. #### matrix : [RWStructuredBuffer](../types/rwstructuredbuffer-012c/index.html)\