Single-cycle gilbert-johnson-keerthi algorithm

By using acyclic and branchless support functions and a single loop on a single instruction multiple data processor, the problem of branch prediction error in the inner loop of the GJK algorithm is solved, and more efficient graphics processing is achieved.

CN122641838APending Publication Date: 2026-08-25HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202480086066.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-30
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

The existing Gilbert-Johnson-Keerthi algorithm has a high computational cost in graphics processing, especially due to performance loss caused by prediction errors in the conditional branches in the inner loop.

Method used

It employs aligned and vectorized data structures on a single instruction multiple data (SIMD) processor, uses acyclic and branchless support functions, implements the GJK algorithm through a single loop, eliminates conditional branches in the inner loop, utilizes spatial coherence to cache the solution of the previous time step, and computes the dot product in parallel.

Benefits of technology

It improves the computational efficiency of the GJK algorithm, reduces performance loss caused by branch prediction errors, optimizes memory access patterns, and enhances graphics processing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122641838A_ABST
    Figure CN122641838A_ABST
Patent Text Reader

Abstract

In some examples, a graphics processing method for processing electronic data for display on a display screen is provided, the method comprising: evaluating distances between objects of a display scene to be rendered and displayed on the display screen using an aligned and vectorized data structure in a Gilbert-Johnson-Keerthi algorithm running on a single instruction multiple data (SIMD) processor, the structure comprising a separating axis, a position and a rotation of a local coordinate system, and a position of each point in a convex hull; implementing the Gilbert-Johnson-Keerthi algorithm using only a support function and a single loop, wherein the support function comprises loop-free and branch-free functions to support a mapping function, and the single loop repeats the algorithm until an optimal point of a shortest distance between two objects is identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention generally relates to graphics processing. Aspects of this invention relate to a single-loop Gilbert-Johnson-Keerthi algorithm for graphics processing. Background Technology

[0002] Graphics processing is the processing of electronic data to display it on a screen (such as a computer monitor or television).

[0003] The Gilbert-Johnson-Keerthi (GJK) algorithm is a method for determining the minimum distance between two convex sets, first published in 1988 by Elmer G. Gilbert, Daniel W. Johnson, and S. Sathiya Keerthi. A convex set is a representation of an object. Unlike many other distance algorithms, GJK does not require the geometric data to be stored in any particular format; instead, it relies solely on support functions to iteratively generate a simplification closer to the correct answer using the configuration space obstacle (CSO) of the two convex shapes, often referred to as the Minkowski difference.

[0004] The GJK algorithm operates using two nested loops. The inner loop iterates around a support function, while the outer loop orchestrates the entire iterative process. The inner loop calls the support function, which is responsible for calculating the farthest point in a given direction within the examined geometry. This nested loop structure plays a crucial role in guiding the algorithm to systematically arrive at a solution.

[0005] Several existing methods aim to improve the speed of the GJK algorithm by merging vectorized implementations or customizing algorithms for graphics processors. Cameron's publication, "Enhancing GJK: computing minimum and penetration distances between convex polyhedra," introduces a hill-climbing technique. Hill-climbing is an embodiment of spatial consistency and is therefore an optimization technique used to refine the approximation of the nearest point between convex shapes. While the publication proposes a new formula for the support function, hill-climbing does not eliminate the computationally intensive control statements associated with the GJK algorithm.

[0006] US Patent Publication US8564601B2 discloses a parallel and vectorized GJK graphics processing method using a SIMD device. This application utilizes parallel and vectorized data structures in the processor to improve the computational efficiency of GJK. The focus is on vectorizing and aligning the data to achieve optimal processing in a SIMD device. However, this method does not reduce the computational cost associated with GJK algorithms, particularly the inner loop. Summary of the Invention

[0007] The purpose of this invention is to reduce the computational overhead associated with the Gilbert-Johnson-Keerthi algorithm and improve its speed.

[0008] The above and other objectives are achieved through the features of the independent claims.

[0009] Other implementations are obvious from the dependent claims, the specification and the drawings.

