Skip to content

[0035] Mat/vec multiply operations don't need a scope template parameter #797

@pow2clk

Description

@pow2clk

Which proposal does this relate to?
0035 - Linear Algebra Matrix

Describe the issue or outstanding question.
The Multiply and MultiplyAdd functions that take matrices and vectors also take a scope template parameter even though they are only supported on thread scope.

template <typename OutputElTy, typename InputElTy, SIZE_TYPE M, SIZE_TYPE K,
          ComponentEnum MatrixDT, MatrixScopeEnum Scope>
vector<OutputElTy, M> Multiply(Matrix<MatrixDT, M, K, MatrixUse::A, Scope>,
                               vector<InputElTy, K>);

template <typename OutputElTy, typename InputElTy, typename BiasElTy,
          SIZE_TYPE M, SIZE_TYPE K, ComponentEnum MatrixDT,
          MatrixScopeEnum Scope>
vector<OutputElTy, M> MultiplyAdd(Matrix<MatrixDT, M, K, MatrixUse::A, Scope>,
                                  vector<InputElTy, K>, vector<BiasElTy, M>);

template <typename OutputElTy, typename InputElTy, ComponentEnum InputInterp,
          typename BiasElTy, SIZE_TYPE M, SIZE_TYPE VecM, SIZE_TYPE K,
          ComponentEnum MatrixDT, MatrixScopeEnum Scope>
typename hlsl::enable_if<
    InterpretedVector<InputElTy, VecM, InputInterp>::Size == M,
    vector<OutputElTy, K> >::type
    MultiplyAdd(Matrix<MatrixDT, M, K, MatrixUse::A, Scope>,
                InterpretedVector<InputElTy, VecM, InputInterp>,
                vector<BiasElTy, K>);

This allows usage of these with matrices of disallowed scopes.

#741 added corresponding functions for interpretedvector and vectorrefs that made the scope explicit.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions