GPU data processing method, device and storage medium

By adopting a non-overwrite mode CAM deduplication mechanism in the GPU to redistribute and package vertex data, the problem of low utilization of vertex cache space in the existing technology is solved, and more efficient graphics rendering processing is achieved.

CN117764808BActive Publication Date: 2024-09-17MOORE THREADS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311785293.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2024-09-17
Estimated Expiration
2043-12-22

AI Technical Summary

Technical Problem

In the geometry stage of graphics rendering, the CAM deduplication mechanism of existing GPUs is too solid, resulting in low utilization of vertex cache space and low processing efficiency.

Method used

The CAM deduplication mechanism in non-overwrite mode is adopted. By obtaining the input primitive index data, the vertex data in the CAM is redistributed and packaged to prevent the index data from overwriting the allocated data and improve the utilization of the vertex cache space.

Benefits of technology

Improves the GPU's vertex cache space utilization and processing efficiency during the graphics rendering geometry phase, and avoids the situation where index data waits for overwriting before resources are released.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117764808B
    Figure CN117764808B
Patent Text Reader

Abstract

The present disclosure relates to the field of graphics rendering technology, and in particular to a data processing method, device and storage medium for a GPU. The method includes: obtaining input primitive index data, the primitive index data including first index data corresponding to each of n vertex data in the primitive; performing CAM scanning on the primitive index data; when the number m of free index data in the CAM is less than n, reallocating the second index data corresponding to each of k vertex data among the n vertex data, and packaging the k second index data to obtain a task, the working mode of the CAM is a non-overwrite mode, and the non-overwrite mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM. Compared with the overwritable scheme in the related art, the non-overwrite mechanism scheme of the CAM provided in the embodiment of the present disclosure can effectively improve the utilization rate of the subsequent vertex cache space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of graphics rendering technology, and in particular to a data processing method, device and storage medium of a graphics processing unit (GPU). Background Art

[0002] In the geometry stage of graphics rendering, in order to avoid repeated unified shader cluster (USC) calculations of vertex data, the GPU uses a content-addressable memory (CAM) deduplication mechanism to assign a unique index number to different vertex data. The index number is used to indicate the location of the vertex data after USC calculation in the vertex cache space. The vertex data after USC calculation will be packaged into multiple task data and stored in the vertex cache space.

[0003] The current CAM deduplication mechanism is too rigid, resulting in low utilization of vertex cache space and low processing efficiency of the GPU in the geometry stage of graphics rendering. Summary of the invention

[0004] In view of this, the present disclosure proposes a GPU data processing method, device and storage medium. The technical solution includes:

[0005] According to one aspect of the present disclosure, a GPU data processing method is provided, the method comprising:

[0006] Obtain input primitive index data, wherein the primitive index data includes first index data corresponding to each of n vertex data in the primitive, where n is a positive integer;

[0007] Performing a CAM scan on the primitive index data, wherein the CAM scan is used to indicate to sequentially reallocate corresponding second index data for the n vertex data in the CAM;

[0008] When the number m of idle index data in the CAM is less than n, reallocating the second index data corresponding to k vertex data among the n vertex data, and packing the k second index data to obtain a task, wherein m and k are both positive integers, and k is less than or equal to m;

[0009] The working mode of the CAM is a non-overwriting mode, and the non-overwriting mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

[0010] In a possible implementation, before obtaining the input primitive index data, the process further includes:

[0011] Acquiring control data, wherein the control data is used to indicate a task working mode;

[0012] When it is detected that the task working mode is the target granularity mode, the working mode of the CAM is set to the non-overwriting mode.

[0013] In another possible implementation, the granularity corresponding to the target granularity pattern is greater than a preset value, and the granularity corresponding to the target granularity pattern is used to indicate a maximum number of work item instances included in the assembled task.

[0014] In another possible implementation, the method further includes:

[0015] When it is detected that the task working mode is not the target granularity mode, the working mode of the CAM is set to an overwrite mode, where the overwrite mode is used to indicate a function of supporting input index data to overwrite allocated index data in the CAM.

[0016] In another possible implementation, the method further includes:

[0017] When m is greater than or equal to n, the second index data corresponding to each of the n vertex data are reallocated.

[0018] In another possible implementation, the second index data is used to indicate a position of the corresponding vertex data in the vertex cache space, and after the k second index data are packaged to obtain the task, the method further includes:

[0019] Get the packaged tasks;

[0020] According to the k second index data in the task, the vertex data corresponding to each of the k second index data are stored in the vertex cache space.

[0021] In another possible implementation, the method further includes:

[0022] Read the k vertex data from the vertex buffer space, and obtain the second index data corresponding to each of the k vertex data;

[0023] After synchronizing the k vertex data with the corresponding k second index data, outputting the image data, the image data includes at least one of the vertex data.

[0024] In another possible implementation, the method further includes:

[0025] Saving a target count value of each of the tasks, where the target count value is the number of unused second index data in the task and located in the vertex cache space;

[0026] When the primitive data are output, a usage value is subtracted from the target count value, where the usage value is the number of the vertex data included in the primitive data.

[0027] In another possible implementation, the method further includes:

[0028] When it is detected that the target count value of the task is zero, a cache release command is sent to the vertex cache space, where the cache release command is used to instruct to release the space corresponding to the task in the vertex cache space.

[0029] According to another aspect of the present disclosure, a data processing device of a GPU is provided, the device comprising:

[0030] An acquisition module, used for acquiring input primitive index data, wherein the primitive index data includes first index data corresponding to each of n vertex data in the primitive, where n is a positive integer;

