--- layout: stdlib-reference --- # operator\* ## Description Multiplies a cooperative matrix by a scalar value: CoopMat * scalar Performs element-wise multiplication of each element in the matrix by the scalar. ## Signature
Ref<T, AddressSpace.Generic, DefaultDataLayout> operator*<T, Access access, AddressSpace addrSpace, L>(
    Ptr<T, AddressSpace.Generic, DefaultDataLayout> value)
    where L : IBufferDataLayout;

int8_t operator*(
    int8_t left,
    int8_t right);

vector<int8_t, N> operator*<int N>(
    vector<int8_t, N> left,
    vector<int8_t, N> right);

matrix<int8_t, N, M> operator*<int N, int M>(
    matrix<int8_t, N, M> left,
    matrix<int8_t, N, M> right);

vector<int8_t, N> operator*<int N>(
    int8_t left,
    vector<int8_t, N> right);

matrix<int8_t, N, M> operator*<int N, int M>(
    int8_t left,
    matrix<int8_t, N, M> right);

vector<int8_t, N> operator*<int N>(
    vector<int8_t, N> left,
    int8_t right);

matrix<int8_t, N, M> operator*<int N, int M>(
    matrix<int8_t, N, M> left,
    int8_t right);

int16_t operator*(
    int16_t left,
    int16_t right);

vector<int16_t, N> operator*<int N>(
    vector<int16_t, N> left,
    vector<int16_t, N> right);

matrix<int16_t, N, M> operator*<int N, int M>(
    matrix<int16_t, N, M> left,
    matrix<int16_t, N, M> right);

vector<int16_t, N> operator*<int N>(
    int16_t left,
    vector<int16_t, N> right);

matrix<int16_t, N, M> operator*<int N, int M>(
    int16_t left,
    matrix<int16_t, N, M> right);

vector<int16_t, N> operator*<int N>(
    vector<int16_t, N> left,
    int16_t right);

matrix<int16_t, N, M> operator*<int N, int M>(
    matrix<int16_t, N, M> left,
    int16_t right);

int operator*(
    int left,
    int right);

vector<int, N> operator*<int N>(
    vector<int, N> left,
    vector<int, N> right);

matrix<int, N, M> operator*<int N, int M>(
    matrix<int, N, M> left,
    matrix<int, N, M> right);

vector<int, N> operator*<int N>(
    int left,
    vector<int, N> right);

matrix<int, N, M> operator*<int N, int M>(
    int left,
    matrix<int, N, M> right);

vector<int, N> operator*<int N>(
    vector<int, N> left,
    int right);

matrix<int, N, M> operator*<int N, int M>(
    matrix<int, N, M> left,
    int right);

int64_t operator*(
    int64_t left,
    int64_t right);

vector<int64_t, N> operator*<int N>(
    vector<int64_t, N> left,
    vector<int64_t, N> right);

matrix<int64_t, N, M> operator*<int N, int M>(
    matrix<int64_t, N, M> left,
    matrix<int64_t, N, M> right);

vector<int64_t, N> operator*<int N>(
    int64_t left,
    vector<int64_t, N> right);

matrix<int64_t, N, M> operator*<int N, int M>(
    int64_t left,
    matrix<int64_t, N, M> right);

vector<int64_t, N> operator*<int N>(
    vector<int64_t, N> left,
    int64_t right);

matrix<int64_t, N, M> operator*<int N, int M>(
    matrix<int64_t, N, M> left,
    int64_t right);

intptr_t operator*(
    intptr_t left,
    intptr_t right);

vector<intptr_t, N> operator*<int N>(
    vector<intptr_t, N> left,
    vector<intptr_t, N> right);

matrix<intptr_t, N, M> operator*<int N, int M>(
    matrix<intptr_t, N, M> left,
    matrix<intptr_t, N, M> right);

vector<intptr_t, N> operator*<int N>(
    intptr_t left,
    vector<intptr_t, N> right);

matrix<intptr_t, N, M> operator*<int N, int M>(
    intptr_t left,
    matrix<intptr_t, N, M> right);

vector<intptr_t, N> operator*<int N>(
    vector<intptr_t, N> left,
    intptr_t right);

matrix<intptr_t, N, M> operator*<int N, int M>(
    matrix<intptr_t, N, M> left,
    intptr_t right);

