Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions proposals/0035-linalg-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -695,15 +695,18 @@ uint Matrix::Length();

Requires `Wave` or `ThreadGroup` scope matrix.

Returns the number of matrix components accessible to the current thread. The
mapping and distribution of threads to matrix elements is opaque and
implementation-specific. The value returned by `Length` may be different
for each thread. The sum of the values returned by `Length` across all
threads must be greater than or equal to the total number of matrix elements.
Some implementations may map multiple threads to the same matrix element.
Therefore, developers should take this into consideration when programming
side-effects, such as atomic operations and/or UAV writes, within user-defined
matrix operations.
Returns the number of matrix components accessible to the current thread. If the
matrix's elements are stored in a packed type, `Length` will return the number of
packed elements (e.g. if a thread has 8 accessible elements of `int8` type
packed into 2 `int8_t4_packed`, `Length` will return 2). The mapping and
distribution of threads to matrix elements is opaque and
implementation-specific. The value returned by `Length` may be different for
each thread. The sum of the values returned by `Length` across all threads must
be greater than or equal to the total number of matrix elements. Some
implementations may map multiple threads to the same matrix element. Therefore,
developers should take this into consideration when programming side-effects,
such as atomic operations and/or UAV writes, within user-defined matrix
operations.

May be called from non-uniform control flow. However, given the above rules,
calling `Length` from divergent threads may result in unpredictable behavior.
Expand Down