[0031] A scanning module, used for performing CAM scanning on the primitive index data, wherein the CAM scanning is used for indicating to sequentially reallocate corresponding second index data for the n vertex data in the CAM;

[0032] A packing module, used for reallocating the second index data corresponding to k vertex data among the n vertex data when the number m of idle index data in the CAM is less than n, and packing the k second index data to obtain a task, wherein m and k are both positive integers, and k is less than or equal to m;

[0033] The working mode of the CAM is a non-overwriting mode, and the non-overwriting mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

[0034] In a possible implementation manner, the device further includes: a first setting module, wherein the first setting module is configured to:

[0035] Acquiring control data, wherein the control data is used to indicate a task working mode;

[0036] When it is detected that the task working mode is the target granularity mode, the working mode of the CAM is set to the non-overwriting mode.

[0037] In another possible implementation, the granularity corresponding to the target granularity pattern is greater than a preset value, and the granularity corresponding to the target granularity pattern is used to indicate a maximum number of work item instances included in the assembled task.

[0038] In another possible implementation, the device further includes: a second setting module; the second setting module is configured to:

[0039] When it is detected that the task working mode is not the target granularity mode, the working mode of the CAM is set to an overwrite mode, where the overwrite mode is used to indicate a function of supporting input index data to overwrite allocated index data in the CAM.

[0040] In another possible implementation, the device further includes: an allocation module; the allocation module is configured to:

[0041] When m is greater than or equal to n, the second index data corresponding to each of the n vertex data are reallocated.

[0042] In another possible implementation, the second index data is used to indicate a position of the corresponding vertex data in a vertex cache space, and the device further includes: a cache module; the cache module is used to:

[0043] Get the packaged tasks;

[0044] According to the k second index data in the task, the vertex data corresponding to each of the k second index data are stored in the vertex cache space.

[0045] In another possible implementation, the device further includes: an output module; the output module is configured to:

[0046] Read the k vertex data from the vertex buffer space, and obtain the second index data corresponding to each of the k vertex data;

[0047] After synchronizing the k vertex data with the corresponding k second index data, outputting the image data, the image data includes at least one of the vertex data.

[0048] In another possible implementation, the device further includes: a calculation module; the calculation module is configured to:

[0049] Saving a target count value of each of the tasks, where the target count value is the number of unused second index data in the task and located in the vertex cache space;

[0050] When the primitive data are output, a usage value is subtracted from the target count value, where the usage value is the number of the vertex data included in the primitive data.

[0051] In another possible implementation, the device further includes: a releasing module; the releasing module is configured to:

[0052] When it is detected that the target count value of the task is zero, a cache release command is sent to the vertex cache space, where the cache release command is used to instruct to release the space corresponding to the task in the vertex cache space.

[0053] According to another aspect of the present disclosure, a computing device is provided, the computing device comprising: a processor; a memory for storing processor-executable instructions;

[0054] Wherein, the processor is configured to:

[0055] Obtain input primitive index data, wherein the primitive index data includes first index data corresponding to each of n vertex data in the primitive, where n is a positive integer;

[0056] Performing a CAM scan on the primitive index data, wherein the CAM scan is used to indicate to sequentially reallocate corresponding second index data for the n vertex data in the CAM;

[0057] When the number m of idle index data in the CAM is less than n, reallocating the second index data corresponding to k vertex data among the n vertex data, and packing the k second index data to obtain a task, wherein m and k are both positive integers, and k is less than or equal to m;

[0058] The working mode of the CAM is a non-overwriting mode, and the non-overwriting mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

[0059] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method provided by the first aspect or any possible implementation manner of the first aspect is implemented.

[0060] The disclosed embodiment obtains input primitive index data, wherein the primitive index data includes first index data corresponding to each of n vertex data in the primitive, wherein n is a positive integer; performs CAM scanning on the primitive index data, wherein the CAM scanning is used to indicate that corresponding second index data are reallocated in sequence for the n vertex data in the CAM; when the number m of free index data in the CAM is less than n, reallocates second index data corresponding to k vertex data among the n vertex data, and packages the k second index data to obtain a task; since the working mode of the CAM is a non-overwrite mode, that is, in the process of reallocating index data for vertex data, the input index data does not overwrite the allocated index data in the CAM, thereby avoiding the situation in the current overwritable scheme that the index data needs to wait to be completely overwritten before releasing resources. Compared with the overwritable scheme in the related art, the non-overwrite mechanism scheme of the CAM provided by the disclosed embodiment can effectively improve the utilization rate of subsequent vertex cache space when vertex data is managed in the geometry stage. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0062] Figure 1 A schematic diagram of the structure of a computing device provided by an exemplary embodiment of the present disclosure is shown.

[0063] Figure 2 A flowchart of a GPU data processing method provided by an exemplary embodiment of the present disclosure is shown.

[0064] Figure 3 A flowchart of a GPU data processing method provided by another exemplary embodiment of the present disclosure is shown.

[0065] Figure 4 A flowchart of a GPU data processing method provided by another exemplary embodiment of the present disclosure is shown.

[0066] Figure 5 A schematic diagram showing a principle of a GPU data processing method provided by an exemplary embodiment of the present disclosure is shown.

[0067] Figure 6 A schematic diagram showing the principle of a data cache method involved in a GPU data processing method provided by another exemplary embodiment of the present disclosure is shown.

[0068] Figure 7 A flowchart of a GPU data processing method provided by another exemplary embodiment of the present disclosure is shown.

