# US 2024/0231913 A1 · Performing a separable operation on a two-dimensional array of values at a processing unit comprising a memory

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

- Number: US 2024/0231913 A1
- Document ID: US20240231913A1
- Status: Published application
- Kind: A1
- Application number: 18/392,228
- Filed: 2023-12-21
- Published: 2024-07-11
- Earliest claimed: 2022-12-21
- Applicants: Imagination Technologies Limited
- Inventors: Szabolcs Csefalvay
- Web page: https://patentgrep.com/patent/US20240231913A1

## CPC

- G06F 9/3009: {Thread control instructions}
- G06F 15/167: using a common memory, e.g. mailbox
- G06F 9/30043: {LOAD or STORE instructions; Clear instruction}
- G06F 9/5016: {the resource being the memory}
- H03H 17/0202: {Two or more dimensional filters; Filters for complex signals (multidimensional convolutions G06F17/153)}
- H03H 17/0282: {Sinc or gaussian filters (H03H17/0671 takes precedence)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H03H: IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS (waveguides, resonators, lines or other devices of the waveguide type H01P)

## Abstract

A separable operation on a two-dimensional array of values is performed at a processing unit. A two-dimensional array of values is divided into a plurality of sub-arrays of values. An initial phase of the separable operation is performed for a sub-array to generate a processed value for each value of the sub-array. Threads write a first plurality of processed values to the memory over a plurality of writing steps. Each of the threads reads a second plurality of processed values from the memory over a plurality of reading steps. A subsequent phase of the separable operation is performed for the processed values read by the threads to generate an output value for each value of the sub-array in a transposed position; wherein a respective processed value is written into each of the memory banks of the memory in at least one of the writing steps, and a respective processed value is read from each of the memory banks of the memory in at least one of the reading steps.

## Claims

### Claim 1

A computer-implemented method of performing a separable operation on a two-dimensional array of values at a processing unit comprising a memory, the memory comprising a plurality of memory banks, wherein in each writing or reading step each memory bank can be written into or read from by only one respective thread, the method comprising:
dividing the two-dimensional array of values into a plurality of two-dimensional sub-arrays of values;
for each of the plurality of sub-arrays:
performing, using a plurality of threads, an initial phase of the separable operation for said sub-array of values in order to generate a respective processed value for each value of said sub-array of values;
each of the plurality of threads writing a respective first plurality of processed values to the memory over a plurality of writing steps, said first plurality of processed values corresponding to a one-dimensional sequence of values of said sub-array of values;
each of the plurality of threads reading a respective second plurality of processed values from the memory over a plurality of reading steps, said second plurality of processed values corresponding to a perpendicular one-dimensional sequence of values of a sub-array of values in a transposed position within the array of values relative to said sub-array of values; and
performing, using the plurality of threads, a subsequent phase of the separable operation for the plurality of processed values read by the plurality of threads in order to generate a respective output value for each value of the sub-array of values in the transposed position;
wherein a respective processed value is written into each of the memory banks of the memory in at least one of the plurality of writing steps, and a respective processed value is read from each of the memory banks of the memory in at least one of the plurality of reading steps.

### Claim 2 (depends on 1)

The method of claim 1, wherein the memory bank into which a processed value is to be written is determined in dependence on a write buffer array having a number of elements greater than the number of elements in the two-dimensional array of values.

### Claim 3 (depends on 2)

The method of claim 2, wherein the write buffer array comprises:
value elements corresponding to values of the two-dimensional array; and
padding elements.

### Claim 4 (depends on 3)

The method of claim 3, wherein the padding elements correspond to memory padding.

### Claim 5 (depends on 3)

The method of claim 3, wherein the write buffer array comprises groups of contiguous value elements corresponding to values of the two-dimensional array, and padding elements interspersed between said groups.

### Claim 6 (depends on 5)

The method of claim 5, wherein the number of value elements in each group is (i) equal to, (ii) a multiple of, or (iii) a factor of the number of memory banks comprised by the memory.

### Claim 7 (depends on 5)

The method of claim 5, wherein the number of value elements in each group is equal to or less than the number of threads used to perform the separable operation for the array of values.

### Claim 8 (depends on 3)

The method of claim 3, wherein the write buffer array is mapped to the memory such that processed values corresponding to values of the two-dimensional array are written into the memory in memory locations to which the value elements of the write buffer array are mapped, and processed values corresponding to values of the two-dimensional array are not written to the memory in memory locations to which the padding elements of the write buffer array are mapped.

### Claim 9 (depends on 1)

The method of claim 1, wherein the memory location into which a thread writes a processed value is determined in dependence on a base memory address, a writing offset amount and a writing padding amount, the writing offset amount and the writing padding amount being dependent on the position of the value within the array of values to which that processed value corresponds.

### Claim 10 (depends on 9)

The method of claim 9, wherein the two-dimensional array of values divided into a plurality of two-dimensional sub-arrays of values is represented by a multidimensional array [I][J][K][M], where I and J represent the number of sub-arrays of values within the array of values in each of the two dimensions and K and M represent the number of values within each of the sub-arrays of values in each of the two dimensions, and wherein each value in the array of values has a coordinate [i][j][k][m] which defines its position within the multidimensional array [I][J][K][M], and wherein:
the writing offset amount is equal to (i×J×K×M)+(j×K×M)+(k×M)+m or (i×J×K×M)+(j×K×M)+(m×K)+k; and
the writing padding amount is equal to the writing offset amount divided by a padding frequency.

### Claim 11 (depends on 10)

The method of claim 10, wherein the padding frequency is (i) equal to, (ii) a multiple of, or (iii) a factor of the number of memory banks comprised by the memory.

### Claim 12 (depends on 11)

The method of claim 11, wherein the padding frequency is equal to or less than the number of threads used to perform the separable operation for the array of values.

### Claim 13 (depends on 1)

The method of claim 1, wherein the memory location from which a thread reads a processed value is determined in dependence on a base memory address, a reading offset amount and a reading padding amount, the reading offset amount and the reading padding amount being dependent on the position of the value within the array of values to which that processed value corresponds.

### Claim 14 (depends on 13)

The method of claim 13, wherein the two-dimensional array of values divided into a plurality of two-dimensional sub-arrays of values is represented by a multidimensional array [I][J][K][M], where I and J represent the number of sub-arrays of values within the array of values in each of the two dimensions and K and M represent the number of values within each of the sub-arrays of values in each of the two dimensions, and wherein each value in the array of values has a coordinate [i][j][k][m] which defines its position within the multidimensional array [I][J][K][M], and wherein:
the reading offset amount is equal to (j×J×K×M)+(i×K×M)+(m×M)+k or (j×J×K×M)+(i×K×M)+(k×K)+m; and
the reading padding amount is equal to the reading offset amount divided by a padding frequency.

### Claim 15 (depends on 1)

The method of claim 1, wherein the plurality of two-dimensional sub-arrays of values are non-overlapping.

### Claim 16 (depends on 1)

The method of claim 1, wherein the plurality of threads are processed by processing logic comprised by a core of the processing unit, the processing logic being implemented on a chip and the memory being physically located on the same chip as the processing logic.

### Claim 17 (depends on 1)

The method of claim 1, wherein the two-dimensional array of values is a two-dimensional array of pixel values.

### Claim 18 (depends on 1)

The method of claim 1, wherein:
the one dimensional sequence of values of said sub-array of values is a row of values of said sub-array of values and the perpendicular one dimensional sequence of values of the sub-array of values in the transposed position is a column of values of the sub-array of values in the transposed position; or
the one dimensional sequence of values of said sub-array of values is a column of values of said sub-array of values and the perpendicular one dimensional sequence of values of the sub-array of values in the transposed position is a row of values of the sub-array of values in the transposed position.

### Claim 19

A processing unit for performing a separable operation on a two-dimensional array of values, comprising:
a memory comprising a plurality of memory banks, wherein the memory is configured so that in each writing or reading step each memory bank can be written into or read from by only one respective thread; and
processing logic configured to:
divide the two-dimensional array of values into a plurality of two-dimensional sub-arrays of values,
for each of the plurality of sub-arrays:
perform, using a plurality of threads, an initial phase of the separable operation for said sub-array of values in order to generate a respective processed value for each value of said sub-array of values,
using each of the plurality of threads, write a respective first plurality of processed values to the memory over a plurality of writing steps, said first plurality of processed values corresponding to a one-dimensional sequence of values of said sub-array of values,
using each of the plurality of threads, read a respective second plurality of processed values from the memory over a plurality of reading steps, said second plurality of processed values corresponding to a perpendicular one-dimensional sequence of values of a sub-array of values in a transposed position within the array of values relative to said sub-array of values, and
perform, using the plurality of threads, a subsequent phase of the separable operation for the plurality of processed values read by the plurality of threads in order to generate a respective output value for each value of the sub-array of values in the transposed position;
wherein a respective processed value is written into each of the memory banks of the memory in at least one of the plurality of writing steps, and a respective processed value is read from each of the memory banks of the memory in at least one of the plurality of reading steps.

### Claim 20

A non-transitory computer readable storage medium having stored thereon computer readable instructions that, when executed at a computer system, cause the computer system to perform a computer-implemented method of performing a separable operation on a two-dimensional array of values at a processing unit comprising a memory, the memory comprising a plurality of memory banks, wherein in each writing or reading step each memory bank can be written into or read from by only one respective thread, comprising:
dividing the two-dimensional array of values into a plurality of two-dimensional sub-arrays of values;
for each of the plurality of sub-arrays:
performing, using a plurality of threads, an initial phase of the separable operation for said sub-array of values in order to generate a respective processed value for each value of said sub-array of values;
each of the plurality of threads writing a respective first plurality of processed values to the memory over a plurality of writing steps, said first plurality of processed values corresponding to a one-dimensional sequence of values of said sub-array of values;
each of the plurality of threads reading a respective second plurality of processed values from the memory over a plurality of reading steps, said second plurality of processed values corresponding to a perpendicular one-dimensional sequence of values of a sub-array of values in a transposed position within the array of values relative to said sub-array of values; and
performing, using the plurality of threads, a subsequent phase of the separable operation for the plurality of processed values read by the plurality of threads in order to generate a respective output value for each value of the sub-array of values in the transposed position;
wherein a respective processed value is written into each of the memory banks of the memory in at least one of the plurality of writing steps, and a respective processed value is read from each of the memory banks of the memory in at least one of the plurality of reading steps.