[0010] A first aspect of the present invention provides a graphics processing method for processing electronic data for display on a display screen, the method comprising: evaluating the distance between objects in a display scene to be rendered and displayed on the display screen using an aligned and vectorized data structure in the Gilbert-Johnson-Keerthi algorithm running on a single instruction multiple data (SIMD) processor, the structure including a separating axis, the position and rotation of a local coordinate system, and the position of each point in a convex set; implementing the Gilbert-Johnson-Keerthi algorithm using only support functions and a single loop, wherein the support functions include acyclic and branchless functions to support the mapping function, and the algorithm is repeated in a single loop until an optimal point with the shortest distance between two objects is identified.

[0011] Therefore, this method addresses the high overhead of conditional "if" statements (and "for" loops) in the inner loop of the GJK algorithm, particularly regarding branch prediction errors. This method eliminates the need for an inner loop, thereby eliminating the entire penalty caused by branch prediction errors by introducing a branchless support function.

[0012] The supporting function may include a function for identifying a first vector from a first set of vectors, wherein the dot product of the first vector and the input vector includes the maximum value of any vector in the first set of vectors.

[0013] The method may further include calculating the dot product of the input vector and the first set of vectors, and storing the calculated dot product in a register. Identifying the first vector may further include using a mask to find the maximum value stored in the register and the index of the maximum value in the register, thereby identifying the first vector.

[0014] The method may further include: computing in parallel multiple dot products of the input vector with multiple subsets of the first vector set; storing each dot product in a separate register among multiple registers. Identifying the first vector may include: using a mask to find the local maximum value stored in each of the multiple registers; comparing the local maximum values ​​stored in each register to find the global maximum value stored in the multiple registers, thereby identifying the first vector.

[0015] The method may also include changing the value of the input vector to the value of the first vector.

[0016] A second aspect of the invention provides a computer-readable storage medium including computer program code accessible by a means including a processor to provide instructions and / or data to the means, the computer program code being used to cause the means to perform the methods described herein via the processor.

[0017] A third aspect of the invention provides a graphics processing apparatus for processing electronic data for display on a display screen, comprising a single instruction multiple data (SIMD) processor for: evaluating the distance between objects in a display scene to be rendered and displayed on the display screen using aligned and vectorized data structures in a Gilbert-Johnson-Keerthi algorithm running on the SIMD processor, the structures including a separating axis, the position and rotation of a local coordinate system, and the position of each point in a convex set; implementing the Gilbert-Johnson-Keerthi algorithm using only support functions and a single loop, wherein the support functions include acyclic and branchless functions to support the mapping function, and the single loop repeats the algorithm until the optimal point with the shortest distance between two objects is identified.

[0018] The supporting function may include a function for identifying a first vector from a first set of vectors, wherein the dot product of the first vector and the input vector includes the maximum value of any vector in the first set of vectors.

[0019] The processor can also be used to calculate the dot product of the input vector and the first set of vectors, and store the calculated dot product in a register. To identify the first vector, the processor can also be used to use a mask to find the maximum value stored in the register and the index of the maximum value in the register, thereby identifying the first vector.

[0020] The processor can also be used to: compute multiple dot products of the input vector with multiple subsets of the first vector set in parallel; and store each of the multiple dot products in a separate register among multiple registers. To identify the first vector, the processor can also be used to: use a mask to find the local maximum stored in each of the multiple registers; and compare the local maximums stored in each register to find the global maximum stored in the multiple registers, thereby identifying the first vector.

[0021] The processor can also be used to change the value of the input vector to the value of the first vector.

[0022] These and other aspects of the invention will be apparent from one or more embodiments described below. Attached Figure Description

[0023] To facilitate understanding of the present invention, embodiments thereof will now be described by way of example with reference to the accompanying drawings, wherein: Figure 1 It is a flowchart based on the example method; Figure 2 This is a flowchart based on the example's supporting functions; Figure 3 This is a schematic diagram illustrating the concept of spatial coherence, used to aid in understanding the present invention; Figure 4 This is a schematic diagram of the device based on the example. Detailed Implementation

[0024] Exemplary embodiments are described in detail below to enable those skilled in the art to embody and implement the systems and processes described herein. It is important to understand that embodiments may be provided in many alternative forms and should not be construed as limited to the examples set forth herein.