[0069] Figure 8 A schematic diagram of the structure of a GPU data processing device provided by an exemplary embodiment of the present disclosure is shown.

[0070] Fig. 9 The invention is a block diagram showing a device for a data processing method for a GPU according to an exemplary embodiment.

[0071] Fig.10 The invention is a block diagram showing a device for a data processing method for a GPU according to an exemplary embodiment. DETAILED DESCRIPTION

[0072] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0073] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0074] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0075] First, the application scenarios involved in the present disclosure are introduced.

[0076] Please refer to Figure 1 , which shows a schematic diagram of the structure of a computing device provided by an exemplary embodiment of the present disclosure.

[0077] The computing device includes a server and / or a terminal. The terminal includes a mobile terminal or a fixed terminal, such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc. The server can be a server, or a server cluster composed of several servers, or a cloud computing service center.

[0078] The computing device includes a processor 10, a memory 20, and a communication interface 30. Those skilled in the art will appreciate that Figure 1 The structure shown in the figure does not constitute a limitation on the computing device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0079] The processor 10 is the control center of the computing device, and uses various interfaces and lines to connect various parts of the entire computing device. It executes various functions of the computing device and processes data by running or executing software programs and / or modules stored in the memory 20, and calling data stored in the memory 20, thereby controlling the computing device as a whole. The processor 10 can be implemented by a CPU or a GPU.

[0080] The memory 20 can be used to store software programs and modules. The processor 10 executes various functional applications and data processing by running the software programs and modules stored in the memory 20. The memory 20 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system 21, an acquisition module 22, a scanning module 23, a packaging module 24, and an application 25 required for at least one function, etc.; the data storage area may store data created according to the use of the computing device, etc. The memory 20 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk. Accordingly, the memory 20 may further include a memory controller to provide the processor 10 with access to the memory 20 .

[0081] Among them, the processor 10 performs the following functions by running the acquisition module 22: acquiring the input primitive index data, the primitive index data includes the first index data corresponding to each of the n vertex data in the primitive, and n is a positive integer. The processor 10 performs the following functions by running the scanning module 23: performing CAM scanning on the primitive index data, the CAM scanning is used to indicate that the corresponding second index data is reallocated in sequence for the n vertex data in the CAM, and the working mode of the CAM is the non-overwrite mode, and the non-overwrite mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM. The processor 10 performs the following functions by running the packaging module 24: when the number m of idle index data in the CAM is less than n, the corresponding second index data is reallocated for k vertex data among the n vertex data, and the k second index data are packaged to obtain a task, m and k are both positive integers, and k is less than or equal to m.

[0082] The GPU data processing method provided by the embodiment of the present disclosure is applied to the GPU of the computing device, and the application scenario is the geometry stage of the GPU in graphics rendering. In order to avoid repeated USC calculations of vertex data, the CAM deduplication mechanism provided by the embodiment of the present disclosure is adopted to reallocate a unique second index data for different vertex data, and the second index data is used to indicate the position of the vertex data after USC calculation in the vertex cache space. In the process of reallocating index data for different vertex data in turn, the input index data does not overwrite the allocated index data in the CAM.

[0083] It should be noted that there is a mechanism in the overwritable mode of the CAM in the related art, that is, the index data corresponding to the vertex data in task 1 must completely overwrite the index data corresponding to the vertex data in task 0 before the resources occupied by the vertex data corresponding to task 0 in the vertex cache can be released. The non-overwriting mechanism of the CAM provided in the embodiment of the present disclosure avoids the above operation, and the resources can be released without waiting for the index data of task 0 to be completely overwritten. Therefore, from the perspective of the time dimension, the vertex cache can be used faster and released faster. Therefore, compared with the overwritable scheme in the related art, the non-overwriting mechanism scheme of the CAM provided in the embodiment of the present disclosure can effectively improve the utilization rate of the subsequent vertex cache space when managing vertex data in the geometry stage.

[0084] The following describes the GPU data processing method provided by the embodiments of the present disclosure using several exemplary embodiments.

[0085] Please refer to Figure 2 , which shows a flowchart of a GPU data processing method provided by an exemplary embodiment of the present disclosure. In this embodiment, the method is used for Figure 1 The method is illustrated by taking the GPU of the computing device shown in FIG.

[0086] Step 201, obtaining control data, where the control data is used to indicate a task working mode.

[0087] The GPU obtains input control data, which is used to indicate the task working mode.

[0088] The granularity corresponding to the task working mode is used to indicate the maximum number of work item instances included in the assembled task, and different task working modes correspond to different granularities.

[0089] Illustratively, the task working mode may include wave32 mode and wave128 mode (wave is a custom SIMD thread bundle, wave32 mode represents a parallel thread bundle composed of 32 work item instances, and wave128 mode represents a parallel thread bundle composed of 128 work item instances). Alternatively or additionally, the task working mode may also include wave64 mode, etc. For example, 32 or 128 work item instances may be assembled into a task wave32 or wave128 according to the wave32 mode or the wave128 mode, respectively, where 32 and 128 represent the granularity corresponding to different working modes, respectively. Alternatively or additionally, the task may also include wave64, etc.

[0090] In schematic form, if the task working mode is wave128 mode, the corresponding granularity can be determined to be 128. Starting from the first work item instance to the 128th work item instance, after the cumulative count is 128, the 128 work item instances are assembled into a task wave128. If the task working mode is wave32 mode, the corresponding granularity can be determined to be 32. Starting from the first work item instance to the 32nd work item instance, after the cumulative count is 32, the 32 work item instances are assembled into a task wave32.

