# US 2016/0259668 A1 · Apparatus and method for executing a plurality of threads

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0259668 A1
- Document ID: US20160259668A1
- Status: Published application
- Kind: A1
- Application number: 15/058,389
- Filed: 2016-03-02
- Published: 2016-09-08
- Earliest claimed: 2015-03-04
- Assignees: Arm Limited
- Applicants: Arm Limited
- Inventors: Timothy Holroyd GLAUERT; David Hennah MANSELL; Rune HOLM
- Web page: https://patentgrep.com/patent/US20160259668A1

## CPC

- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/3888: {controlled by a single instruction for multiple threads [SIMT] in parallel}
- G06T 1/20: Processor architectures; Processor configuration, e.g. pipelining
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

An apparatus and method are provided for executing a plurality of threads. The apparatus has processing circuitry arranged to execute the plurality of threads, with each thread executing a program to perform processing operations on thread data. Each thread has a thread identifier, and the thread data includes a value which is dependent on the thread identifier. Value generator circuitry is provided to perform a computation using the thread identifier of a chosen thread in order to generate the above mentioned value for that chosen thread, and to make that value available to the processing circuitry for use by the processing circuitry when executing the chosen thread. Such an arrangement can give rise to significant performance benefits when executing the plurality of threads on the apparatus.

## Claims

### Claim 1

An apparatus, comprising:
processing circuitry to execute a plurality of threads, each thread executing a program to perform processing operations on thread data, each thread having a thread identifier, and the thread data including a value which is dependent on the thread identifier; and
value generator circuitry to perform a computation using the thread identifier of a chosen thread in order to generate said value for the chosen thread, and to make said value available to the processing circuitry for use by the processing circuitry when executing said chosen thread.

### Claim 2 (depends on 1)

An apparatus as claimed in claim 1, wherein the processing circuitry is arranged to process a task, the task specifying an N dimensional range of thread identifiers used to determine the plurality of threads, and a same program to be executed as said program by each of said plurality of threads.

### Claim 3 (depends on 2)

An apparatus as claimed in claim 2, wherein the value generator circuitry is arranged to perform the computation using as inputs the thread identifier of the chosen thread and a set of constant values that are fixed for said task.

### Claim 4 (depends on 3)

An apparatus as claimed in claim 3, wherein the value generator circuitry is arranged to perform said computation by determining the sum of a plurality of terms, each term being determined by performing a sub-computation on term-specific inputs, said term-specific inputs comprising at least one constant specified for that term and at least a part of the thread identifier.

### Claim 5 (depends on 4)

An apparatus as claimed in claim 4, wherein the value generator circuitry is arranged to generate said value by adding the sum of said plurality of terms to a predetermined constant value in said set of constant values.

### Claim 6 (depends on 4)

An apparatus as claimed in claim 4, wherein the number of terms in said plurality of terms is configurable.

### Claim 7 (depends on 4)

An apparatus as claimed in claim 4, wherein the number of terms in said plurality of terms is fixed to provide one term for each dimension of a maximum number of dimensions supported by the value generator circuitry.

### Claim 8 (depends on 1)

An apparatus as claimed in claim 1, wherein:
the processing circuitry executes said plurality of threads in order to process an M-dimensional array of data values, each thread executing the program in relation to one of the data values in said M-dimensional array; and
the value generator circuitry is arranged to perform the computation for the chosen thread in order to identify as said value a location of the data value for the chosen thread within said M-dimensional array.

### Claim 9 (depends on 8)

An apparatus as claimed in claim 8, wherein said M-dimensional array of data values is stored in memory and said value generated by the value generator circuitry comprises a memory address associated with the data value for the chosen thread.

### Claim 10 (depends on 8)

An apparatus as claimed in claim 8, wherein the processing circuitry is arranged to process a task, the task specifying an N dimensional range of thread identifiers used to determine the plurality of threads, and a same program to be executed as said program by each of said plurality of threads, and wherein the value generator circuitry is arranged to perform said computation in order to map the thread identifier within said N-dimensional range of thread identifiers to the corresponding location within said M-dimensional array.

