Transposing a matrix using a streaming engine
AssigneeTexas Instruments Incorporated
InventorsJonathan (Son) Hung Tran, Joseph Raymond Michael Zbiciak
Life of this patent
Estimating the term…
Abstract
Software instructions are executed on a processor within a computer system to configure a steaming engine to operate in either a linear mode or a transpose mode. A stream of addresses is generated using an address generator, in which the stream of addresses includes consecutive nested loop iterations for at least a first loop and a second loop. While in the linear mode, the first loop is treated as an inner loop. While in the transpose mode, the second loop is treated as the inner loop. A matrix can be fetched from memory in the linear mode to provide row-wise vectors. A matrix can be fetched from the memory in the transpose mode to provide column wise vectors.
Claims20
A method of operating a streaming engine in a computer system, the method comprising:
- receiving a set of stream parameters into control logic of the streaming engine, wherein the set of stream parameters comprises:
- definitions of rows and columns of an array that include a first count associated with the rows and a second count associated with the columns;
- an element size of the array;
- and
- a transpose mode indicator;
- determining an inner loop count and an outer loop count from among the first count and the second count based on the transpose mode indicator;
- retrieving the array from a memory according to the inner loop count and the outer loop count;
- storing the array retrieved from the memory in local storage of the streaming engine according to the set of stream parameters;
- and
- providing the array from the local storage as a vector such that the vector is a row vector or a column vector based on the transpose mode indicator.
A system comprising:
- a streaming engine, wherein the streaming engine comprises:
- a stream template register to hold stream parameters, wherein the stream parameters comprise definitions of rows and columns of an array, an element size of the array, and a transpose mode indicator;
- a coarse grain rotator responsive to the stream parameters, the coarse grain rotator having inputs to receive a row vector of a row of an array and outputs, wherein the coarse grain rotator is configured to:
- rotate the row vector by an amount based on an index of the row of the row vector;
- and
- provide the rotated row vector at the outputs of the coarse grain rotator;
- a multibank register file with inputs coupled to outputs of the coarse grain rotator;
- and
- an alignment network with inputs coupled to outputs of the register file, the alignment network having outputs to provide a column vector responsive to the stream parameters.
A method of operating a streaming engine in a computer system, the method comprising:
- storing elements of an array in a system memory of the computer system;
- receiving stream parameters into control logic of the streaming engine that include:
- a first count associated with rows of the array and a second count associated with columns of the array, an element size of the array, and a transpose mode indicator;
- determining an inner loop count and an outer loop count from among the first count and the second count based on the transpose mode indicator;
- fetching the array from the system memory according to the inner loop count and the outer loop count;
- storing the array fetched from the system memory in a local storage of the streaming engine according to the stream parameters;
- and
- forming a vector from the array stored in the local storage that is a row vector or a column vector based on the transpose mode indicator.
Dependencies are inferred from the claim text.