[0091] Step 202: When it is detected that the task working mode is the target granularity mode, the working mode of the CAM is set to a non-overwrite mode.

[0092] Optionally, the target granularity mode is a default task working mode or a custom task working mode.

[0093] Optionally, the granularity corresponding to the target granularity mode is greater than a preset value, and the granularity corresponding to the target granularity mode is used to indicate the maximum number of work item instances included in the assembled task. That is, the target granularity mode is a task work mode whose corresponding granularity is greater than a preset value.

[0094] The preset value may be a default setting or a custom setting. Schematically, the target granularity mode is also called a large granularity mode, for example, the target granularity mode is a wave128 mode. The embodiments of the present disclosure are not limited to this.

[0095] When the GPU detects that the task working mode is the target granularity mode, the working mode of the CAM is set to the non-overwrite mode, which is used to indicate that the input index data does not overwrite the allocated index data in the CAM. In other words, the non-overwrite mode does not support the data overwrite function of the index data, and the input index data cannot replace the allocated index data in the CAM. The allocated index data in the CAM can release resources without waiting to be overwritten. Schematically, when there is no free index data in the CAM, the corresponding second index data cannot be reallocated for the vertex data corresponding to the input first index data.

[0096] Optionally, the non-overwrite mode is also used to indicate that the second index data corresponding to all vertex data in a primitive are stored in a task in the vertex cache space.

[0097] Optionally, the non-overwrite mode does not support the function of forming a primitive with the first vertex data and the second vertex data, the first vertex data is the vertex data corresponding to at least one second index data in the first task, the second vertex data is the vertex data corresponding to at least one second index data in the second task, and the first task and the second task are two different tasks.

[0098] Optionally, when the GPU detects that the task working mode is not the target granularity mode, the working mode of the CAM is set to the overwrite mode, where the overwrite mode is used to indicate a function that supports input index data to overwrite the allocated index data in the CAM. That is, when the GPU detects that the task working mode is not the target granularity mode, the overwrite mode provided in the related art is kept unchanged.

[0099] Step 203 , obtaining input primitive index data, where the primitive index data includes first index data corresponding to each of n vertex data in the primitive.

[0100] When the task working mode is the target granularity mode and the working mode of the CAM is the non-overwrite mode, the GPU obtains the input primitive index data, which includes the first index data corresponding to each of the n vertex data, the n vertex data are multiple vertex data included in one or more primitives, the first index data is the original index data, and n is a positive integer. There is a one-to-one correspondence between the vertex data and the first index data.

[0101] Step 204 , performing CAM scanning on the primitive index data, where the CAM scanning is used to indicate to sequentially reallocate the corresponding second index data for the n vertex data in the CAM.

[0102] When the task working mode is the target granularity mode and the CAM working mode is the non-overwrite mode, the GPU performs a CAM scan on the primitive index data, wherein the granularity corresponding to the target granularity mode is greater than a preset value, and the non-overwrite mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

[0103] The CAM scan is used to indicate that the corresponding second index data is sequentially reallocated for n vertex data in the CAM, and the second index data is used to indicate the position of the corresponding vertex data in the vertex cache space.

[0104] The second index data is different from the first index data. Optionally, in order to effectively reduce the cache space required for subsequent processing, the bits occupied by the second index data are smaller than the bits occupied by the first index data. For example, the bits occupied by the first index data are 32 bits, and the bits occupied by the second index data are 8 bits. This is not limited in the embodiments of the present disclosure.

[0105] Optionally, after performing a CAM scan on the first index data corresponding to all vertex data in the input one or more primitives, determine whether the number of idle index data in the CAM is less than the total number of vertex data. The number of idle index data in the CAM is m, and the total number of vertex data is the total number of input first index data, that is, the total number of vertex data is n, and both n and m are positive integers. If m is less than n, that is, it is found that it is impossible to allocate the required second index data for all vertex data in the input one or more primitives at one time, execute step 205. If m is greater than or equal to n, that is, it is found that it is possible to allocate the required second index data for all vertex data in the input one or more primitives at one time, the second index data corresponding to each of the n vertex data is reallocated, and the second index data is used to indicate the position of the corresponding vertex data in the vertex cache space. The data processing at this stage is completed, and for the next input primitive index data, the step of performing a CAM scan on the primitive index data is performed according to the above rules.

[0106] Optionally, after the n vertex data are reallocated to their respective corresponding second index data, the n second index data may be packaged to obtain a task.

[0107] Optionally, the GPU performs a CAM scan on the primitive index data according to the primitive granularity, and the CAM scan is used to indicate that all the vertex data of each primitive are reallocated in the CAM at one time. That is to say, for a primitive, the GPU determines whether the number of idle index data in the CAM is less than the total number of vertex data of the primitive. If the number of idle index data in the CAM is greater than or equal to the total number of vertex data of the primitive, that is, it is found that the required second index data can be allocated to all the vertex data of the primitive at one time, the vertex data of the primitive is reallocated to the corresponding second index data, and the next primitive is continued to perform the step of determining whether the number of idle index data in the CAM is less than the total number of vertex data of the primitive. If the number of idle index data in the CAM is less than the total number of vertex data of the primitive, that is, it is found that the required second index data cannot be allocated to all the vertex data of the primitive at one time, the multiple second index data allocated in the CAM can be packaged to obtain a task later, and the multiple second index data include the second index data allocated for all vertex data of other primitives, and the other primitives are at least one primitive other than the primitive in the primitive index data.

[0108] Step 205 , when the number m of idle index data in the CAM is less than n, reallocate the second index data corresponding to k vertex data among the n vertex data, and pack the k second index data to obtain a task.

[0109] When m is less than n, since the working mode of the CAM is the non-overwrite mode, the input index data does not overwrite the allocated index data in the CAM, which means that the existing free index data in the CAM is insufficient to be allocated to all vertex data of one or more input primitives, that is, it is impossible to allocate the required second index data to all the input vertex data at one time, and reallocate the corresponding second index data to k vertex data out of the n vertex data, and force the allocated k second index data to be packaged to obtain a task for subsequent unified calculation and processing, where k is a positive integer less than or equal to m.

[0110] Optionally, the k vertex data include all vertex data of the target primitive; or, include all vertex data of the target primitive and part of vertex data of one primitive; or, include part of vertex data of one primitive. The target primitive is one or at least two primitives of the input primitives, a primitive is one primitive of the input primitives, and the input primitives are multiple primitives corresponding to the input primitive index data. Correspondingly, the k second index data include second index data allocated for all vertex data of the target primitive; or, include second index data allocated for all vertex data of the target primitive and part of vertex data of one primitive; or, include second index data allocated for part of vertex data of one primitive.

[0111] Optionally, the non-overwrite mode is also used to indicate that the second index data corresponding to all vertex data in a primitive are all present in one task. In this case, the k vertex data include all vertex data of the target primitive, and the k second index data include the second index data allocated to all vertex data of the target primitive.

[0112] The number of free index data in the CAM is m, which is the total number of unallocated index data in the CAM; the total number of vertex data in the input one or more primitives is n, and both n and m are positive integers. Since there is a one-to-one correspondence between vertex data and first index data, the total number of vertex data is the total number of all first index data in the primitive index data.

[0113] In an illustrative example, when the task working mode is the target granularity mode and the CAM working mode is the non-overwrite mode, the data processing method of the GPU includes but is not limited to the following steps: Figure 3 As shown: Step 301, GPU obtains input primitive index data; Step 302, GPU performs CAM scanning according to the granularity of primitives; Step 303, GPU determines whether the number of free index data in CAM is less than the total number of vertex data in primitives; Step 304, when the number of free index data in CAM is less than the total number of vertex data in primitives, it means that the free index data in CAM is insufficient to be allocated to all vertex data in the primitive, and GPU reallocates the corresponding second index data to part of the vertex data in the primitive, and forces the allocated multiple second index data to be packaged to obtain tasks; Step 304, when the number of free index data in CAM is greater than or equal to the total number of vertex data in the primitive, it means that the required second index data can be allocated to all vertex data in the primitive at one time, and the data processing at this stage is completed. For the next input primitive index data, the step of performing CAM scanning on the primitive index data is performed according to the above rules.

[0114] In a possible implementation, after the above step 205, there are also but not limited to the following steps: Figure 4 As shown:

[0115] Step 401, obtain the packaged tasks.

[0116] The GPU obtains the packaged task, processes the task to obtain k second index data in the task, and each second index data in the k second index data uniquely indicates the corresponding vertex data.

[0117] Step 402: according to the k second index data in the task, store the vertex data corresponding to each of the k second index data into the vertex cache space.

[0118] Optionally, the GPU stores the vertex data corresponding to each of the k second index data in the task into the vertex cache space according to the task granularity, and the second index data is used to indicate the position of the corresponding vertex data in the vertex cache space.

[0119] Optionally, the multiple vertex data are stored in the vertex cache space according to the task granularity, that is, the vertex cache space includes the multiple vertex data corresponding to each task stored according to the task granularity.

[0120] Among them, the second index data corresponding to all vertex data in a primitive are all stored in a task in the vertex cache space. The first vertex data and the second vertex data are not related, that is, the first vertex data and the second vertex data cannot form a primitive. The first vertex data is the vertex data corresponding to at least one second index data in the first task, and the second vertex data is the vertex data corresponding to at least one second index data in the second task. The first task and the second task are two different tasks.

[0121] Step 403, read k vertex data from the vertex cache space, and obtain second index data corresponding to each of the k vertex data.

[0122] The GPU reads k vertex data from the vertex cache space, and obtains second index data corresponding to each of the k vertex data.

[0123] Step 404 , after synchronizing the k vertex data with the corresponding k second index data, outputting the image metadata and saving the target count value of each task.

[0124] The graphic element data includes at least one vertex data.

[0125] The GPU synchronizes the k vertex data with the corresponding k second index data, and after the synchronization is completed, outputs a primitive data, which includes at least one vertex data, and saves the target count value of each task. The target count value is the number of unused second index data in the vertex cache space in the task. That is, the target count value is the number of unused vertex data in the vertex cache space corresponding to the task.

[0126] Optionally, the target count value is stored according to the task granularity, that is, the GPU saves the target count value of each task according to the task granularity. The GPU may also save the target count value of each task according to other logics. This disclosure embodiment is not limited to this.

[0127] Step 405: when outputting the primitive data, the target count value is subtracted from the usage value, where the usage value is the number of vertex data included in the primitive data.

[0128] Whenever the GPU outputs a piece of graphics data, the target count value of the task corresponding to the graphics data is subtracted from the usage value, that is, the usage value is the number of vertex data included in the graphics data.

[0129] Step 406: When it is detected that the target count value of the task is zero, a cache release command is sent to the vertex cache space. The cache release command is used to instruct to release the space corresponding to the task in the vertex cache space.

[0130] When the GPU detects that the target count value of the task is zero, it means that all the second index data in the vertex cache space of the current task has been used up, and a cache release command with task as the granularity is sent to the vertex cache space. The cache release command is used to indicate the release of space at the task granularity, that is, to release the space corresponding to the task in the vertex cache space.