### Claim 11 (depends on 1)

An apparatus as claimed in claim 1, wherein said N-dimensional range of thread identifiers is a one dimensional range.

### Claim 12 (depends on 10)

An apparatus as claimed in claim 10, wherein the value generator circuitry is arranged to perform the computation using as inputs the thread identifier of the chosen thread and a set of constant values that are fixed for said task, wherein the value generator circuitry is arranged to perform said computation by determining the sum of a plurality of terms, each term being determined by performing a sub-computation on term-specific inputs, said term-specific inputs comprising at least one constant specified for that term and at least a part of the thread identifier, and wherein:
said N-dimensional range of thread identifiers is a one dimensional range; and
the number of terms and the constant values are specified so that performance of the computation by the value generator circuitry causes each of a plurality of sub-ranges of thread identifiers within said one dimensional range to map to a different M-dimensional block within said M-dimensional array.

### Claim 13 (depends on 1)

An apparatus as claimed in claim 1, wherein said N-dimensional range of thread identifiers is a multi-dimensional range and each thread identifier specifies coordinate values in said N-dimensional range.

### Claim 14 (depends on 13)

An apparatus as claimed in claim 13, wherein N=M.

### Claim 15 (depends on 4)

An apparatus as claimed in claim 4, wherein the processing circuitry executes said plurality of threads in order to process an M-dimensional array of data values, and said set of constant values provides an indication of a base location, a data size of the data values in said M-dimensional array and a number of data values extending in each dimension of the M-dimensional array.

### Claim 16 (depends on 1)

An apparatus as claimed in claim 1, wherein the value generator circuitry is arranged to perform said computation for each of said plurality of threads in order to generate said value for each of said plurality of threads.

### Claim 17 (depends on 1)

An apparatus as claimed in claim 1, wherein the plurality of threads comprise a plurality of thread groups, and the value generator circuitry is arranged to compute the value for a chosen thread in each thread group, and to generate a vector of offset values for use by the processing circuitry to derive the value for each of the threads in the thread group based on the value computed for the chosen thread of the thread group.

### Claim 18 (depends on 1)

An apparatus as claimed in claim 1, wherein said value generator circuitry is arranged to precompute the value for the chosen thread prior to the processing circuitry executing the chosen thread.

### Claim 19 (depends on 1)

An apparatus as claimed in claim 1, wherein the value generator circuitry is arranged to store each computed value in a register for access by the processing circuitry.

### Claim 20 (depends on 4)

An apparatus as claimed in claim 4, wherein the value generator circuitry comprises a plurality of computation elements, each computation element being arranged to perform the sub-computation of a term allocated to that computation element.

### Claim 21 (depends on 20)

An apparatus as claimed in claim 20, wherein each computation element is formed by stepper circuitry arranged to use a counter mechanism to control the output from that computation element.

### Claim 22 (depends on 1)

An apparatus as claimed in claim 1, wherein the value generator circuitry comprises multiple generators, each generator arranged to perform a different computation such that said multiple generators generate, for the chosen thread, multiple values that are dependent on the thread identifier.

### Claim 23 (depends on 20)

An apparatus as claimed in claim 20, wherein the value generator circuitry comprises multiple generators, each generator arranged to perform a different computation such that said multiple generators generate, for the chosen thread, multiple values that are dependent on the thread identifier, wherein said multiple generators share use of said plurality of computation elements.

### Claim 24

A method of executing a plurality of threads, comprising:
employing processing circuitry to execute said plurality of threads, each thread executing a program to perform processing operations on thread data, each thread having a thread identifier, and the thread data including a value which is dependent on the thread identifier; and
employing value generator circuitry to perform a computation using the thread identifier of a chosen thread in order to generate said value for the chosen thread, and to make said value available to the processing circuitry for use by the processing circuitry when executing said program for the chosen thread.