half operator*(
    half left,
    half right);

vector<half, N> operator*<int N>(
    vector<half, N> left,
    vector<half, N> right);

matrix<half, N, M> operator*<int N, int M>(
    matrix<half, N, M> left,
    matrix<half, N, M> right);

vector<half, N> operator*<int N>(
    half left,
    vector<half, N> right);

matrix<half, N, M> operator*<int N, int M>(
    half left,
    matrix<half, N, M> right);

vector<half, N> operator*<int N>(
    vector<half, N> left,
    half right);

matrix<half, N, M> operator*<int N, int M>(
    matrix<half, N, M> left,
    half right);

float operator*(
    float left,
    float right);

vector<float, N> operator*<int N>(
    vector<float, N> left,
    vector<float, N> right);

matrix<float, N, M> operator*<int N, int M>(
    matrix<float, N, M> left,
    matrix<float, N, M> right);

vector<float, N> operator*<int N>(
    float left,
    vector<float, N> right);

matrix<float, N, M> operator*<int N, int M>(
    float left,
    matrix<float, N, M> right);

vector<float, N> operator*<int N>(
    vector<float, N> left,
    float right);

matrix<float, N, M> operator*<int N, int M>(
    matrix<float, N, M> left,
    float right);

double operator*(
    double left,
    double right);

vector<double, N> operator*<int N>(
    vector<double, N> left,
    vector<double, N> right);

matrix<double, N, M> operator*<int N, int M>(
    matrix<double, N, M> left,
    matrix<double, N, M> right);

vector<double, N> operator*<int N>(
    double left,
    vector<double, N> right);

matrix<double, N, M> operator*<int N, int M>(
    double left,
    matrix<double, N, M> right);

vector<double, N> operator*<int N>(
    vector<double, N> left,
    double right);

matrix<double, N, M> operator*<int N, int M>(
    matrix<double, N, M> left,
    double right);

uint8_t operator*(
    uint8_t left,
    uint8_t right);

vector<uint8_t, N> operator*<int N>(
    vector<uint8_t, N> left,
    vector<uint8_t, N> right);

matrix<uint8_t, N, M> operator*<int N, int M>(
    matrix<uint8_t, N, M> left,
    matrix<uint8_t, N, M> right);

vector<uint8_t, N> operator*<int N>(
    uint8_t left,
    vector<uint8_t, N> right);

matrix<uint8_t, N, M> operator*<int N, int M>(
    uint8_t left,
    matrix<uint8_t, N, M> right);

vector<uint8_t, N> operator*<int N>(
    vector<uint8_t, N> left,
    uint8_t right);

matrix<uint8_t, N, M> operator*<int N, int M>(
    matrix<uint8_t, N, M> left,
    uint8_t right);

uint16_t operator*(
    uint16_t left,
    uint16_t right);

vector<uint16_t, N> operator*<int N>(
    vector<uint16_t, N> left,
    vector<uint16_t, N> right);

matrix<uint16_t, N, M> operator*<int N, int M>(
    matrix<uint16_t, N, M> left,
    matrix<uint16_t, N, M> right);

vector<uint16_t, N> operator*<int N>(
    uint16_t left,
    vector<uint16_t, N> right);

matrix<uint16_t, N, M> operator*<int N, int M>(
    uint16_t left,
    matrix<uint16_t, N, M> right);

vector<uint16_t, N> operator*<int N>(
    vector<uint16_t, N> left,
    uint16_t right);

matrix<uint16_t, N, M> operator*<int N, int M>(
    matrix<uint16_t, N, M> left,
    uint16_t right);

uint operator*(
    uint left,
    uint right);

vector<uint, N> operator*<int N>(
    vector<uint, N> left,
    vector<uint, N> right);

matrix<uint, N, M> operator*<int N, int M>(
    matrix<uint, N, M> left,
    matrix<uint, N, M> right);

vector<uint, N> operator*<int N>(
    uint left,
    vector<uint, N> right);

matrix<uint, N, M> operator*<int N, int M>(
    uint left,
    matrix<uint, N, M> right);

vector<uint, N> operator*<int N>(
    vector<uint, N> left,
    uint right);

matrix<uint, N, M> operator*<int N, int M>(
    matrix<uint, N, M> left,
    uint right);