[0131] Optionally, when the GPU detects that the target count value of the task is zero, the k second index data corresponding to the task in the CAM can be reset to unallocated index data. It should be noted that after the k second index data are packaged to obtain the task, the above reset can be performed without the k index data corresponding to the task in the CAM, and the embodiment of the present disclosure does not limit the timing of the reset.

[0132] Optionally, for the unreallocated nk vertex data among the n vertex data, after processing the tasks corresponding to the k vertex data (or after resetting the k second index data corresponding to the task in the CAM to unallocated index data), the step of performing CAM scanning is continued for the first index data corresponding to each of the nk vertex data. It should be noted that the step of performing CAM scanning for the first index data corresponding to each of the nk vertex data can be analogously referred to the relevant description of performing CAM scanning for the first index data corresponding to each of the n vertex data, which will not be repeated here.

[0133] In an illustrative example, Figure 5 As shown, the GPU includes but is not limited to module A (including CAM51), module B, module C, module D, vertex cache space 52 and fragment pipeline 53. In the geometry stage of graphics rendering, when the task working mode is the target granularity mode and the working mode of CAM51 is the non-overwrite mode, module A obtains the input primitive index data, and performs CAM51 scanning and deduplication on the input primitive index data according to the granularity of the primitive. When the number m of idle index data in CAM51 is less than the total number n of vertex data in the primitive, module A reallocates the corresponding second index data for k vertex data among the n vertex data, and forces the k second index data to be packaged to obtain the task. After module B obtains the task packaged by module A, it stores the corresponding k vertex data in the vertex cache space 52 according to the k second index data in the task. Module C reads k vertex data from the vertex cache space 52, and obtains the second index data corresponding to each of the k vertex data from module A. After synchronizing the k vertex data with the corresponding k second index data, the module C sends the primitive data to module D. At this time, module C includes the target count value in each task saved. Module D obtains the primitive data, processes the primitive data, and sends the processed data to the fragment pipeline 53. Each time module C sends primitive data to module D, the target count value of the task corresponding to the primitive data is subtracted from the corresponding usage value. When module C detects that the target count value of the task saved therein is zero, it sends a cache release command to the vertex cache space 52 to release the space corresponding to the task in the vertex cache space 52.

[0134] In an illustrative example, Figure 6As shown, CAM51 exemplarily shows four second index data, namely, index 0, index 1, index 2 and index 3, and vertex cache space 52 exemplarily shows task 0, which includes index 0, index 1, index 2 and index 3, wherein index 0 corresponds to vertex data v0, index 1 corresponds to vertex data v1, index 2 corresponds to vertex data v2, and index 3 corresponds to vertex data v3. When it is detected that the target count value of task 0 is zero, it means that all the second index data in the vertex cache space 52 of the current task 0 have been used up, and a cache release command is sent to the vertex cache space 52 to release the space corresponding to task 0 in the vertex cache space 52. When the packaged task 1 is received, the four second index data in task 1 are obtained, namely, index 0, index 1, index 2 and index 3, wherein index 0 corresponds to vertex data v4, index 1 corresponds to vertex data v5, index 2 corresponds to vertex data v6, and index 3 corresponds to vertex data v7, and the four vertex data are stored in the vertex cache space 52.

[0135] One point that needs to be explained is that, when implementing its functions, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0136] Another point to be explained is that the non-overwrite mode of the CAM provided by the embodiment of the present disclosure enables the second index data corresponding to all vertex data in a primitive to be stored in a task in the vertex cache space. At least one vertex data corresponding to a task has no connection with at least one vertex data corresponding to another task, and cannot form a primitive. For example, Figure 6 In the example shown, vertex data v2 and vertex data v3 corresponding to task 0 have no connection with vertex data v4 corresponding to task 1 and cannot form a primitive.

[0137] In summary, the disclosed embodiment provides a CAM deduplication mechanism scheme for large-granularity tasks. On the one hand, when it is detected that the task working mode is a preset target granularity mode, the working mode of the CAM is set to a non-overwrite mode, and the granularity corresponding to the target granularity mode is greater than the preset value, that is, the CAM deduplication scanning granularity is increased, which can effectively improve the data processing speed. On the other hand, since the working mode of the CAM is a non-overwrite mode, the non-overwrite mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM, which avoids the situation in which the index data in the current overwriteable scheme needs to wait to be completely overwritten before the resources can be released. Compared with the overwriteable scheme in the related art, it can effectively improve the utilization rate of the subsequent vertex cache space. On the other hand, according to the second index data corresponding to each of the multiple vertex data, multiple vertex data can be stored in the vertex cache space, and when the target count value of the task is detected to be zero, a cache release command is sent to the vertex cache space. The cache release command is used to indicate the release of the space corresponding to the task in the vertex cache space. The processing method for large-granularity tasks can improve the bandwidth while making full use of the resources of the vertex cache space, and write and release the resources of the vertex cache space faster.

[0138] Please refer to Figure 7 , which shows a flowchart of a GPU data processing method provided by another exemplary embodiment of the present disclosure. In this embodiment, the method is used for Figure 1 The method is illustrated by taking the GPU of the computing device shown in FIG.

[0139] Step 701, obtaining input primitive index data, the primitive index data including first index data corresponding to each of n vertex data in the primitive, where n is a positive integer.

[0140] Step 702, perform CAM scanning on the primitive index data, the CAM scanning is used to indicate that the corresponding second index data is redistributed in sequence for n vertex data in the CAM, and the working mode of the CAM is a non-overwrite mode, which is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