[0025] Therefore, while embodiments may be modified in various ways and take various alternative forms, specific embodiments thereof are shown in the accompanying drawings and described in detail below as examples. There is no intention to limit the specific forms disclosed. Rather, all modifications, equivalents, and alternatives falling within the scope of the appended claims should be included. Elements of exemplary embodiments are consistently designated by the same reference numerals throughout the drawings and described in detail where appropriate.

[0026] The terminology used herein to describe embodiments is not intended to be limiting. “A,” “an,” and “the” are singular because they refer to a single thing; however, the use of the singular form in this document should not preclude the existence of more than one thing. In other words, an element mentioned in the singular may be numbered one or more, unless the context clearly indicates otherwise. It should also be understood that the term “comprising” as used herein means the presence of the stated features, items, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, items, steps, operations, elements, components, and / or combinations thereof.

[0027] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall be interpreted as conventions in the field. It should also be understood that, unless explicitly defined herein, terms in common usage shall also be interpreted as conventions in the relevant field, rather than idealized or overly formalized meanings.

[0028] The branch predictor in the central processing unit (CPU) is a component that optimizes instruction execution by predicting the outcome of conditional branches (such as those associated with "if" statements). Predicting whether a branch will be taken helps maintain a smooth instruction pipeline. However, if the prediction fails, resulting in a prediction error, the CPU incurs a performance penalty. In the case of a mispredicted branch, the speculative instructions following the misprediction must be discarded, leading to wasted processing cycles and potential pipeline stalls.

[0029] The Gilbert-Johnson-Keerthi (GJK) algorithm has long been considered a system involving at least two nested loops. The inner loop loops around a support function, while the outer loop coordinates the entire iterative process. The high overhead of the inner loop is primarily attributed to the conditional "if" statement in its structure. This conditional statement can lead to a potential cache flush if the branch predictor guesses incorrectly. Incorrect guesses can result in inefficient memory access patterns, corrupt the processor's cache, and cause delays in fetching the required data. Overall, incorrect branch prediction significantly increases the computational overhead associated with the inner loop of the GJK algorithm and is a drawback exhibited by currently used methods.

[0030] Based on an example, a mechanism is provided to reduce the computational overhead associated with the Gilbert-Johnson-Keerthi algorithm and improve its speed. More specifically, aspects involve addressing the high cost caused by conditional "if" statements in inner loops, particularly for branch prediction errors. The proposed scheme involves a vectorized implementation of the GJK algorithm, achieved through a single loop that calls a branchless and acyclic support function. The mechanism described in this paper leverages spatial coherence, allowing solutions from the previous time step to be cached, and the evaluation of the support function is restricted to a subset of vertices. The size of this subset is predetermined at compile time to ensure it fits within an integer number of cache lines. Similar to Cameron's approach (mentioned above), adjacent elements are pre-computed and stored in a memory-aligned array. The memory array is aligned with the length of the vector registers to achieve an optimized memory access pattern. Importantly, the support function is implemented without any control structures. In other words, the support function does not use either a "for" loop or an "if" statement.