uint64_t operator*(
    uint64_t left,
    uint64_t right);

vector<uint64_t, N> operator*<int N>(
    vector<uint64_t, N> left,
    vector<uint64_t, N> right);

matrix<uint64_t, N, M> operator*<int N, int M>(
    matrix<uint64_t, N, M> left,
    matrix<uint64_t, N, M> right);

vector<uint64_t, N> operator*<int N>(
    uint64_t left,
    vector<uint64_t, N> right);

matrix<uint64_t, N, M> operator*<int N, int M>(
    uint64_t left,
    matrix<uint64_t, N, M> right);

vector<uint64_t, N> operator*<int N>(
    vector<uint64_t, N> left,
    uint64_t right);

matrix<uint64_t, N, M> operator*<int N, int M>(
    matrix<uint64_t, N, M> left,
    uint64_t right);

uintptr_t operator*(
    uintptr_t left,
    uintptr_t right);

vector<uintptr_t, N> operator*<int N>(
    vector<uintptr_t, N> left,
    vector<uintptr_t, N> right);

matrix<uintptr_t, N, M> operator*<int N, int M>(
    matrix<uintptr_t, N, M> left,
    matrix<uintptr_t, N, M> right);

vector<uintptr_t, N> operator*<int N>(
    uintptr_t left,
    vector<uintptr_t, N> right);

matrix<uintptr_t, N, M> operator*<int N, int M>(
    uintptr_t left,
    matrix<uintptr_t, N, M> right);

vector<uintptr_t, N> operator*<int N>(
    vector<uintptr_t, N> left,
    uintptr_t right);

matrix<uintptr_t, N, M> operator*<int N, int M>(
    matrix<uintptr_t, N, M> left,
    uintptr_t right);

T operator*<T>(
    T left,
    T right)
    where T : __BuiltinArithmeticType;

vector<T, N> operator*<T, int N>(
    vector<T, N> left,
    vector<T, N> right)
    where T : __BuiltinArithmeticType;

matrix<T, N, M> operator*<T, int N, int M>(
    matrix<T, N, M> left,
    matrix<T, N, M> right)
    where T : __BuiltinArithmeticType;

vector<T, N> operator*<T, int N>(
    T left,
    vector<T, N> right)
    where T : __BuiltinArithmeticType;

matrix<T, N, M> operator*<T, int N, int M>(
    T left,
    matrix<T, N, M> right)
    where T : __BuiltinArithmeticType;

vector<T, N> operator*<T, int N>(
    vector<T, N> left,
    T right)
    where T : __BuiltinArithmeticType;

matrix<T, N, M> operator*<T, int N, int M>(
    matrix<T, N, M> left,
    T right)
    where T : __BuiltinArithmeticType;

T operator*<T>(
    T v0,
    T v1)
    where T : IArithmetic;

T operator*<T>(
    T v0,
    T v1)
    where T : IFloat;

T operator*<T>(DescriptorHandle<T> value)
    where T : IOpaqueDescriptor;

/// Requires Capability Set 1:
linalg.CoopMat<T, S, M, N, R> operator*<T, MemoryScope S, int M, int N, linalg.CoopMatMatrixUseR>(
    linalg.CoopMat<T, S, M, N, R> lhs,
    const T rhs)
    where T : ICoopElement;

/// Requires Capability Set 1:
linalg.CoopMat<T, S, M, N, R> operator*<T, MemoryScope S, int M, int N, linalg.CoopMatMatrixUseR>(
    const T lhs,
    linalg.CoopMat<T, S, M, N, R> rhs)
    where T : ICoopElement;

/// Requires Capability Set 2:
CoopVec<T, N> operator*<T, int N>(
    CoopVec<T, N> lhs,
    const T rhs)
    where T : __BuiltinArithmeticType;

/// Requires Capability Set 2:
CoopVec<T, N> operator*<T, int N>(
    const T lhs,
    CoopVec<T, N> rhs)
    where T : __BuiltinArithmeticType;