[0141] Step 703, when the number m of idle index data in the CAM is less than n, reallocate the corresponding second index data for k vertex data among the n vertex data, and pack the k second index data to obtain a task, where m and k are both positive integers, and k is less than or equal to m.

[0142] It should be noted that the relevant details of each step in this embodiment can be referred to the relevant description in the above embodiment, and will not be repeated here.

[0143] The following is an apparatus embodiment of the present disclosure. For parts not described in detail in the apparatus embodiment, reference may be made to the technical details disclosed in the above method embodiment.

[0144] Please refer to Figure 8 , which shows a schematic diagram of the structure of a GPU data processing device provided by an exemplary embodiment of the present disclosure. The GPU data processing device can be implemented as all or part of a computing device through software, hardware, or a combination of both. The device includes: an acquisition module 22, a scanning module 23, and a packaging module 24.

[0145] An acquisition module 22 is used to acquire input primitive index data, where the primitive index data includes first index data corresponding to n vertex data in the primitive, where n is a positive integer;

[0146] A scanning module 23, used for performing CAM scanning on the primitive index data, wherein the CAM scanning is used for indicating to sequentially reallocate corresponding second index data for n vertex data in the CAM;

[0147] The packing module 24 is used for reallocating the second index data corresponding to k vertex data among the n vertex data when the number m of idle index data in the CAM is less than n, and packing the k second index data to obtain a task, where m and k are both positive integers, and k is less than or equal to m;

[0148] The working mode of the CAM is a non-overwriting mode, and the non-overwriting mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

[0149] In a possible implementation, the device further includes: a first setting module, the first setting module being configured to:

[0150] Obtain control data, which is used to indicate the task working mode;

[0151] When it is detected that the task working mode is the target granularity mode, the working mode of the CAM is set to a non-overwrite mode.

[0152] In another possible implementation, the granularity corresponding to the target granularity mode is greater than a preset value, and the granularity corresponding to the target granularity mode is used to indicate the maximum number of work item instances included in the assembled task.

[0153] In another possible implementation, the apparatus further includes: a second setting module; and the second setting module is configured to:

[0154] When it is detected that the task working mode is not the target granularity mode, the working mode of the CAM is set to an overwrite mode, where the overwrite mode is used to indicate a function of supporting input index data to overwrite the allocated index data in the CAM.

[0155] In another possible implementation, the device further includes: an allocation module; the allocation module is configured to:

[0156] When m is greater than or equal to n, the second index data corresponding to each of the n vertex data are reallocated.

[0157] In another possible implementation, the second index data is used to indicate the position of the corresponding vertex data in the vertex cache space, and the device further includes: a cache module; the cache module is used to:

[0158] Get the packaged tasks;

[0159] According to the k second index data in the task, the vertex data corresponding to each of the k second index data are stored in the vertex cache space.

[0160] In another possible implementation, the device further includes: an output module; the output module is used to:

[0161] Read k vertex data from the vertex buffer space, and obtain second index data corresponding to each of the k vertex data;

[0162] After synchronizing the k vertex data with the corresponding k second index data, the graphic element data is output, and the graphic element data includes at least one vertex data.

[0163] In another possible implementation, the device further includes: a computing module; and the computing module is configured to:

[0164] Save a target count value of each task, where the target count value is the number of unused second index data in the task and located in the vertex cache space;

[0165] When outputting the metadata, the target count value is subtracted from the usage value, where the usage value is the number of vertex data included in the metadata.

[0166] In another possible implementation, the device further includes: a releasing module; the releasing module is configured to:

[0167] When it is detected that the target count value of the task is zero, a cache release command is sent to the vertex cache space, where the cache release command is used to instruct to release the space corresponding to the task in the vertex cache space.

[0168] It should be noted that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In practical applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0169] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0170] The present disclosure also provides a computing device, which includes: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to: implement the steps executed by the GPU in the computing device in the above-mentioned various method embodiments.

[0171] The embodiments of the present disclosure further provide a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the methods in the above-mentioned various method embodiments are implemented.

[0172] Fig. 9 1 is a block diagram of an apparatus 900 for a data processing method for a GPU according to an exemplary embodiment. For example, the apparatus 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0173] Reference Fig. 9 , the device 900 may include one or more of the following components: a processing component 20 , a memory 30 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .

[0174] The processing component 20 generally controls the overall operation of the device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 20 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 20 may include one or more modules to facilitate the interaction between the processing component 20 and other components. For example, the processing component 20 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 20.

[0175] The memory 30 is configured to store various types of data to support operations on the device 900. Examples of such data include instructions for any application or method operating on the device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 30 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0176] The power supply component 906 provides power to the various components of the device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 900.

[0177] The multimedia component 908 includes a screen that provides an output interface between the device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0178] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the device 900 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 30 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.

[0179] I / O interface 912 provides an interface between processing component 20 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, start buttons, and lock buttons.

[0180] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the device 900. For example, the sensor assembly 914 can detect the open / closed state of the device 900, the relative positioning of components, such as the display and keypad of the device 900, and the sensor assembly 914 can also detect the position change of the device 900 or a component of the device 900, the presence or absence of user contact with the device 900, the orientation or acceleration / deceleration of the device 900, and the temperature change of the device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0181] The communication component 916 is configured to facilitate wired or wireless communication between the device 900 and other devices. The device 900 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0182] In an exemplary embodiment, the apparatus 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.

[0183] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 30 including computer program instructions, which can be executed by a processor 920 of the apparatus 900 to perform the above method.

