A memory management device, method, and electronic device, storage medium, computer program product with multiple parallel channels
By managing the memory of multiple parallel channels through a shared target cache, the problems of wasted graphics processor cache space and low initialization efficiency are solved, thereby improving processing performance and efficiency.
Patent Information
- Application Number
- CN202511406611.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-29
AI Technical Summary
In existing technologies, the graphics processor wastes cache space and has low initialization efficiency during the screen mapping data processing stage, resulting in limited processing performance.
A multi-parallel channel memory management method is adopted, which manages the cache requests of multiple parameter stream generators by sharing a target cache, thereby improving the cache hit rate and reducing the number of data interactions with external storage devices.
It improves the processing performance and initialization efficiency of the graphics processor, and reduces cache space waste and latency.
Smart Images

Figure CN120876202B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of graphics processor, and particularly relates to a memory management device and method of multiple parallel channels, an electronic device, a storage medium and a computer program product. BACKGROUND
[0002] In order to improve the processing speed of a graphics processing unit (GPU) in a screen mapping data processing stage, a multiple parallel pipeline (Tiling Pipe, TP) is usually designed in the prior art, and a tile pointer cache (TPC) is designed for each TP for data storage, so as to realize parallel generation of a control stream. However, since the TPCs corresponding to each TP are independent of each other, multiple initializations are required when initializing the cache lines of each TPC, and the initialization efficiency is low. Moreover, when the effective screen size is small and the number of tiles is small, the actual cache space required for data generation is also small, while the size of the cache space corresponding to each TPC is fixed, and a large amount of cache space is wasted. SUMMARY
[0003] Therefore, the present disclosure provides a memory management device and method of multiple parallel channels, an electronic device, a storage medium and a computer program product.
[0004] According to an aspect of the present disclosure, a memory management device of multiple parallel channels is provided, comprising: a plurality of parameter stream generators, and a target cache shared by the plurality of parameter stream generators; and any one parameter stream generator, configured to send a data read request to the target cache, wherein the data read request is used to obtain reference data corresponding to an effective tile currently required to be processed by the parameter stream generator; and the target cache, configured to determine the reference data corresponding to the effective tile currently required to be processed by the parameter stream generator in response to the data read request of any one parameter stream generator, and return to the parameter stream generator.
[0005] In a possible implementation, the target cache includes at least one cache line, and the cache line is used to cache reference data of N tile groups in the to-be-processed screen; wherein N is a positive integer, and the value of N is determined based on one or more of the size of the to-be-processed screen, the number of effective tiles and the position distribution, and the number of tiles included in each tile group is determined according to the number of parameter stream generators sharing the target cache.
[0006] In a possible implementation, the at least one cache line includes N primitive groups that are adjacent in the to-be-processed screen.
[0007] In a possible implementation, a data reading request of any one parameter stream generator includes primitive coordinates of valid primitives that the parameter stream generator currently needs to process in the to-be-processed screen; and the target cache is configured to: determine reference data corresponding to the valid primitives that each parameter stream generator currently needs to process according to the primitive coordinates of the valid primitives that each parameter stream generator currently needs to process.
[0008] In a possible implementation, the target cache is configured to: in a case where the primitive coordinates of the valid primitives that the at least two parameter stream generators currently need to process belong to the same primitive group, perform cache lookup according to the cache line identifier corresponding to the primitive group, and determine the cache lookup result.
[0009] In a possible implementation, the target cache is configured to: in a case where the cache lookup result is cache miss, read reference data of the primitive group from an external storage device according to the cache line identifier corresponding to the primitive group, and write the reference data into a cache line.
[0010] In a possible implementation, the target cache is configured to: according to the primitive coordinates of the valid primitives that the at least two parameter stream generators currently need to process, determine, in the reference data of the primitive group, reference data corresponding to the valid primitives that each parameter stream generator of the at least two parameter stream generators currently needs to process, and return to the corresponding parameter stream generator.
[0011] In a possible implementation, the target cache is configured to: in a case where the primitive coordinates of the valid primitives that the at least two parameter stream generators currently need to process do not belong to the same primitive group, determine, according to the primitive coordinates of the valid primitives that each parameter stream generator of the at least two parameter stream generators currently needs to process, a cache line identifier corresponding to a primitive group to which the valid primitives that each parameter stream generator of the at least two parameter stream generators currently needs to process belong.
[0012] In a possible implementation, the target cache is configured to: according to the cache line identifier corresponding to the primitive group to which the valid primitives that each parameter stream generator of the at least two parameter stream generators currently needs to process belong, perform cache lookup, and determine the cache lookup result of each parameter stream generator of the at least two parameter stream generators.
[0013] In a possible implementation, the target cache is configured to: for any one cache-missed parameter stream generator, read reference data of a primitive group to which a valid primitive currently required to be processed by the parameter stream generator belongs from the external storage device according to a cache line identifier corresponding to the primitive group, and write the reference data into one cache line; and determine reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator in the reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator belongs according to a primitive coordinate of the valid primitive currently required to be processed by the parameter stream generator, and return the reference data to the parameter stream generator.
[0014] In a possible implementation, the target cache is configured to: in a case where there are multiple cache-missed parameter stream generators, determine a data reading sequence for reading reference data of a primitive group to which a valid primitive currently required to be processed by each cache-missed parameter stream generator belongs from the external storage device according to a cache line identifier size corresponding to the primitive group.
[0015] In a possible implementation, any one parameter stream generator is further configured to: perform primitive mapping data compression on the valid primitive currently required to be processed by the parameter stream generator according to reference data corresponding to the valid primitive.
[0016] According to another aspect of the present disclosure, a multi-parallel-channel memory management method is provided, which is applied to a multi-parallel-channel memory management apparatus, the memory management apparatus includes a plurality of parameter stream generators, and a target cache shared by the plurality of parameter stream generators; the method includes: any one parameter stream generator sending a data reading request to the target cache, where the data reading request is used to obtain reference data corresponding to a valid primitive currently required to be processed by the parameter stream generator; and the target cache determining target reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator in response to the data reading request of any one parameter stream generator, and returning the target reference data to the parameter stream generator.
[0017] According to another aspect of the present disclosure, an electronic device is provided, which includes the multi-parallel-channel memory management apparatus.
[0018] According to another aspect of the present disclosure, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement steps of the above method.
[0019] According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the above method.
[0020] According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program, or a non-transitory computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above method.
[0021] The memory management device of the multi-parallel channel according to the embodiments of the present disclosure can send a data read request to the target cache to obtain the reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator. By setting the target cache to be shared by all parameter stream generators, the target cache can respond to the data read request of any parameter stream generator to determine the reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator, and return to the parameter stream generator, thereby realizing unified cache management, improving the overall hit rate of data read requests of all parameter stream generators, reducing the number of data interactions between the memory management device and the external storage device, reducing the delay in the primitive mapping data processing process, and improving the processing performance of the memory management device and each parameter stream generator.
[0022] Other features and aspects of the present disclosure will become apparent from the following detailed description of example embodiments, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate example embodiments, features, and aspects of the present disclosure and serve to explain the principles of the present disclosure.
[0024] Figure 1 A structural schematic diagram of a multi-parallel channel circuit in the prior art is shown.
[0025] Figure 2 A principle schematic diagram of a multi-parallel channel circuit in the prior art is shown.
[0026] Figure 3 A structural schematic diagram of a memory management device of a multi-parallel channel according to an embodiment of the present disclosure is shown.
[0027] Figure 4 A principle schematic diagram of a memory management device of a multi-parallel channel according to an embodiment of the present disclosure is shown.
[0028] Figure 5 A flow schematic diagram of a memory management method of a multi-parallel channel according to an embodiment of the present disclosure is shown.
[0029] Figure 6A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0030] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0031] As used herein, the terms “comprising,” “including,” “having,” or variations thereof are open-ended and include one or more of the stated features, integrals, elements, steps, components, or functions, but do not exclude the presence or addition of one or more other features, integrals, elements, steps, components, functions, or groups thereof.
[0032] When an element is referred to as “connected,” “coupled,” “responding,” or a variation thereof relative to another element, it may be directly connected, coupled, or responding to another element, or there may be an intermediate element present.
[0033] Although the terms first, second, third, etc., may be used herein to describe various elements / operations, these elements / operations should not be limited by these terms. These terms are only used to distinguish one element / operation from another. Therefore, without departing from the teachings of the inventive concept, a first element / operation in some embodiments may be referred to as a second element / operation in other embodiments.
[0034] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0035] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0036] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0037] For the screen mapping data processing stage of a graphics processing unit (GPU), after the primitive block (PB) screen mapping processing is completed, all generated primitive mapping data (PB-Tiles) need to be compressed, and the control stream data (Control Stream) corresponding to each primitive (tile) is generated and output. In the process of primitive mapping data processing, a cache on-chip cache is usually needed to temporarily store the intermediate data frequently read and written by the Control Stream corresponding to each tile. In the case of cache full or read / write request miss to the cache, the data stored in the cache needs to be flushed and loaded, and the data read / write interaction is performed with the off-chip storage device through the BIF bus (Bus Interface Function) to update the storage data of the cache. On the other hand, when starting the mapping data processing task, the memory of the off-chip storage device also needs to be initialized before the normal data processing can be performed. In the case of a larger cache size, the number of data interactions between the cache and the off-chip storage device can be reduced, and the waiting delay of data interaction can be reduced, thereby improving the processing performance of the GPU; however, if the size of the cache is too large, a large on-chip area will be sacrificed. Therefore, the cache needs to be designed by considering the area occupation and processing performance, which increases the design difficulty.
[0038] In the prior art, in order to improve the generation speed of the Control Stream, a plurality of parallel pipelines (Tiling Pipe, TP) are usually designed, and a cache (Tile Pointer Cache, TPC) is designed for each TP for data temporary storage, thereby realizing parallel generation of the Control Stream.
[0039] Figure 1 An existing multi-parallel channel circuit structure schematic diagram is shown. As shown in Figure 1 , the circuit 100 includes four pipelines independent of each other, which are pipeline 0, pipeline 1, pipeline 2 and pipeline 3; each pipeline is connected with an arbiter (ARB), and can access the external storage device through the BIF bus. Each pipeline includes a parameter stream generator (Parameter Stream Generator, PSG) and a cache.
[0040] Figure 2 A schematic diagram of a multi-parallel channel circuit in the prior art is shown. For example... Figure 2 As shown in (a), the screen to be processed is divided into 8×4=32 primitives, where gray squares are valid primitives and white squares are invalid primitives. Each primitive has corresponding primitive coordinates, which indicate the position of each primitive in the screen to be processed. The multi-parallel channel circuit corresponding to the screen to be processed includes four pipelines, namely pipeline 0, pipeline 1, pipeline 2 and pipeline 3. The four pipelines perform primitive mapping data processing on the primitives in the screen to be processed based on preset processing rules, forming a mapping relationship between pipelines and primitives.
[0041] Specifically, the primitives corresponding to pipeline 0 include primitives (0,0), (2,0), and (0,2), etc.; the primitives corresponding to pipeline 1 include primitives (1,0), (3,0), and (1,2), etc.; the primitives corresponding to pipeline 2 include primitives (0,1), (2,1), and (0,3), etc.; and the primitives corresponding to pipeline 3 include primitives (1,1), (3,1), and (1,3), etc. Furthermore, the reference data for multiple primitives corresponding to any given pipeline is stored in the cache corresponding to that pipeline. For example... Figure 2 As shown in (b), each pipeline corresponds to a cache. Specifically, pipeline 0 corresponds to cache 0, pipeline 1 corresponds to cache 1, pipeline 2 corresponds to cache 2, and pipeline 3 corresponds to cache 3. The storage space of each cache is fixed and can store reference data corresponding to 8 primitives.
[0042] In any screen mapping process, each TP only needs to process primitive mapping data for its corresponding valid tile. Since each TP's corresponding TPC is independent, each TP's corresponding TPC needs to be allocated an independent cache space (memory cacheline). When the number of valid tiles on the screen is small and they are concentrated, this fixed allocation of memory cacheline will result in a large waste of storage resources.
[0043] Based on the above Figure 2 For example, Figure 2 As shown in (a), the screen to be processed has only four valid primitives: primitive (0,0), primitive (1,0), primitive (2,0), and primitive (3,0). In this case, since the reference data corresponding to the invalid primitives is not needed, the storage resources used to store the reference data corresponding to the invalid primitives are actually wasted.
[0044] On the other hand, when the PSG corresponding to the plurality of TPs misses the data read-write request of the TPC, the TPC corresponding to the plurality of TPs needs to send a data interaction request to the external storage device respectively to realize the data update of the cache corresponding to each TPC, and there is a large processing delay. Since the data read-write request between the PSG and the TPC is very frequent, when the size of the screen to be processed is large, each TPC needs to frequently interact with the external storage device, which limits the processing performance of each PSG and the entire GPU.
[0045] For example, as shown in the above Figure 1 For example, as shown in the above Figure 1 When each pipeline corresponding cache needs to send a data interaction request to the external storage device, 4 times of data interaction need to be performed under the control of the arbiter through the BIF bus, and there is a large processing delay, which affects the processing performance of the GPU.
[0046] Therefore, the present disclosure provides a multi-parallel channel memory management device, which can realize unified cache management, improve the overall hit rate of data read requests of all parameter stream generators, reduce the number of data interactions between the memory management device and the external storage device, reduce the delay in the primitive mapping data processing process, and improve the processing performance of the memory management device and each parameter stream generator. The multi-parallel channel memory management device provided by the present disclosure will be described in detail below.
[0047] Figure 3 A structure diagram of a multi-parallel channel memory management device according to an embodiment of the present disclosure is shown. As shown in Figure 3 The device 300 includes a plurality of parameter stream generators 3010 to 301n and a target cache 302 shared by the plurality of parameter stream generators. Different parameter stream generators belong to different pipelines.
[0048] Any one parameter stream generator 301i (i is any value in 0 to n) is configured to send a data read request to the target cache 302, wherein the data read request is used to obtain reference data corresponding to an effective primitive currently needed to be processed by the parameter stream generator 301i.
[0049] The target cache 302 is configured to determine the reference data corresponding to the effective primitive currently needed to be processed by the parameter stream generator 301i in response to the data read request of any one parameter stream generator 301i, and return to the parameter stream generator 301i.
[0050] The to-be-processed screen can represent any type of display screen, and the specific form can be flexibly set according to actual use requirements, for example, a liquid crystal display (LCD), a light emitting diode display (LED), an organic light emitting diode display (OLED), and the like, and the present disclosure does not make specific limitations thereto.
[0051] The valid primitives corresponding to the to-be-processed screen can represent the primitives that need to be compressed in the primitive mapping data processing process performed on the to-be-processed screen. The number of valid primitives is less than or equal to the total number of primitives included in the to-be-processed screen. Correspondingly, the primitives that do not need to be compressed in the primitive mapping data processing process performed on the to-be-processed screen can be referred to as invalid primitives. The primitive mapping data processing process can represent the process of compressing the generated primitive mapping data (PB-Tiles) based on the primitive division in the to-be-processed screen after the PB screen mapping processing is completed by the GPU. The specific determination method of the primitives of the to-be-processed screen can refer to the implementation in the related art, and the present disclosure does not make specific limitations thereto.
[0052] The specific form of any one parameter stream generator can refer to the implementation in the related art, and the present disclosure does not make specific limitations thereto.
[0053] In the primitive mapping data processing process performed on the to-be-processed screen, any one parameter stream generator 301i can receive the mapping data of the valid primitive currently needing to be processed, and send a data read request to the target cache 302 according to the primitive coordinates corresponding to the valid primitive currently needing to be processed by the parameter stream generator 301i, to obtain the reference data corresponding to the valid primitive currently needing to be processed by the parameter stream generator 301i from the target cache 302. The specific form of the mapping data of the valid primitive currently needing to be processed received by any one parameter stream generator 301i can refer to the implementation in the related art, and the present disclosure does not make specific limitations thereto.
[0054] The specific form and content of the data read request sent by any one parameter stream generator 301i to the target cache 302 can be flexibly set according to actual use requirements, and the present disclosure does not make specific limitations thereto.
[0055] The reference data corresponding to the valid primitive currently required to be processed by any one parameter stream generator 301i can represent intermediate data required to be referenced by the control stream data generated in the process of performing primitive mapping data processing on the screen to be processed, and the specific form and content can refer to the implementation in the related art, and the present disclosure does not make a specific limitation hereon.
[0056] The target cache 302 can receive a data reading request from any one parameter stream generator 301i to implement unified cache management for all parameter stream generators, and can improve the overall hit rate of data reading requests of all parameter stream generators, thereby reducing the interaction times between the target cache and the external storage device corresponding to the apparatus 300, improving the overall processing performance of the apparatus 300 and the data processing efficiency of each parameter stream generator. The specific form of the target cache 302 can be flexibly set according to actual use requirements, and the present disclosure does not make a specific limitation hereon.
[0057] Specifically, in response to a data reading request of any one parameter stream generator 301i, the target cache 302 can determine the reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator 301i in the cache line thereof or in the external storage device corresponding to the apparatus 300, and return to the parameter stream generator 301i.
[0058] The target cache 302 and its functions will be described in detail in the following in combination with the possible implementation of the present disclosure, and thus no further description is given here.
[0059] The memory management apparatus of the multi-parallel channel according to the embodiments of the present disclosure can send a data reading request to the target cache to obtain the reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator. By setting the target cache to be shared by all parameter stream generators, the target cache can determine the reference data corresponding to the valid primitive currently required to be processed by any one parameter stream generator in response to a data reading request of the parameter stream generator, and return to the parameter stream generator, thereby implementing unified cache management, improving the overall hit rate of data reading requests of all parameter stream generators, and thereby reducing the data interaction times between the memory management apparatus and the external storage device, reducing the delay in the process of primitive mapping data processing, and improving the processing performance of the memory management apparatus and each parameter stream generator.
[0060] In one possible implementation, the target cache 302 includes at least one cache line, each cache line is used to cache reference data of N primitive groups in the screen to be processed, and the number of primitives included in each primitive group is determined according to the number of parameter stream generators sharing the target cache; wherein N is a positive integer, and the value of N is determined based on one or more of the size of the screen to be processed, the number of valid primitives, and the position distribution.
[0061] Specifically, before the processing of the primitive mapping data, the target cache 302 needs to be initialized and write data from the external storage device corresponding to the device 300 in a burst mode, so as to store the data in the target cache.
[0062] In the prior art, the TPCs corresponding to each TP are independent of each other, and therefore, the initialization processes of each TPC are also independent of each other. In the case where the number of valid primitives in the to-be-processed screen is small and the distribution of the valid primitives is concentrated, the reference data corresponding to the valid primitives may be concentrated in the caches corresponding to a small number of TPCs, and the caches corresponding to other TPCs do not store the reference data corresponding to the valid primitives. However, based on the memory management method in the prior art, the initialization processes of each TPC still need to be performed respectively, and the initialization of the caches that do not store the reference data corresponding to the valid primitives is a redundant operation, which affects the initialization efficiency.
[0063] For example, as shown in (a) of FIG. 1, the to-be-processed screen includes only four valid primitives, i.e., primitive (0, 0), primitive (1, 0), primitive (2, 0), and primitive (3, 0). As shown in (b) of FIG. 1, the reference data corresponding to the primitives (0, 0) and (2, 0) are stored in the cache 1 corresponding to the pipeline 1, and the reference data corresponding to the primitives (1, 0) and (3, 0) are stored in the cache 2 corresponding to the pipeline 2. Although the cache 3 corresponding to the pipeline 3 and the cache 4 corresponding to the pipeline 4 do not store any reference data corresponding to valid primitives, the initialization processes of the two caches still need to be performed. Figure 2 Figure 2 Figure 2
[0064] In the embodiments of the present disclosure, the target cache 302 can flexibly configure the number of cache lines and the number of reference data of primitive groups stored in each cache line according to the storage performance (for example, the available storage size) of the target cache 302 itself and the number and position distribution of the valid primitives included in the to-be-processed screen. The primitive group is determined based on the number of parameter stream generators (the value of n) in the device 300 and a preset processing rule, and the specific form thereof can be flexibly set according to actual use requirements, which is not limited in the present disclosure. The number of primitives included in each primitive group is determined according to the number of parameter stream generators sharing the target cache.
[0065] In the case that the number of valid primitives in the to-be-processed screen is small and the distribution is concentrated, the target cache 302 can only determine a small number of cache lines and store the reference data corresponding to the valid primitives in the cache lines, so that the initialization processing can be performed only on the reference data corresponding to the valid primitives, the amount of data for the initialization processing can be effectively reduced, and since only one shared target cache is provided, the reference data corresponding to the valid primitives can be written into the target cache only once, the initialization efficiency is improved.
[0066] Figure 4 A principle schematic diagram of a multi-parallel-channel memory management apparatus according to an embodiment of the present disclosure is shown. Figure 4 As shown in (a) in FIG. 1, the to-be-processed screen is divided into 8×4=32 primitives, wherein the gray squares are valid primitives and the white squares are invalid primitives, each primitive has a corresponding primitive coordinate for indicating the position of each primitive in the to-be-processed screen; the valid primitives corresponding to the to-be-processed screen are only primitives (0, 0), (1, 0), (2, 0) and (3, 0).
[0067] The to-be-processed screen corresponds to four pipelines, namely pipeline 0, pipeline 1, pipeline 2 and pipeline 3, and each pipeline includes a corresponding parameter stream generator 301i. The four pipelines perform primitive preset data processing on the primitives in the to-be-processed screen based on a preset processing rule, to form a mapping relationship between the pipelines and the primitives, the primitives corresponding to pipeline 0 include primitives (0, 0), (2, 0), (4, 0) and the like, the primitives corresponding to pipeline 1 include primitives (1, 0), (3, 0), (1, 2) and the like, the primitives corresponding to pipeline 2 include primitives (0, 1), (2, 1), (0, 3) and the like, and the primitives corresponding to pipeline 3 include primitives (1, 1), (3, 1), (1, 3) and the like.
[0068] Based on the mapping relationship between the pipelines and the primitives, the primitives in the to-be-processed screen can be divided into a plurality of primitive groups, specifically, primitives (0, 0), (1, 0), (0, 1) and (1, 1) form a primitive group, primitives (2, 0), (3, 0), (2, 1) and (3, 1) form a primitive group, and the like.
[0069] According to the data amount of the reference data corresponding to each primitive group, the total data amount of the reference data of the primitive group including the valid primitives can be determined; in combination with the data amount that can be cached by one cache line in the target cache 302, the number of cache lines that need to be set in the target cache 302 can be determined. In a case where the total data amount of the reference data of the primitive group including the valid primitives is less than or equal to the data amount that can be cached by one cache line, the target cache 302 can only set one cache line; in a case where the total data amount of the reference data of the primitive group including the valid primitives is greater than the data amount that can be cached by one cache line, the target cache 302 needs to set multiple cache lines.
[0070] In a possible implementation, the N primitive groups included in the at least one cache line are adjacent in the to-be-processed screen.
[0071] For example, as shown in (a) of FIG. 1, in a case where the valid primitive (0, 0) and the valid primitive (1, 0) in the to-be-processed screen belong to the primitive group 1, the valid primitive (2, 0) and the valid primitive (3, 0) belong to the primitive group 2, the primitive group 1 and the primitive group 2 are adjacent in the to-be-processed screen, and the total data amount of the reference data corresponding to the primitive group 1 and the primitive group 2 is less than or equal to the data amount that can be cached by one cache line, the target cache 302 can only set one cache line, to be used for caching the reference data corresponding to the primitive group 1 and the primitive group 2. Figure 4 For example, as shown in (a) of FIG. 1, in a case where the valid primitive (0, 0) and the valid primitive (1, 0) in the to-be-processed screen belong to the primitive group 1, the valid primitive (2, 0) and the valid primitive (3, 0) belong to the primitive group 2, the primitive group 1 and the primitive group 2 are adjacent in the to-be-processed screen, and the total data amount of the reference data corresponding to the primitive group 1 and the primitive group 2 is less than or equal to the data amount that can be cached by one cache line, the target cache 302 can only set one cache line, to be used for caching the reference data corresponding to the primitive group 1 and the primitive group 2. Figure 4 For example, as shown in (a) of FIG. 1, in a case where the valid primitive (0, 0) and the valid primitive (1, 0) in the to-be-processed screen belong to the primitive group 1, the valid primitive (2, 0) and the valid primitive (3, 0) belong to the primitive group 2, the primitive group 1 and the primitive group 2 are adjacent in the to-be-processed screen, and the total data amount of the reference data corresponding to the primitive group 1 and the primitive group 2 is less than or equal to the data amount that can be cached by one cache line, the target cache 302 can only set one cache line, to be used for caching the reference data corresponding to the primitive group 1 and the primitive group 2.
[0072] Figure 4 For example, as shown in (a) of FIG. 1, in a case where the valid primitive (0, 0) and the valid primitive (1, 0) in the to-be-processed screen belong to the primitive group 1, the valid primitive (2, 0) and the valid primitive (3, 0) belong to the primitive group 2, the primitive group 1 and the primitive group 2 are adjacent in the to-be-processed screen, and the total data amount of the reference data corresponding to the primitive group 1 and the primitive group 2 is less than or equal to the data amount that can be cached by one cache line, the target cache 302 can only set one cache line, to be used for caching the reference data corresponding to the primitive group 1 and the primitive group 2.
[0073] In a possible implementation, the data read request of any one parameter stream generator 301i includes the primitive coordinates of the valid primitive currently needed to be processed by the parameter stream generator 301i in the to-be-processed screen; and the target cache 302 is configured to: determine the reference data corresponding to the valid primitive currently needed to be processed by each parameter stream generator, according to the primitive coordinates of the valid primitive currently needed to be processed by each parameter stream generator.
[0074] Specifically, the data read request of any one parameter stream generator 301i can include the primitive coordinates of the valid primitive currently needed to be processed by the parameter stream generator 301i in the to-be-processed screen, to ensure that the reference data corresponding to the valid primitive currently needed to be processed by the parameter stream generator 301i can be accurately determined in the target cache 302.
[0075] Due to factors such as manufacturing precision, different parameter flow generators may have performance differences, resulting in differences in the speed at which different parameter flow generators process primitive mapping data. Consequently, the valid primitives that different parameter flow generators need to process may not belong to the same primitive group.
[0076] Therefore, to improve the efficiency of subsequent cache lookups, when the target cache 302 receives data read requests from at least two parameter stream generators simultaneously, it can determine whether the valid primitives currently being processed by these parameter stream generators belong to the same primitive group based on the primitive coordinates of these valid primitives in the screen to be processed. Since any cache line in the target cache 302 can cache reference data for N primitive groups, when the valid primitives currently being processed by these parameter stream generators belong to the same primitive group, the target cache 302 can perform cache lookups at the primitive group granularity, improving cache lookup efficiency, and determine the reference data corresponding to the valid primitives currently being processed by each parameter stream generator based on the primitive coordinates of each valid primitive.
[0077] If it is determined that the valid primitives to be processed by the at least two parameter stream generators belong to the same primitive group, the target cache 302 can directly use the group identifier corresponding to the primitive group as a basis to perform a cache lookup within the target cache 302 at the granularity of the primitive group, and determine the cache lookup result for the primitive group. The specific form and content of the group identifier can be flexibly set according to actual usage requirements, and this disclosure does not impose specific limitations on it.
[0078] Based on the above Figure 4 For example, Figure 4 As shown in (a), the primitives (0,0), (1,0), (0,1), and (1,1) in the screen to be processed form a primitive group. The cache line identifier corresponding to the primitive group can be set to cache line 1 according to the position of the primitive group in the screen to be processed. The primitives (2,0), (3,0), (2,1), and (3,1) form a primitive group. The cache line identifier corresponding to the primitive group can also be set to cache line 1 according to the position of the primitive group in the screen to be processed, so as to indicate that the two primitive groups can be stored in the same cache line.
[0079] The specific method for cache lookup can be flexibly configured according to actual usage requirements, and this disclosure does not impose specific limitations on it.
[0080] In an example, after the target cache 302 completes the initialization process or interacts with the external storage device corresponding to the device 300 to store the reference data of N primitive groups in each cache line, the target cache 302 can determine the mapping relationship between the cache address of each primitive group in the target cache 302 and the cache line identifier corresponding to the primitive group, so that the cache address of the reference data of the primitive group can be found in the target cache 302 based on the cache line identifier corresponding to the primitive group, and the reference data of the primitive group can be obtained.
[0081] In a case where the target cache 302 simultaneously receives data read requests of at least two parameter stream generators, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators belong to the same primitive group, the cache line identifier corresponding to the primitive group can be used to quickly determine whether the reference data of the primitive group is cached in the target cache 302, so as to realize the cache search for the primitive group.
[0082] The cache search result of the primitive group can be used to indicate whether the reference data of the primitive group is cached in the target cache 302, and the specific form and content thereof can be flexibly set according to actual use requirements.
[0083] In a case where the target cache 302 simultaneously receives data read requests of at least two parameter stream generators, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators belong to the same primitive group, and the cache search determines that the reference data of the primitive group is cached in the target cache 302, the target cache 302 can determine that the cache search result for the primitive group is a cache hit, that is, the reference data of the primitive group is cached in the target cache 302, so that the reference data of the primitive group can be directly obtained in the target cache 302.
[0084] In a case where the target cache 302 simultaneously receives data read requests of at least two parameter stream generators, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators belong to the same primitive group, and the cache search determines that the reference data of the primitive group is not cached in the target cache 302, the target cache 302 can determine that the cache search result for the primitive group is a cache miss, and at this time, the target cache 302 needs to interact with the external storage device corresponding to the device 300 to obtain the reference data of the primitive group.
[0085] In a case that the target cache 302 simultaneously receives data read requests of at least two parameter stream generators, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators belong to the same primitive group, and the cache lookup result for the primitive group is cache hit, the target cache 302 can directly determine the reference data of the primitive group, and determine the reference data corresponding to the valid primitive currently required to be processed by each of the at least two parameter stream generators in the reference data of the primitive group according to the primitive coordinates of the valid primitive currently required to be processed by each of the at least two parameter stream generators, and then return the reference data corresponding to the valid primitive currently required to be processed by each of the at least two parameter stream generators to the corresponding parameter stream generator.
[0086] The specific method in which the target cache 302 returns the reference data corresponding to the valid primitive currently required to be processed by any one parameter stream generator 301i can refer to the implementation manner in the related art, and the present disclosure does not make a specific limitation thereon.
[0087] Through the above process, the target cache 302 can perform cache lookup in the granularity of a primitive group, which can improve the efficiency of cache lookup, and thus improve the overall processing performance of the apparatus 300, compared with the case of performing cache lookup on the reference data corresponding to the valid primitive currently required to be processed by each parameter stream generator respectively in the prior art.
[0088] In a possible implementation manner, the target cache 302 is configured to, in a case that the cache lookup result is cache miss, read the reference data of the primitive group from the external storage apparatus according to the cache line identifier corresponding to the primitive group, and write the reference data into one cache line.
[0089] In a case that the target cache 302 simultaneously receives data read requests of at least two parameter stream generators, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators belong to the same primitive group, and the cache lookup result for the primitive group is cache miss, the target cache 302 can read the reference data of the primitive group from the external storage apparatus corresponding to the apparatus 300 according to the cache line identifier corresponding to the primitive group, and write the reference data of the primitive group into one cache line; compared with the data read-write method in which the reference data corresponding to the valid primitive currently required to be processed by each parameter stream generator is written into the cache line corresponding to each parameter stream generator respectively in the prior art, the data interaction times between the target cache 302 and the external storage apparatus corresponding to the apparatus 300 can be effectively reduced, the delay caused by data interaction can be reduced, and thus the overall processing performance of the apparatus 300 can be improved.
[0090] The above Figure 2 For example, as Figure 2As shown in (a), the only valid primitives corresponding to the screen to be processed are primitives (0,0), (1,0), (2,0), and (3,0). Figure 2 As shown in (b), each pipeline corresponds to a cache. Specifically, pipeline 0 corresponds to cache 0, pipeline 1 corresponds to cache 1, pipeline 2 corresponds to cache 2, and pipeline 3 corresponds to cache 3. The storage space of each cache is fixed and can store reference data corresponding to 8 primitives.
[0091] If, during a primitive mapping data processing step, the PSG corresponding to pipeline 0 needs to read the reference data primitive corresponding to primitive (2,0), and the PSG corresponding to pipeline 1 needs to read the reference data corresponding to primitive (3,0), but cache 0 does not cache the reference data corresponding to primitive (2,0), and cache 1 does not cache the reference data corresponding to primitive (3,0), then the TPCs corresponding to cache 0 and cache 1 need to interact with the external storage device separately. In other words, two data interactions are required to meet the usage requirements of the PSGs corresponding to pipeline 0 and pipeline 1, resulting in significant latency and limiting the processing performance of the PSGs corresponding to pipeline 0 and pipeline 1.
[0092] Based on the above Figure 4 For example, Figure 4 As shown in (a), the only valid primitives corresponding to the screen to be processed are primitives (0,0), (1,0), (2,0), and (3,0). Figure 4 As shown in (b), target cache 302 has one and only one cache line.
[0093] If, during a primitive mapping data processing step, the parameter stream generator 3010 corresponding to pipeline 0 needs to read the reference data primitive corresponding to primitive (2,0), and the parameter stream generator 3011 corresponding to pipeline 1 needs to read the reference data corresponding to primitive (3,0), but at this time the cache line of the target cache 302 does not cache the reference data corresponding to primitive (2,0) and primitive (3,0), since primitive (2,0) and primitive (3,0) both belong to primitive group 2, the target cache 302 only needs to perform one data interaction with the external storage device corresponding to device 300 to write the reference data corresponding to primitive group 2. This can simultaneously satisfy the usage requirements of the parameter stream generator 3010 corresponding to pipeline 0 and the parameter stream generator 3011 corresponding to pipeline 1, effectively reducing the latency of data interaction and improving the processing performance of the parameter stream generator 3010 and the parameter stream generator 3011.
[0094] In a possible implementation, the target cache 302 is configured to: in a case where it is determined that the valid primitives currently required to be processed by the at least two parameter stream generators do not belong to the same primitive group, determine, according to the primitive coordinates of the valid primitives currently required to be processed by each of the at least two parameter stream generators, the cache line identifier corresponding to the primitive group to which the valid primitives currently required to be processed by each of the at least two parameter stream generators belong, respectively.
[0095] In a case where the target cache 302 simultaneously receives the data read requests of the at least two parameter stream generators, and it is determined that the valid primitives currently required to be processed by the at least two parameter stream generators do not belong to the same primitive group, the target cache 302 needs to perform cache lookup on the reference data corresponding to the valid primitives currently required to be processed by each of the at least two parameter stream generators, respectively.
[0096] In this case, the target cache 302 can first determine, according to the primitive coordinates of the valid primitives currently required to be processed by each of the at least two parameter stream generators, the cache line identifier corresponding to the primitive group to which the valid primitives currently required to be processed by each of the at least two parameter stream generators belong, respectively, and then perform cache lookup in the granularity of the primitive group to determine the cache lookup result for each of the at least two parameter stream generators, thereby improving the efficiency of cache lookup and determining whether the reference data corresponding to the valid primitives currently required to be processed by any one of the at least two parameter stream generators is cached in the target cache 302.
[0097] In a possible implementation, the target cache 302 is configured to: perform cache lookup according to the cache line identifier of the primitive group to which the valid primitives currently required to be processed by each of the at least two parameter stream generators belong, and determine the cache lookup result for each of the at least two parameter stream generators, respectively.
[0098] In a case where the target cache 302 simultaneously receives the data read requests of the at least two parameter stream generators, and it is determined that the valid primitives currently required to be processed by the at least two parameter stream generators do not belong to the same primitive group, and in a case where, for any one of the at least two parameter stream generators, the cache lookup determines that the reference data of the primitive group to which the valid primitives currently required to be processed by the parameter stream generator belong is cached in the target cache 302, the target cache 302 can determine that the cache lookup result for the parameter stream generator is a cache hit, and directly determine the reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator.
[0099] In a case that the target cache 302 receives data read requests of at least two parameter stream generators at the same time, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators do not belong to the same primitive group, and in a case that the cache lookup of any one of the at least two parameter stream generators determines that the target cache 302 does not cache the reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator belongs, the target cache 302 can determine that the cache lookup result of the parameter stream generator is a cache miss, and at this time, the target cache 302 needs to interact with the external storage device corresponding to the device 300 to obtain the reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator belongs.
[0100] In a case that the target cache 302 receives data read requests of at least two parameter stream generators at the same time, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators do not belong to the same primitive group, and the cache lookup result of any one of the at least two parameter stream generators is a cache hit, for the parameter stream generator with the cache hit, the target cache 302 can determine the reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator with the cache hit belongs in the cache line of the target cache 302 according to the cache line identifier corresponding to the primitive group to which the valid primitive currently required to be processed by the parameter stream generator with the cache hit belongs; and directly determine the reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator with the cache hit based on the primitive coordinates of the valid primitive currently required to be processed by the parameter stream generator with the cache hit, and return the reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator with the cache hit to the parameter stream generator with the cache hit.
[0101] Correspondingly, in a case that the target cache 302 receives only the data read request corresponding to one parameter stream generator 301i, the reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator 301i can also be determined according to the above process, and details are not described herein.
[0102] In a possible implementation, the target cache 302 is configured to: for any one parameter stream generator with a cache miss, read the reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator belongs from the external storage device according to the cache line identifier corresponding to the primitive group to which the valid primitive currently required to be processed by the parameter stream generator belongs, and write the reference data into one cache line; and determine the reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator in the reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator belongs according to the primitive coordinates of the valid primitive currently required to be processed by the parameter stream generator, and return the reference data to the parameter stream generator.
[0103] In a case that the target cache 302 simultaneously receives data read requests of at least two parameter stream generators, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators do not belong to the same primitive group, and the cache lookup result of any one of the at least two parameter stream generators is cache miss, the target cache 302 can read, for the parameter stream generator with cache miss, reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator with cache miss belongs from the external storage device corresponding to the device 300 according to the cache line identifier corresponding to the primitive group to which the valid primitive currently required to be processed by the parameter stream generator with cache miss belongs, and write the reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator with cache miss belongs into a cache line for subsequent data taking.
[0104] The target cache 302 can directly determine, in the reference data of the primitive group to which the valid primitive currently required to be processed by the parameter stream generator with cache miss belongs, reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator with cache miss according to the primitive coordinates of the valid primitive currently required to be processed by the parameter stream generator with cache miss, and return to the parameter stream generator with cache miss.
[0105] In a possible implementation, the target cache 302 is configured to: in a case that there are multiple parameter stream generators with cache miss, determine a data read order of reading reference data of the primitive group to which the valid primitive currently required to be processed by each parameter stream generator with cache miss belongs from the external storage device according to the cache line identifier size corresponding to the primitive group to which the valid primitive currently required to be processed by each parameter stream generator with cache miss belongs.
[0106] In a case that the target cache 302 simultaneously receives data read requests of at least two parameter stream generators, and determines that the valid primitives currently required to be processed by the at least two parameter stream generators do not belong to the same primitive group, and there are multiple parameter stream generators with cache miss in the at least two parameter stream generators, the target cache 302 can determine a data read order of reading reference data of the primitive group to which the valid primitive currently required to be processed by each parameter stream generator with cache miss belongs from the external storage device according to the cache line identifier size corresponding to the primitive group to which the valid primitive currently required to be processed by each parameter stream generator with cache miss belongs, and write, based on the data read order, reference data of the primitive group to which the valid primitive currently required to be processed by each parameter stream generator with cache miss belongs from the external storage device corresponding to the device 300 in sequence.
[0107] The specific form of the data reading sequence can be flexibly set according to actual use requirements, for example, the group identifier can be set in the order from small to large, or the group identifier can be set in the order from large to small, and the present disclosure does not make a specific limitation in this regard.
[0108] In a possible implementation, the any one parameter stream generator 301i is further configured to perform primitive mapping data compression on the valid primitive currently required to be processed by the parameter stream generator 301i according to the reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator 301i.
[0109] Specifically, in the case that the any one parameter stream generator 301i receives the reference data corresponding to the valid primitive currently required to be processed, the mapping data corresponding to the valid primitive currently required to be processed by the parameter stream generator 301i can be compressed according to the reference data corresponding to the valid primitive currently required to be processed by the parameter stream generator 301i, to determine the control flow data corresponding to the current primitive mapping data processing process of the valid primitive currently required to be processed by the parameter stream generator 301i.
[0110] The specific method of primitive mapping data compression can refer to the implementation in the related art, and the present disclosure does not make a specific limitation in this regard.
[0111] After the any one parameter stream generator 301i generates the control flow data corresponding to the current primitive mapping data processing process of the valid primitive currently required to be processed, the control flow data generated in the current primitive mapping data processing and the new intermediate data can be output and cached in the corresponding position in the target cache 302 for use in the next primitive mapping data processing process. The caching position of the new data in the target cache 302 can refer to the implementation in the related art, and depends on the actual situation of the next primitive mapping processing process, and the present disclosure does not make a specific limitation in this regard.
[0112] The memory management device of the plurality of parallel channels can send a data read request to the target cache to obtain reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator. By setting the target cache to be shared by all parameter stream generators, the target cache can respond to the data read request of any parameter stream generator to determine the reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator, and return to the parameter stream generator, thereby achieving unified cache management, improving the overall hit rate of data read requests of all parameter stream generators, reducing the number of data interactions between the memory management device and the external storage device, reducing the delay in the primitive mapping data processing process, and improving the processing performance of the memory management device and each parameter stream generator. Further, the target cache can also flexibly allocate the size of the storage space according to the number and position of the valid primitives in the to-be-processed screen, effectively reducing the waste of storage resources, and improving the efficiency of the initialization process.
[0113] It should be noted that although the memory management device of the plurality of parallel channels is described above as an example, those skilled in the art can understand that the present disclosure should not be limited thereto. In fact, users can completely set the element composition and structure of the memory management device of the plurality of parallel channels according to personal preferences and / or actual application scenarios, as long as the unified cache management can be achieved based on the above principles, and the processing performance of the memory management device and each parameter stream generator can be improved. That is. Figure 1
[0114] In addition, according to another aspect of the present disclosure, a memory management method of a plurality of parallel channels is provided, which is applied to a memory management device of a plurality of parallel channels, and the memory management device includes a plurality of parameter stream generators and a target cache shared by the plurality of parameter stream generators.
[0115] Figure 5 A flowchart of a memory management method of a plurality of parallel channels according to an embodiment of the present disclosure is shown. As shown in Figure 5 The method includes:
[0116] In step S501, any parameter stream generator sends a data read request to the target cache, wherein the data read request is used to obtain reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator.
[0117] In step S502, the target cache responds to the data read request of any parameter stream generator to determine the target reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator, and returns to the parameter stream generator.
[0118] In a possible implementation, the target cache includes at least one cache line, each cache line is configured to cache reference data of N primitive groups in the to-be-processed screen, and the number of primitives included in each primitive group is determined according to the number of parameter stream generators sharing the target cache; wherein N is a positive integer, and the value of N is determined based on one or more of the size of the to-be-processed screen, the number of valid primitives, and the position distribution.
[0119] In a possible implementation, the N primitive groups included in the at least one cache line are adjacent in the to-be-processed screen.
[0120] In a possible implementation, the data read request of any one parameter stream generator includes the primitive coordinates of the valid primitive currently required to be processed by the parameter stream generator in the to-be-processed screen; and the target cache determines the reference data corresponding to the valid primitive currently required to be processed by each parameter stream generator according to the primitive coordinates of the valid primitive currently required to be processed by each parameter stream generator.
[0121] In a possible implementation, the method further includes: in a case where the primitive coordinates of the valid primitives currently required to be processed by the at least two parameter stream generators belong to the same primitive group, performing cache lookup according to the cache line identifier corresponding to the primitive group to determine a cache lookup result.
[0122] In a possible implementation, the method further includes: in a case where the cache lookup result is cache miss, reading the reference data of the primitive group from an external storage device according to the cache line identifier corresponding to the primitive group, and writing the reference data into a cache line.
[0123] In a possible implementation, the target cache determines the reference data corresponding to the valid primitive currently required to be processed by each parameter stream generator according to the primitive coordinates of the valid primitive currently required to be processed by each parameter stream generator, including: according to the primitive coordinates of the valid primitives currently required to be processed by the at least two parameter stream generators, determining, in the reference data of the primitive group, the reference data corresponding to the valid primitive currently required to be processed by each parameter stream generator in the at least two parameter stream generators, and returning to the corresponding parameter stream generator.
[0124] In a possible implementation, according to the cache lookup result, the reference data corresponding to the valid primitives currently required to be processed by each of the at least two parameter stream generators is determined and returned to the corresponding parameter stream generator, including: for any one of the at least two parameter stream generators that hits the cache, according to the primitive coordinates of the valid primitives currently required to be processed by the parameter stream generator that hits the cache, the reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator that hits the cache is determined in the reference data of the primitive group to which the valid primitives currently required to be processed by the parameter stream generator that hits the cache belong, and is returned to the parameter stream generator that hits the cache.
[0125] In a possible implementation, the target cache determines the reference data corresponding to the valid primitives currently required to be processed by each of the parameter stream generators according to the primitive coordinates of the valid primitives currently required to be processed by each of the parameter stream generators, including: for any one of the parameter stream generators that misses the cache, according to the cache line identifier corresponding to the primitive group to which the valid primitives currently required to be processed by the parameter stream generator belong, the reference data of the primitive group to which the valid primitives currently required to be processed by the parameter stream generator belong is read from the external storage device and written into a cache line; and according to the primitive coordinates of the valid primitives currently required to be processed by the parameter stream generator, the reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator is determined in the reference data of the primitive group to which the valid primitives currently required to be processed by the parameter stream generator belong, and is returned to the parameter stream generator.
[0126] In a possible implementation, for any one of the parameter stream generators that misses the cache, the reference data of the primitive group to which the valid primitives currently required to be processed by the parameter stream generator belong is read from the external storage device and written into a cache line according to the cache line identifier corresponding to the primitive group to which the valid primitives currently required to be processed by the parameter stream generator belong: in the case that there are a plurality of parameter stream generators that miss the cache, the data reading order of reading the reference data of the primitive group to which the valid primitives currently required to be processed by each of the parameter stream generators that miss the cache belong from the external storage device is determined according to the cache line identifier size corresponding to the primitive group to which the valid primitives currently required to be processed by each of the parameter stream generators that miss the cache belong.
[0127] In a possible implementation, the method further includes: performing primitive mapping data compression on the valid primitives currently required to be processed by the parameter stream generator according to the reference data corresponding to the valid primitives currently required to be processed by the parameter stream generator.
[0128] The embodiments of the present disclosure further provide an electronic device including the memory management device with multiple parallel channels.
[0129] The embodiment of the present disclosure further provides an electronic device, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to realize the steps of the above method.
[0130] The embodiment of the present disclosure further provides a non-volatile computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to realize the steps of the above method.
[0131] The embodiment of the present disclosure further provides a computer program product, comprising a computer program or a non-volatile computer readable storage medium carrying the computer program, wherein the computer program is executed by a processor to realize the steps of the above method.
[0132] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. For example, the apparatus 1900 can be provided as a server or a terminal device. Referring to Figure 6 , the apparatus 1900 comprises a processing component 1922, which further comprises one or more processors, and a memory resource represented by a memory 1932, for storing instructions executable by the processing component 1922, such as an application program. The application program stored in the memory 1932 can comprise one or more than one module each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute the instructions to perform the above method.
[0133] The apparatus 1900 can further comprise a power supply component 1926 configured to perform power management of the apparatus 1900, a wired or wireless network interface 1950 configured to connect the apparatus 1900 to a network, and an input output interface 1958 (I / O interface). The apparatus 1900 can operate based on an operating system stored in the memory 1932, such as Windows Server TM , MacOS X TM , Unix TM , Linux TM , FreeBSD TM or the like.
[0134] In an exemplary embodiment, a non-volatile computer readable storage medium, such as the memory 1932 comprising computer program instructions, is also provided, wherein the above computer program instructions can be executed by the processing component 1922 of the apparatus 1900 to complete the above method.
[0135] Computer readable storage media can be tangible storage media which can retain and store instructions for use by an instruction execution device. Computer readable storage media can be, for example, but is not limited to, an electronic 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 (a non-exhaustive list) of computer readable storage media include the following: a portable computer diskette, 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 disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
[0136] Computer programs (or computer readable program instructions) described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device from a network, for example, the Internet, a local area network, a wide area network, and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.
[0137] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.
[0138] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0139] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0140] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0141] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0142] Embodiments of the present disclosure have been described above, and the description is intended to be illustrative, and not restrictive, of the disclosed embodiments. Many modifications and variations of the described embodiments are possible, and all such modifications and variations are intended to be within the scope of the described embodiments. The description used herein is intended to best explain the principles of the various embodiments, the practical application, and the best mode of using the present disclosure, and to enable others skilled in the art to understand the disclosure, various embodiments, and the application, devices, and apparatuses.
Claims
1. A memory management device with multiple parallel channels, characterized in that, The apparatus includes: a plurality of parameter stream generators, and a target cache shared by the plurality of parameter stream generators; Any parameter stream generator is used to send a data read request to the target cache, wherein the data read request is used to obtain the reference data corresponding to the valid primitives that the parameter stream generator needs to process at present; The target cache is used to respond to a data read request from any parameter stream generator, determine the reference data corresponding to the valid primitives that the parameter stream generator needs to process, and return it to the parameter stream generator. Among them, any data read request of a parameter stream generator includes the coordinates of the valid primitives that the parameter stream generator needs to process in the screen to be processed. The target cache is used for: Based on the coordinates of the valid primitives that each parameter stream generator needs to process, the reference data corresponding to the valid primitives that each parameter stream generator needs to process is determined.
2. The apparatus according to claim 1, characterized in that, The target cache includes at least one cache line, which is used to cache reference data for N primitive groups in the screen to be processed. The number of primitives included in each primitive group is determined according to the number of parameter stream generators sharing the target cache. Wherein, N is a positive integer, and the value of N is determined based on one or more of the size of the screen to be processed, the number of valid primitives, and the positional distribution.
3. The apparatus according to claim 2, characterized in that, The at least one cache line includes N groups of primitives that are adjacent in the screen to be processed.
4. The apparatus according to claim 2, characterized in that, The target cache is used for: If it is determined that the coordinates of at least two valid primitives that the current parameter stream generator needs to process belong to the same primitive group, a cache lookup is performed based on the cache line identifier corresponding to the primitive group to determine the cache lookup result.
5. The apparatus according to claim 4, characterized in that, The target cache is used for: If the cache lookup result is a cache miss, the reference data of the primitive group is read from the external storage device according to the cache line identifier corresponding to the primitive group, and written into a cache line.
6. The apparatus according to any one of claims 4 to 5, characterized in that, The target cache is used for: Based on the coordinates of the valid primitives that at least two parameter flow generators need to process, the reference data corresponding to the valid primitives that each of the at least two parameter flow generators needs to process is determined from the reference data of the primitive group, and then returned to the corresponding parameter flow generator.
7. The apparatus according to claim 2, characterized in that, The target cache is used for: If it is determined that the coordinates of the valid primitives to be processed by at least two parameter stream generators do not belong to the same primitive group, the cache line identifier corresponding to the primitive group to which the valid primitives to be processed by each of the at least two parameter stream generators belong is determined according to the coordinates of the valid primitives to be processed by each of the at least two parameter stream generators.
8. The apparatus according to claim 7, characterized in that, The target cache is used for: Based on the cache line identifier of the valid primitive to be processed by each of the at least two parameter stream generators, a cache lookup is performed to determine the cache lookup result of each of the at least two parameter stream generators.
9. The apparatus according to claim 8, characterized in that, The target cache is used for: For any parameter stream generator that has a cache miss, the reference data of the valid primitive to be processed by the parameter stream generator is read from the external storage device according to the cache line identifier of the primitive group to which the parameter stream generator belongs, and written into a cache line. Based on the coordinates of the valid primitives that the parameter flow generator needs to process, the reference data corresponding to the valid primitives that the parameter flow generator needs to process is determined from the reference data of the primitive group to which the valid primitives that the parameter flow generator needs to process belong, and then returned to the parameter flow generator.
10. The apparatus according to claim 9, characterized in that, The target cache is used for: In the case of multiple cache-missing parameter stream generators, the data reading order for reading the reference data of the valid primitive group to which each cache-missing parameter stream generator belongs is determined based on the cache line identifier size corresponding to the primitive group to which the valid primitive to be processed currently needs to be processed by each cache-missing parameter stream generator.
11. The apparatus according to any one of claims 1 to 5, characterized in that, Any parameter stream generator can also be used for: Based on the reference data corresponding to the valid primitives that the parameter stream generator needs to process, primitive mapping data compression is performed on the valid primitives that the parameter stream generator needs to process.
12. A memory management method for multiple parallel channels, characterized in that, The method is applied to a multi-parallel channel memory management device, which includes multiple parameter stream generators and a target cache shared by the multiple parameter stream generators. The method includes: Any parameter stream generator sends a data read request to the target cache, wherein the data read request is used to obtain the reference data corresponding to the valid primitives that the parameter stream generator needs to process at present; The target cache responds to a data read request from any parameter stream generator by determining the target reference data corresponding to the valid primitives that the parameter stream generator currently needs to process, and returns it to the parameter stream generator. Among them, any data read request of a parameter stream generator includes the coordinates of the valid primitives that the parameter stream generator needs to process in the screen to be processed. The target cache, in response to a data read request from any parameter stream generator, determines the target reference data corresponding to the valid primitives that the parameter stream generator currently needs to process, including: Based on the coordinates of the valid primitives that each parameter stream generator needs to process, the reference data corresponding to the valid primitives that each parameter stream generator needs to process is determined.
13. An electronic device, characterized in that, The memory management device comprising any one of claims 1 to 11.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method of claim 12.
15. A non-volatile computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method of claim 12.
16. A computer program product comprising a computer program, or a non-volatile computer-readable storage medium carrying a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method of claim 12.
Citation Information
Patent Citations
Processing unit and processing method thereof
CN106201980A
Rendering task scheduling method and device based on primitives and storage medium
CN112801855A