[0031] The examples in this invention may be provided as methods, systems, or machine-readable instructions, for example, as any combination of software, hardware, firmware, etc. These machine-readable instructions may be included in a computer-readable storage medium (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-readable program code.

[0032] The invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and systems according to examples. Although the flowcharts described above show a specific order of execution, the order of execution may differ from the order described. A block described in one flowchart may be combined with a block in another flowchart. In some examples, some blocks in the flowchart may not be necessary and / or other blocks may be added. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or diagrams in the flowchart and / or block diagram, can be implemented by machine-readable instructions.

[0033] For example, machine-readable instructions can be executed by machines such as general-purpose computers, user devices such as smart devices (e.g., processors in smartphones, special-purpose computers, embedded processors, or other programmable data processing devices) to implement the functions described in the specification and diagrams. Specifically, a processor or processing device can execute machine-readable instructions. Therefore, modules of a device (e.g., modules implementing comparator units, or firewall structures, etc.) can be implemented by a processor that executes machine-readable instructions stored in memory or by a processor that operates according to instructions embedded in logic circuits. The term "processor" should be interpreted broadly to include CPUs, processing units, ASICs, logic units, or programmable gate groups, etc. These methods and modules can be executed by a single processor or by multiple processors working together.

[0034] These machine-readable instructions can also be stored in a computer-readable storage medium that can instruct a computer or other programmable data processing device to operate in a specific mode. For example, the instructions can be provided on a non-transitory computer-readable storage medium encoded with instructions executable by a processor.

[0035] Figure 1 This is a flowchart of the method according to the example. The graphics processing method for processing electronic data for display on a screen includes, in block 101, using an aligned and vectorized data structure from the Gilbert-Johnson-Keerthi algorithm running on a single instruction multiple data (SIMD) processor to evaluate the distances between objects in a display scene to be rendered and displayed on the screen. The structure includes a separation axis, the position and rotation of the local coordinate system, and the position of each point in the convex set. The separation axis can be supported by a mapping function through direction vectors constituting the local coordinate system. Each point in the convex set can be represented using its X, Y, and Z coordinate values.

[0036] SIMD processors perform operations on aligned and vectorized data, thereby improving performance by efficiently utilizing their hardware through data parallelism. Here, the terms "aligned" and "vectorized" refer to data structures whose starting address is a multiple of the width of the executing processor, making them efficient for SIMD processors. In one example, the size of the array storing the data can match the size of the SIMD processor's vector registers.

[0037] In box 102, the method includes: implementing the Gilbert-Johnson-Keerthi algorithm using only support functions and a single loop, wherein the support functions include acyclic and branchless functions to support the mapping function, and the algorithm is repeated in a single loop until the optimal point of the shortest distance between two objects is identified.

[0038] In the context of the GJK algorithm, a support function can refer to a mathematical function that determines the farthest point on the convex shape in a given direction. Specifically, a support function can take a direction vector and return the farthest point on the convex shape in that direction. Support functions are crucial for iteratively expanding a simplex. A support function can involve iterating over the vertices of the convex shape and computing the dot product of the position vector of each vertex with the specified direction vector. The vertex with the largest dot product (representing the farthest point in the given direction) can then be returned as the output of the support function.

[0039] Advantageously, the support function is designed to be branchless, i.e., it operates without conditional branches. By removing conditional branches, the efficiency of the GJK algorithm can be improved by avoiding potential branch misprediction and facilitating optimized execution in vectorized or parallel processing environments. To aid in understanding the support function, reference will now be made to... Figure 2 , Figure 2 This is a flowchart based on the supporting functions in the example.

[0040] The goal of the support function can be to find a vector M in a first vector set (S1, S2, ..., Sn) such that the dot product of the input vector V and vector M includes the maximum value of any vector in the first vector set. The input vector V can include the search direction initialized during the first iteration of the GJK algorithm and evaluated by the support function. Vector M can include the vector that achieves the furthest distance in direction V. Advantageously, the support function is designed to be acyclic and branchless, thus improving the performance of the GJK algorithm.

[0041] The first vector set can be divided into multiple non-overlapping batches. The number of batches into which the first set can be divided can be less than the number of vectors in the first vector set. Each of the multiple batches may fit into a processor register. Each batch can be stored in a separate register.

[0042] In box 201, vector dot products can be computed. Specifically, multiple vector dot products can be computed to calculate the vector dot product for each batch of vectors in multiple batches. SIMD instructions can be used to compute the dot product between the input vector V and a batch of vectors in the first vector set. Advantageously, using a SIMD processor allows batch dot product computations to be performed in parallel. The computed vector dot products can be stored separately in the processor's registers so that each batch has its own dedicated register.

[0043] In box 202, a vector mask can be used to find vector M. To find vector M, the method may include finding the maximum value (and corresponding index) calculated in the previous stage. That is, each used register can be examined. The SIMD processor can use a mask to find the maximum value. If the vector set is divided into multiple batches, the mask can be logically performed to first find the "local" maximum value for each register. The local maximum values ​​can then be compared to find the "global" maximum value, thereby finding vector M.

[0044] In box 203, the value of the input vector V can be updated. Specifically, the value of the input vector M can be updated using the vector M calculated in box 202.

[0045] The inner loop and branches within the support function 200 can be removed by utilizing spatial coherence. Figure 3 This is a schematic diagram of the concept of spatial coherence, used to help understand the present invention. Figure 3 Two objects, P310 and Q320, are depicted at times N and N+1. Objects 310 and 320 enclose a convex set (not shown). Here, "convex" refers to a set formed by... Figure 3 The actual shapes of the items within the boundaries depicted by objects 310 and 320 are shown. The set of points (composed of X, Y, and Z coordinates) of each vertex encloses the convex object. The minimum distance between objects 310 and 320 is shown in the figure. In the time-progression simulation, adjacent objects 310 and 320 exhibit small displacements between time N and the subsequent time N+1. Therefore, the computation of the support function can be accelerated by caching the solution at time N and speculating that subsequent solutions at time N+1 will be located near the cached solution. Thus, the inner loop of the support function can be replaced by a branchless expanded loop known at compile time and limited to a subset of adjacent points. The subset of adjacent points can be a memory-aligned array whose size matches the processor's vector registers.

[0046] Specifically, spatial coherence can accelerate the solution at time T+1 by storing the vertices of each object that "supports the solution." See again... Figure 3 The "supporting" vertices of object P 310 may include, for example, vertices P6 and P7, and the "supporting" vertices of object Q 320 may include vertices Q1 and Q8. These points can be cached, and their neighbors can be considered in the next time step. Neighboring vertices can be identified in any suitable manner (e.g., graph-based, or using a nearest neighbor algorithm).

[0047] For example, using the concepts of "neighborhood" and "convexity," when looking for the farthest point toward object Q 320, P6 or P7 can be considered. Furthermore, the neighbors of P6 or P7 can be considered. For instance, when considering vertex P6, assuming the registers can fit four vertices, the dot products of P7, P8, P5, and P4 can be computed in parallel. The resulting values ​​can then be compared to the dot product of P6, and the index of the vertex that yields the highest product can be returned. At this point, a "local" maximum has been found. While this approach could stop at this point, for complex applications, more batches can be considered, and the local maximums of more than one register can be considered. In one example, if two registers are considered, eight neighbors of P6 can be found. The number of registers to be used can be defined at compile time and cannot be changed at runtime. However, executables with multiple implementations with supporting functions can be provided, allowing the desired number of registers to be selected during initialization.

[0048] Advantageously, this invention removes all conditional ("if", "else") branches from supporting functions. This invention generates vector code for the widest register available in the processor. Furthermore, by unrolling inner loops, all "jump" instructions (e.g., instructions that the compiler would not generate) can be eliminated.

[0049] Figure 4 This is a schematic diagram of an example apparatus. Apparatus 400 may include a single-instruction multiple-data (SIMD) processor 403. Processor 403 may be used to perform the methods described herein.

[0050] According to one example, machine-readable instructions can be loaded onto a computer or other programmable data processing apparatus to cause the computer or other programmable data processing apparatus to perform a series of operations to produce a computer-implemented process. Thus, the instructions that execute on the computer or other programmable apparatus provide operations for implementing the functions specified in the flow in the flowchart and / or the boxes in the block diagram.

[0051] Furthermore, the guidance herein may be implemented in the form of a computer or software product (e.g., a non-transitory machine-readable storage medium) that is stored in the storage medium and includes a plurality of instructions, such as machine-readable instructions, for causing a computer device to implement the methods described in the examples of the present invention.

[0052] In some examples, certain methods can be executed in a cloud-based or web-based environment. Cloud environments can provide a variety of services and applications via the internet. For example, these cloud-based services (e.g., Software as a Service, Platform as a Service, Infrastructure as a Service, etc.) can be accessed through a user's device's web browser or other remote interface. The various functionalities described herein can be provided through a remote desktop environment or any other cloud-based computing environment.

[0053] While various embodiments have been described and / or illustrated herein in the context of a full-featured computing system, one or more embodiments of these exemplary embodiments may be distributed as a program product in various forms, regardless of the specific type of computer-readable storage medium used for actual execution of the distribution. The embodiments disclosed herein may also be implemented using software modules that perform certain tasks. These software modules may include scripts, batch files, or other executable files that may be stored on a computer-readable storage medium or in a computing system. In some embodiments, these software modules may configure a computing system to perform one or more embodiments of the exemplary embodiments disclosed herein. Furthermore, one or more modules described herein may convert representations of data, physical devices, and / or physical devices from one form to another.

[0054] The above description is provided to enable those skilled in the art to best utilize the various aspects of the exemplary embodiments disclosed herein. This exemplary description is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Various modifications and variations can be made without departing from the spirit or scope of the invention. The embodiments disclosed herein should be considered illustrative in all respects and not restrictive. In determining the scope of the invention, reference should be made to the appended claims and their equivalents.

Claims

1. A graphics processing method for processing electronic data for display on a display screen, characterized in that, include: The distance between objects in the display scene to be rendered and displayed on the display is evaluated using an alignment and vectorized data structure in the Gilbert-Johnson-Keerthi algorithm running on a single instruction multiple data (SIMD) processor. The structure includes a separation axis, the position and rotation of the local coordinate system, and the position of each point in the convex set (101). The Gilbert-Johnson-Keerthi algorithm is implemented using only a support function and a single loop, wherein the support function comprises an acyclic and branchless function to support the mapping function, and the single loop repeats the algorithm until the optimal point (102) with the shortest distance between the two objects is identified.

2. The method according to claim 1, characterized in that, The support functions include functions for performing the following operations: Identify a first vector from a first set of vectors, wherein the dot product of the first vector and the input vector includes the maximum value of any vector in the first set of vectors.

3. The method according to claim 2, characterized in that, Also includes: Calculate the dot product between the input vector and the first set of vectors; The calculated dot product is stored in a register.

4. The method according to claim 3, characterized in that, Identifying the first vector also includes: The first vector is identified by using a mask to find the maximum value stored in the register and the index of the maximum value in the register.

5. The method according to claim 2, characterized in that, Also includes: The input vector is computed in parallel with multiple dot products of multiple subsets of the first vector set; Each of the multiple dot products is stored in a separate register among multiple registers.

6. The method according to claim 5, characterized in that, Identifying the first vector also includes: Use a mask to find the local maximum value stored in each of the plurality of registers; The first vector is identified by comparing the local maximum values ​​stored in each register to find the global maximum value stored in the plurality of registers.

7. The method according to claim 4 or 6, characterized in that, Also includes: Change the value of the input vector to the value of the first vector.

8. A computer-readable storage medium, characterized in that, Includes computer program code, accessible by a device including a processor to provide instructions and / or data to the device, the computer program code being used by the processor to cause the device to: The steps of performing the method according to any one of claims 1 to 7.

9. A graphics processing apparatus (400) for processing electronic data for display on a display screen, characterized in that, include: The single instruction multiple data (SIMD) processor (403) is used for: The distance between objects in the display scene to be rendered and displayed on the display is evaluated using an alignment and vectorized data structure in the Gilbert-Johnson-Keerthi algorithm running on a single instruction multiple data (SIMD) processor (403). The structure includes a separation axis, the position and rotation of the local coordinate system, and the position of each point in the convex set. The Gilbert-Johnson-Keerthi algorithm is implemented using only support functions and a single loop, wherein the support functions include acyclic and branchless functions to support the mapping function, and the single loop repeats the algorithm until the optimal point with the shortest distance between two objects is identified.

10. The apparatus according to claim 9, characterized in that, The support functions include functions for performing the following operations: Identify a first vector from a first set of vectors, wherein the dot product of the first vector and the input vector includes the maximum value of any vector in the first set of vectors.

11. The apparatus according to claim 10, characterized in that, The processor (403) is also used for: Calculate the dot product between the input vector and the first set of vectors; The calculated dot product is stored in a register.

12. The apparatus according to claim 11, characterized in that, In order to identify the first vector, the processor (403) is further configured to: The first vector is identified by using a mask to find the maximum value stored in the register and the index of the maximum value in the register.

13. The apparatus according to claim 10, characterized in that, The processor (403) is also used for: The input vector is computed in parallel with multiple dot products of multiple subsets of the first vector set; Each of the multiple dot products is stored in a separate register among multiple registers.

14. The apparatus according to claim 13, characterized in that, In order to identify the first vector, the processor (403) is further configured to: Use a mask to find the local maximum value stored in each of the plurality of registers; The first vector is identified by comparing the local maximum values ​​stored in each register to find the global maximum value stored in the plurality of registers.

15. The apparatus according to claim 12 or 14, characterized in that, The processor (403) is also configured to change the value of the input vector to the value of the first vector.