[0184] Fig.10 1 is a block diagram of a device 1000 for a data processing method for a GPU according to an exemplary embodiment. For example, the device 1000 may be provided as a server. Fig.10, the apparatus 1000 includes a processing component 1022, which further includes one or more processors, and a memory resource represented by a memory 30 for storing instructions, such as an application, that can be executed by the processing component 1022. The application stored in the memory 30 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1022 is configured to execute instructions to perform the above method.

[0185] The device 1000 may also include a power supply component 1026 configured to perform power management of the device 1000, a wired or wireless network interface 1050 configured to connect the device 1000 to a network, and an input / output (I / O) interface 1058. The device 1000 may operate based on an operating system stored in the memory 30, such as Windows Server™, Mac OSX™, Unix™, Linux™, FreeBSD™ or the like.

[0186] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 30 including computer program instructions, which can be executed by the processing component 1022 of the device 1000 to perform the above method.

[0187] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0188] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0189] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0190] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0191] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0192] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0193] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0194] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0195] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A data processing method for a graphics processing unit GPU, It is characterized in that The method comprises: Obtain input primitive index data, wherein the primitive index data includes first index data corresponding to each of n vertex data in the primitive, the first index data is original index data, the vertex data and the first index data have a one-to-one correspondence, and n is a positive integer; Performing a content addressable memory CAM scan on the primitive index data, wherein the CAM scan is used to indicate to sequentially reallocate corresponding second index data for the n vertex data in the CAM, wherein the second index data is used to indicate a position of the corresponding vertex data in a vertex cache space; When the number m of idle index data in the CAM is less than n, reallocating the second index data corresponding to k vertex data among the n vertex data, and packing the k second index data to obtain a task, wherein m and k are both positive integers, and k is less than or equal to m; The working mode of the CAM is a non-overwriting mode, and the non-overwriting mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

2. The method according to claim 1, It is characterized in that Before obtaining the inputted primitive index data, the method further includes: Acquiring control data, wherein the control data is used to indicate a task working mode; When it is detected that the task working mode is the target granularity mode, the working mode of the CAM is set to the non-overwriting mode.

3. The method according to claim 2, It is characterized in that The granularity corresponding to the target granularity mode is greater than a preset value, and the granularity corresponding to the target granularity mode is used to indicate the maximum number of work item instances included in the assembled task.

4. The method according to claim 2, It is characterized in that The method further comprises: When it is detected that the task working mode is not the target granularity mode, the working mode of the CAM is set to an overwrite mode, where the overwrite mode is used to indicate a function of supporting input index data to overwrite allocated index data in the CAM.

5. The method according to claim 1, It is characterized in that The method further comprises: When m is greater than or equal to n, the second index data corresponding to each of the n vertex data are reallocated.

6. The method according to claim 1, It is characterized in that After the k second index data are packaged to obtain the task, the method further includes: Get the packaged tasks; According to the k second index data in the task, the vertex data corresponding to each of the k second index data are stored in the vertex cache space.

7. The method according to claim 6, It is characterized in that The method further comprises: Read the k vertex data from the vertex buffer space, and obtain the second index data corresponding to each of the k vertex data; After synchronizing the k vertex data with the corresponding k second index data, outputting the image data, the image data includes at least one of the vertex data.

8. The method according to claim 7, It is characterized in that The method further comprises: Saving a target count value of each of the tasks, where the target count value is the number of unused second index data in the task and located in the vertex cache space; When the primitive data are output, a usage value is subtracted from the target count value, where the usage value is the number of the vertex data included in the primitive data.

9. The method according to claim 8, It is characterized in that The method further comprises: When it is detected that the target count value of the task is zero, a cache release command is sent to the vertex cache space, where the cache release command is used to instruct to release the space corresponding to the task in the vertex cache space.

10. A data processing device for a GPU, It is characterized in that The device comprises: An acquisition module, used for acquiring input primitive index data, wherein the primitive index data includes first index data corresponding to each of n vertex data in the primitive, the first index data is original index data, the vertex data and the first index data have a one-to-one correspondence, and n is a positive integer; A scanning module, used for performing CAM scanning on the primitive index data, wherein the CAM scanning is used for indicating to sequentially reallocate corresponding second index data for the n vertex data in the CAM, wherein the second index data is used for indicating the position of the corresponding vertex data in the vertex cache space; A packing module, used for reallocating the second index data corresponding to k vertex data among the n vertex data when the number m of idle index data in the CAM is less than n, and packing the k second index data to obtain a task, wherein m and k are both positive integers, and k is less than or equal to m; The working mode of the CAM is a non-overwriting mode, and the non-overwriting mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

11. A computing device, It is characterized in that The computing device comprises: a processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to: Obtain input primitive index data, wherein the primitive index data includes first index data corresponding to each of n vertex data in the primitive, the first index data is original index data, the vertex data and the first index data have a one-to-one correspondence, and n is a positive integer; Performing a CAM scan on the primitive index data, wherein the CAM scan is used to indicate to sequentially reallocate corresponding second index data for the n vertex data in the CAM, wherein the second index data is used to indicate a position of the corresponding vertex data in a vertex cache space; When the number m of idle index data in the CAM is less than n, reallocating the second index data corresponding to k vertex data among the n vertex data, and packing the k second index data to obtain a task, wherein m and k are both positive integers, and k is less than or equal to m; The working mode of the CAM is a non-overwriting mode, and the non-overwriting mode is used to indicate that the input index data does not overwrite the allocated index data in the CAM.

12. A non-volatile computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.