## Generic Parameters #### T The element type of the cooperative matrix. #### access : Access #### addrSpace : AddressSpace #### L: [IBufferDataLayout](../interfaces/ibufferdatalayout-017b/index.html) #### N : int The number of columns in the matrix fragment. #### M : int The number of rows in the matrix fragment. #### T: [\_\_BuiltinArithmeticType](../interfaces/0_builtinarithmetictype-029j/index.html) The element type of the cooperative matrix. #### T: [IArithmetic](../interfaces/iarithmetic-01/index.html) The element type of the cooperative matrix. #### T: [IFloat](../interfaces/ifloat-01/index.html) The element type of the cooperative matrix. #### T: [IOpaqueDescriptor](../interfaces/iopaquedescriptor-017/index.html) The element type of the cooperative matrix. #### T: [ICoopElement](../interfaces/icoopelement-015/index.html) The element type of the cooperative matrix. #### S : MemoryScope The memory scope defining the cooperative group. #### R : linalg\.[CoopMatMatrixUse](../types/coopmatmatrixuse-047d/index.html) The matrix use specifier (MatrixA, MatrixB, or MatrixAccumulator). ## Parameters #### value : [Ptr](../types/ptr-0/index.html)\<[T](../types/ptr-0/index.html#typeparam-T), AddressSpace\.Generic, [DefaultDataLayout](../types/defaultdatalayout-07b/index.html)\> #### left : int8\_t #### right : int8\_t #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : int16\_t #### right : int16\_t #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : int #### right : int #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : int64\_t #### right : int64\_t #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : intptr\_t #### right : intptr\_t #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : half #### right : half #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : float #### right : float #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : double #### right : double #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : uint8\_t #### right : uint8\_t #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : uint16\_t #### right : uint16\_t #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : uint #### right : uint #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : uint64\_t #### right : uint64\_t #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : uintptr\_t #### right : uintptr\_t #### left : [vector](../types/vector/index.html)\ #### right : [vector](../types/vector/index.html)\ #### left : [matrix](../types/matrix/index.html)\ #### right : [matrix](../types/matrix/index.html)\ #### left : [T](operatorx2A.html#typeparam-T) #### right : [T](operatorx2A.html#typeparam-T) #### left : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> #### right : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> #### left : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\> #### right : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\> #### v0 : [T](operatorx2A.html#typeparam-T) #### v1 : [T](operatorx2A.html#typeparam-T) #### value : [DescriptorHandle](../types/descriptorhandle-0a/index.html)\<[T](../types/descriptorhandle-0a/index.html#typeparam-T)\> #### lhs : linalg\.[CoopMat](../types/coopmat-04/index.html)\<[T](../types/coopmat-04/index.html#typeparam-T), [S](../types/coopmat-04/index.html#decl-S), [M](../types/coopmat-04/index.html#decl-M), [N](../types/coopmat-04/index.html#decl-N), [R](../types/coopmat-04/index.html#decl-R)\> The cooperative matrix to multiply. #### rhs : [T](operatorx2A.html#typeparam-T) The scalar value to multiply each element by. #### lhs : [T](operatorx2A.html#typeparam-T) The cooperative matrix to multiply. #### rhs : linalg\.[CoopMat](../types/coopmat-04/index.html)\<[T](../types/coopmat-04/index.html#typeparam-T), [S](../types/coopmat-04/index.html#decl-S), [M](../types/coopmat-04/index.html#decl-M), [N](../types/coopmat-04/index.html#decl-N), [R](../types/coopmat-04/index.html#decl-R)\> The scalar value to multiply each element by. #### lhs : [CoopVec](../types/coopvec-04/index.html)\<[T](../types/coopvec-04/index.html#typeparam-T), [N](../types/coopvec-04/index.html#decl-N)\> The cooperative matrix to multiply. #### rhs : [CoopVec](../types/coopvec-04/index.html)\<[T](../types/coopvec-04/index.html#typeparam-T), [N](../types/coopvec-04/index.html#decl-N)\> The scalar value to multiply each element by. ## Return value A new cooperative matrix with all elements multiplied by the scalar. ## Availability and Requirements ### Capability Set 1 Defined for the following targets: #### hlsl Available in all stages. #### cuda Available in all stages. #### spirv Available in all stages. Requires capability: `spvCooperativeMatrixKHR`. ### Capability Set 2 Defined for the following targets: #### hlsl Available in all stages. #### glsl Available in all stages. #### cpp Available in all stages. #### cuda Available in all stages. #### spirv Available in all stages. Requires capability: `spvCooperativeVectorNV`.