Data-oriented particle system task designing and scheduling method and equipment

By designing a prototype containing data area and task area for the particle system, generating directed acyclic dependency graphs and mapping them to the GPU computing task manager, the problem of low efficiency of computing resource utilization in the existing technology is solved, and cross-particles are realized The parallel processing of the system improves computing efficiency and cache utilization.

CN119292780AActive Publication Date: 2025-01-10ZHEJIANG UNIV +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411384342.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-10
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

The prior art ignores the task correlation between different particle systems in the GPU parallelization processing of particle system computing process, resulting in inefficient utilization of computing resources and reduced data storage efficiency, and lacks parallelization strategies across particle systems.

Method used

By creating a prototype containing data area and task area for each particle system, merging the data area and generating directed acyclic task dependency graphs, mapped to the GPU computing task manager for highly optimized parallel scheduling execution, using CUDA Graph optimization Parallelization of data update tasks.

Benefits of technology

It improves the computing efficiency and cache utilization of the particle system, reduces CPU-GPU communication overhead, allows GPU to intelligently manage task execution, and optimizes the memory access mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292780A_ABST
    Figure CN119292780A_ABST
Patent Text Reader

Abstract

The invention discloses a data-oriented particle system task designing and scheduling method and equipment, and the method comprises the steps: creating a particle system prototype containing a data area and a task area for each particle system, declaring attributes represented by particles as components in the data area, declaring all tasks executed by the particle system in the task area, and performing task scheduling in the task area; the task constraint of the task area has an execution sequence relationship, and each task operates at least one component; performing dependency analysis on tasks in different task stages in each task area, generating directed acyclic task dependency graphs, adding the directed acyclic task dependency graphs into a plurality of global task blocks divided according to the task stages, and merging the task dependency graphs in each global task block into a unique directed acyclic dependency graph; and merging the unique directed acyclic dependency graphs of all the global task blocks and mapping the unique directed acyclic dependency graphs to a GPU computing task manager to realize highly optimized parallel scheduling execution on the GPU, so that a memory access mode is optimized, the cache utilization rate is improved, and the computing efficiency of the particle system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of real-time rendering, and in particular relates to a data-oriented particle system task design and scheduling method and device. Background Art

[0002] In the field of real-time rendering, particle systems are an important part of the scene, and often generate a lot of overhead due to the update of a large amount of particle data. Currently, the idea of ​​GPU (Graphics Processing Unit) parallelization is used to optimize data calculation.

[0003] However, the current GPU parallel processing for particle system calculations has limitations, mainly reflected in the fact that it is limited to a single particle system class. The disadvantage of this method is that when creating multiple particle system effect classes, such as two different particle systems, the Unreal engine will independently parallelize them. This approach ignores the possible task dependencies between different particle systems, and thus fails to fully utilize the potential optimization space.

[0004] This limitation may not only lead to inefficient use of computing resources, but also fail to fully utilize cache coherence and reduce data storage efficiency. In complex scenes, collaborative optimization between multiple particle systems will become a key factor in improving rendering efficiency and computing performance. Therefore, exploring parallelization strategies across particle systems and how to effectively utilize task correlations between systems will be an important direction in the future.

[0005] In the practice of computing optimization systems, Unity's Data-Oriented Technology Stack (DOTS) is a paradigm worthy of attention. DOTS adopts the design pattern of Entity Component System (ECS) to provide innovative solutions for data storage and task description. The core advantage of this architecture lies in its data-oriented design concept. By decomposing game objects into entities, components, and systems, entities are responsible for marking data, components are responsible for storing data, and systems are responsible for performing operations on data, separating data and behavior. DOTS can organize and manage data more effectively, thereby achieving more efficient memory access and cache utilization.

[0006] The existing Unity DOTS implements a data-oriented task scheduling mechanism on the CPU side. The scheduler analyzes the dependencies between tasks, creates a task graph, and then efficiently distributes these tasks on the available CPU cores. This method is only a data storage and task scheduling strategy on the CPU, designed using the multi-core characteristics of the CPU, but lacks consideration of the parallelization of data-oriented systems on modern GPUs, and does not perform specific optimizations for the data update tasks of the particle system.

[0007] CUDA Graph is an advanced feature introduced by NVIDIA to optimize complex computing workflows on GPUs. It allows developers to organize a series of CUDA operations into a graph structure to separate definition and execution. Summary of the invention

[0008] In view of the above, the purpose of the present invention is to provide a data-oriented particle system task design and scheduling method and device, to achieve GPU parallel processing of multi-particle systems, optimize memory access mode, improve cache utilization, and thus improve the computing efficiency of the particle system.

[0009] To achieve the above-mentioned purpose of the invention, an embodiment provides a data-oriented particle system task design and scheduling method, comprising the following steps: For each particle system, create a particle system prototype containing a data area and a task area, where the data area declares the properties represented by particles in the particle system as components, merges the data areas of all particle system prototypes, and stores components globally according to the array structure. The task area declares all tasks performed by the particle system in different task stages, and the task constraints in the task area have an execution order, and each task operates on at least one component; After performing dependency parsing on the tasks of different task stages in the task area of ​​each particle system prototype and generating a directed acyclic task dependency graph, the tasks are added to multiple global task blocks divided by task stages. The task dependency graph in each global task block aims to ensure the original dependency relationship and merge as many task nodes as possible, and merge into a unique directed acyclic dependency graph corresponding to each global task block; The unique directed acyclic dependency graphs corresponding to all global task blocks are merged and mapped to the GPU computing task manager to achieve highly optimized parallel scheduling execution on the GPU.

[0010] In the present invention, tasks in the task area are divided into sequential relationships. If they read or modify the same component, the task in the back depends on the task in the front. The tasks and their dependencies in the unique directed acyclic dependency graph corresponding to all global task blocks can be directly mapped to the CUDA Graph, so that highly optimized parallel execution can be achieved on the GPU. This integration not only reduces the communication overhead between the CPU and GPU, but also allows the GPU to manage task execution more intelligently, such as overlapping calculations and memory transfers.

[0011] Preferably, the operation performed by each task on at least one component includes a read operation or a modification operation. When performing a modification operation, the component memory in the data area is modified, and part of the memory of the corresponding component in the global storage is synchronously modified.

[0012] Preferably, the global task blocks divided according to the task stages include a generation task block corresponding to the generation task stage, an update task block corresponding to the update task stage, and a rendering task block corresponding to the rendering task stage.

[0013] Preferably, each task is authorized to operate at least one component, and each task can only operate the at least one authorized component.

[0014] Preferably, when performing dependency parsing for tasks at different task stages in the task area and generating a directed acyclic task dependency graph, each node in the graph represents a task, and the edges between the nodes represent the dependency relationship between the tasks, and the graph can represent the task execution order of the particle system prototype in the task block. Define the operation set corresponding to each task to consist of authorized components. When the second task is executed after the first task, and the intersection of the authorized components in the two operation sets is not empty, the second task is considered to be dependent on the first task, and a directed edge is constructed from the node corresponding to the first task to the node corresponding to the second task.

[0015] Preferably, the task dependency graph in each global task block is merged into a unique directed acyclic dependency graph corresponding to each global task block with the goal of ensuring the original dependency relationship and merging as many task nodes as possible, including: With the goal of ensuring the original dependency and merging as many task nodes as possible, identify the same task nodes in the task dependency graph that need to be merged, and represent the same task nodes as the same task nodes in the unique directed acyclic dependency graph, while retaining the original in-edge and out-edge relationships of the task nodes. When a cycle appears in the unique directed acyclic dependency graph after the merger, undo the previous operation of merging task nodes until the cycle disappears.

[0016] Preferably, when undoing the operation of merging task nodes before, choose to split the task nodes, and the strategy for selecting the split task nodes is: only consider the edges connecting the task nodes in the ring and the new task nodes merged in the ring, and choose to split the task nodes that have only one kind of edge as the input edge and another kind of edge as the output edge; when such a task node does not exist, select the task node with a certain edge input degree of 0.

[0017] To achieve the above-mentioned purpose of the invention, an embodiment also provides a data-oriented particle system task design and scheduling device, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the above-mentioned data-oriented particle system task design and scheduling method.

[0018] To achieve the above-mentioned purpose of the invention, an embodiment further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned data-oriented particle system task design and scheduling method is implemented.

[0019] To achieve the above-mentioned purpose of the invention, an embodiment further provides a computer product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned data-oriented particle system task design and scheduling method is implemented.

[0020] Compared with the prior art, the present invention has the following beneficial effects: Through data-oriented particle system task design, data and behavior are separated. It crosses the traditional particle system category boundaries, can identify and merge the same behavior in different systems, resolve dependencies, and implement GPU parallelization of data update tasks based on CUDA Graph. By merging data and tasks from a cross-particle system perspective, the number of task scheduling of the particle system is reduced, and the scheduling logic is optimized, thereby optimizing the GPU program's access mode to memory, improving cache utilization, and ultimately improving computing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a flow chart of a data-oriented particle system task design and scheduling method provided by an embodiment; Figure 2 It is a flow chart of data updating in a data-oriented particle system task design and scheduling method provided by an embodiment; Figure 3 It is a corresponding relationship diagram of the task area, task block and particle system prototype provided by the embodiment; Figure 4 It is a schematic diagram of task merging across particle systems provided by an embodiment. DETAILED DESCRIPTION

[0023] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.

[0024] See also Figure 1 , an embodiment provides a data-oriented particle system task design and scheduling method, comprising the following steps: S1, creates a particle system prototype containing a data area and a task area for each particle system. The data area declares the properties represented by the particles in the particle system as components, merges the data areas of all particle system prototypes, and stores the components globally according to the array structure.

[0025] In the embodiment, when a user creates a new particle system type, an independent particle system prototype is created. The particle system prototype includes a data area that describes all properties of the particles it manages, and a task area that describes how to modify these properties and realize the particle system effect.

[0026] The data area stores all particles of the particle system. Particles consist of a series of different types of attributes, including position, speed, color, etc. A particle attribute of a particle system class is declared as a component in a particle system prototype.

[0027] From the user's perspective, editing the data area is just adding or reducing components to a particle system prototype; from the global data manager's perspective, it is adding or reducing components to the global data area, or adding new memory to existing components. This is because for all data areas, the global data manager will merge the same components in the data area and store them together. If the identification name and type of two components are the same, they will be regarded as the same component. After merging, the memory size is the sum of the sizes of the original two components.

[0028] In the global data manager, these components are organized into a structure that is easy for the GPU to access. Each component is stored as an array on the GPU, which is then stored in a data layout that conforms to the Struct of Array (SoA). When specific attributes need to be processed (such as only updating the positions of all particles), SoA allows continuous memory access, which is very friendly to the cache mechanism of modern CPUs and GPUs. In addition, single instruction multiple data (SIMD) operations can be more easily applied to the SoA layout because data of the same type is stored continuously. Moreover, when only some attributes need to be accessed, SoA can reduce unnecessary data transmission and improve memory bandwidth utilization, which is particularly conducive to achieving efficient coalesced memory access.

[0029] S2, the task area declares all tasks performed by the particle system in different task stages, and the task constraints in the task area have an execution order relationship, and each task operates on at least one component.

[0030] In the embodiment, the task area includes all tasks that need to be performed by the particle system in different task stages in one frame. It usually includes tasks in three stages: particle generation, particle update, and particle rendering. For example, in the particle generation task stage, the initial velocity can be given to the particles; in the particle update task stage, the color of each particle can be modified according to its life, and the particle life can be destroyed if it exceeds the life span; in the particle rendering task stage, the particle direction can be aligned with the viewing direction, etc.

[0031] Each task is an independent functional unit, which is responsible for reading or modifying one or more specific particle attributes (components). The task defines the behavior of particles at different stages. The task constraints in the task area have a clear execution order. When multiple tasks operate on the same component, a dependency relationship is formed, and the later tasks depend on the previous tasks. It should be noted that the component modified by a task is the component memory of the prototype to which it belongs, which corresponds to a part of the memory of the component in the global data manager. The specific data update process is as follows: Figure 2 As shown, the data in the global data area is read, CUDAGraph is executed to update the data, and the updated data is submitted to the particle system rendering end for rendering.

[0032] Each task clearly defines at least one component that it is authorized to access and operate, and the task can only operate at least one authorized component. The execution of the task needs to ensure the consistency and correctness of the data. This data-based task design method provides a clear structure and execution process, which is conducive to the modularization, scalability and performance optimization of the system. It is particularly suitable for complex particle systems and can better manage the behavior and properties of a large number of particles.

[0033] S3, after performing dependency parsing on tasks at different task stages in the task area of ​​each particle system prototype and generating a directed acyclic task dependency graph, adds them to multiple global task blocks divided by task stages.

[0034] In the embodiment, the task area of ​​each particle system prototype is divided into three stages, so for all particle system prototypes, they can be divided into three global task blocks according to the stages of the particle system: a generation task block corresponding to the generation task stage, an update task block corresponding to the update task stage, and a rendering task block corresponding to the rendering task stage. This division reflects the basic workflow of all particle systems in one frame, from creating their own new particles, to updating all their own particles, and then to displaying their own particles.

[0035] The corresponding relationship between task area, task block and particle system prototype is as follows: Figure 3 As shown, each global task block contains multiple particle system prototypes. Each particle system prototype corresponds to a series of tasks in a single global task block. These tasks correspond to the tasks defined in the task area of ​​this particle system prototype at the corresponding stage.

[0036] For each particle system prototype in each task block, the dependency relationship between its tasks can be represented by a directed acyclic task dependency graph (DAG). Specifically, when the tasks in different task stages in the task area are subjected to dependency analysis and the task dependency graph is generated, each node in the graph represents a task, and the edges between the nodes represent the dependency relationship between the tasks. In order to specifically illustrate the generation method of the task dependency graph, it is defined that the operation set corresponding to each task is composed of authorized components, and the operation set S2 corresponding to the second task S2 is defined as {component C1, component C2, ...}, which represents the set of components that the second task S2 will operate, and the operation set S1 corresponding to task S1 is defined as {component C1, component C3, ...}, which represents the set of components that task S1 will operate. If in the original task area, when the second task S2 is executed after the first task S1, and the intersection of the authorized components in the two operation sets is not empty, that is, the operation set S1∩operation set S2 is not equal to the empty set, then the second task S2 is considered to be dependent on the first task S1, and a directed edge is constructed from the node corresponding to the first task S1 to the node corresponding to the second task S2.

[0037] For example, in the update task area of ​​particle system 1, the original task order is defined as: {S2->S3->S4->S1}, operation set S1 = {C1}, operation set S2 = {C2, C3}, operation set S3 = {C1, C2, C4, C5}, operation set S4 = {C3, C4}. Figure 4As shown, in order to generate a task dependency graph, the table shown is first generated based on the components. Each column in the table represents a task (i.e., an operation set) for an operation component, and the order of tasks in the column is a subset of the original task order. Then, each order requirement in the table is the dependency relationship defined in the previous article, which in turn corresponds to a directed edge in the generated task dependency graph. After generating directed edges for all dependencies in the table, a directed acyclic task dependency graph of a particle system prototype in the task area can be obtained.

[0038] In addition, task node S3 points to task node S1, indicating that task S1 depends on task S3. Because the dependency relationship maintains the order of tasks, and the original task order is clear, the generated directed Figure 1 The graph structure clearly shows the execution order of tasks.

[0039] This structure based on task blocks, particle system prototypes, and directed acyclic dependency graphs corresponding to tasks provides a clear, flexible, and efficient execution framework for a single particle system. It can not only accurately express complex particle behaviors, but also provide a basis for the merging, optimization, and parallelization of subsequent tasks.

[0040] S4, the task dependency graph within each global task block is merged into a unique directed acyclic dependency graph corresponding to each global task block with the goal of ensuring the original dependency relationship and merging as many task nodes as possible.

[0041] In the embodiment, for each global task block, task dependency graphs of the same prototype of different particle systems are merged to find a common task structure. When merging, identical task nodes in the two graphs are identified, where identical here means that the same logical operation is performed on the same component, and the identical task nodes are represented as the same task nodes in the new graph.

[0042] The difference between the merged new task node and the original task node is that the components processed by the two original task nodes are merged. In detail: the executed commands are the same, so there is no need to change the commands; because the components are the same and belong to different particle system prototypes, the storage areas operated by the two tasks are two non-overlapping areas of the same global memory. Therefore, what is merged is the processed data set, and the same command is used to operate on a larger range of areas in the same memory segment. In this way, the GPU call instructions can be reduced and the memory access mode can be optimized without changing the amount of calculation.

[0043] For all nodes of the unique directed acyclic dependency graph, the original in-edge and out-edge relationships are retained to satisfy all the dependencies of at least two original task dependency graphs at the same time, but this may lead to the generation of new dependency paths. If a loop appears in the unique directed acyclic dependency graph after merging, it indicates that a circular dependency has been introduced, indicating that the task nodes that were previously considered the same need to be restored to two task nodes. Therefore, try to undo the previous merge node operations one by one until the loop in the new graph disappears.

[0044] The specific logic of merging and undoing operations is as follows Figure 4 As shown. For the two particle systems in the global task block, first analyze the dependencies of each task according to the component content of the task operation, and generate two directed acyclic task dependency graphs G1 and G2 respectively after the analysis is completed. Then, for these two task dependency graphs G1 and G2, identify the same task nodes and merge them into a directed new graph ( Figure 4 The intermediate result in the new graph) and mark the directed edges in the new graph from which graph. The loop {S1->S2->S3->S1} is detected, and the nodes on the loop are split. Since S1, S2, and S3 are all merged nodes, there are three splitting schemes, forming graph G. 12-1 , G 12-1' , G 12-1'' . And Figure G 12-1 and Figure G 12-1'' There are still loops in the network, which need to be further split. After there are no loops, merge the edges with the same starting point and endpoint to get the final split result.

[0045] While maintaining the original dependencies, we should merge as many task nodes as possible, and eventually merge all directed acyclic task dependency graphs into a unique directed acyclic dependency graph of the global task block. In other words, when there is a cycle after the merger, the number of nodes split to solve the circular dependency should be as small as possible.

[0046] In the embodiment, first split all the rings that only contain two task nodes, that is, the rings where node A points to B and node B points to A, and select any node to split. Then, for other rings, the strategy for selecting the task nodes to split is: only consider the edges connecting the task nodes in the ring and the new task nodes merged in the ring, and select the task nodes that have only one edge as the input edge and another edge as the output edge. Figure 4 In , the split task node S2 is selected because when only the edges connecting S1, S2, and S3 are considered, the incoming edges of S2 all come from G2 and the outgoing edges all come from G1. This strategy may not be optimal, but it can ensure that the loop currently being processed is untied. If such a task node does not exist, a task node with an in-degree of 0 for a certain edge is selected. Because the original graph is acyclic, such a node must exist.

[0047] The process of generating a unique directed acyclic dependency graph helps to identify and eliminate unnecessary dependencies and simplify the system structure. By merging task nodes, memory usage can be optimized and data transfer can be reduced. The process of merging dependency graphs can reveal the common dependencies between different prototypes, which helps to optimize the overall task scheduling strategy and reduce task switching overhead.

[0048] S5, merges the unique directed acyclic dependency graphs corresponding to all global task blocks and maps them to the GPU computing task manager to achieve highly optimized parallel scheduling execution on the GPU.

[0049] In the embodiment, the directed acyclic dependency graphs of the three global task blocks can be merged into a final directed acyclic graph according to the execution stage, that is, the directed acyclic graph of the generation task block, the update task block, and the rendering task block are executed in sequence. The merged graph still maintains the correct execution order and dependency relationship, reflecting the workflow of all particle systems. The tasks represented by the directed acyclic graph and their dependencies are expressed using a GPU computing task manager (such as CUDA Graph), and each task node is a CUDA kernel. CUDA Graph allows the entire computing Figure 1 Submitting tasks to the GPU at a time greatly reduces the CPU scheduling overhead. In addition, by pre-defining the task dependency graph, the GPU can schedule and execute tasks more intelligently. This method reduces the GPU's idle time and improves overall utilization.

[0050] The embodiment further provides a data-oriented particle system task design and scheduling device, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, the device is used to implement the data-oriented particle system task design and scheduling method, which specifically includes the following steps: S1, create a particle system prototype containing a data area and a task area for each particle system. The data area declares the properties represented by the particles in the particle system as components, merges the data areas of all particle system prototypes, and stores the components globally according to the array structure; S2, the task area declares all tasks performed by the particle system in different task stages, and the task constraints in the task area have an execution order relationship, and each task operates on at least one component; S3, after performing dependency parsing on tasks of different task stages in the task area of ​​each particle system prototype and generating a directed acyclic task dependency graph, the tasks are added to multiple global task blocks divided by task stages; S4, the task dependency graph in each global task block is merged into a unique directed acyclic dependency graph corresponding to each global task block with the goal of ensuring the original dependency relationship and merging as many task nodes as possible; S5, merges the unique directed acyclic dependency graphs corresponding to all global task blocks and maps them to the GPU computing task manager to achieve highly optimized parallel scheduling execution on the GPU.

[0051] The computing device provided in the embodiment, in addition to the processor and memory, also includes hardware required for other services such as internal bus, network interface, memory, etc. at the hardware level. The memory is a non-volatile memory, and the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the data-oriented particle system task design and scheduling method described in S1-S5 above. Of course, in addition to the software implementation, the present invention does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0052] Based on the same inventive concept, an embodiment further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned data-oriented particle system task design and scheduling method is implemented, which specifically includes the following steps: S1, create a particle system prototype containing a data area and a task area for each particle system. The data area declares the properties represented by the particles in the particle system as components, merges the data areas of all particle system prototypes, and stores the components globally according to the array structure; S2, the task area declares all tasks performed by the particle system in different task stages, and the task constraints in the task area have an execution order relationship, and each task operates on at least one component; S3, after performing dependency parsing on tasks of different task stages in the task area of ​​each particle system prototype and generating a directed acyclic task dependency graph, the tasks are added to multiple global task blocks divided by task stages; S4, the task dependency graph in each global task block is merged into a unique directed acyclic dependency graph corresponding to each global task block with the goal of ensuring the original dependency relationship and merging as many task nodes as possible; S5, merges the unique directed acyclic dependency graphs corresponding to all global task blocks and maps them to the GPU computing task manager to achieve highly optimized parallel scheduling execution on the GPU.

[0053] In the embodiment, computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data.

[0054] The embodiment further provides a computer product, which includes a computer program. When the computer program is executed by a processor, the method for designing and scheduling data-oriented particle system tasks includes the following steps: S1, create a particle system prototype containing a data area and a task area for each particle system. The data area declares the properties represented by the particles in the particle system as components, merges the data areas of all particle system prototypes, and stores the components globally according to the array structure; S2, the task area declares all tasks performed by the particle system in different task stages, and the task constraints in the task area have an execution order relationship, and each task operates on at least one component; S3, after performing dependency parsing on tasks of different task stages in the task area of ​​each particle system prototype and generating a directed acyclic task dependency graph, the tasks are added to multiple global task blocks divided by task stages; S4, the task dependency graph in each global task block is merged into a unique directed acyclic dependency graph corresponding to each global task block with the goal of ensuring the original dependency relationship and merging as many task nodes as possible; S5, merges the unique directed acyclic dependency graphs corresponding to all global task blocks and maps them to the GPU computing task manager to achieve highly optimized parallel scheduling execution on the GPU.

[0055] The above embodiment uses a data-oriented concept to manage the global particle system and separates data from behavior. It transcends the traditional particle system category boundaries, can identify and merge the same behaviors in different systems, resolve dependencies, and implement GPU parallelization of data update tasks based on CUDA Graph. This innovative design can not only optimize memory access patterns, but also improve cache utilization, thereby significantly improving the computing efficiency of the entire system.

[0056] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A data-oriented particle system task design and scheduling method, characterized in that: The following steps are involved: For each particle system, create a particle system prototype containing a data area and a task area, where the data area declares the properties represented by particles in the particle system as components, merges the data areas of all particle system prototypes, and stores components globally according to the array structure. The task area declares all tasks performed by the particle system in different task stages, and the task constraints in the task area have an execution order, and each task operates on at least one component; After performing dependency parsing on the tasks of different task stages in the task area of ​​each particle system prototype and generating a directed acyclic task dependency graph, the tasks are added to multiple global task blocks divided by task stages. The task dependency graph in each global task block aims to ensure the original dependency relationship and merge as many task nodes as possible, and merge into a unique directed acyclic dependency graph corresponding to each global task block; The unique directed acyclic dependency graphs corresponding to all global task blocks are merged and mapped to the GPU computing task manager to achieve highly optimized parallel scheduling execution on the GPU.

2. The data-oriented particle system task design and scheduling method according to claim 1, characterized in that: The operation performed by each task on at least one component includes a read operation or a modification operation. When performing a modification operation, the component memory in the data area is modified, and part of the memory of the corresponding component in the global storage is modified synchronously.

3. The data-oriented particle system task design and scheduling method according to claim 1, characterized in that: The global task blocks divided according to the task stages include a generation task block corresponding to the generation task stage, an update task block corresponding to the update task stage, and a rendering task block corresponding to the rendering task stage.

4. The data-oriented particle system task design and scheduling method according to claim 1, characterized in that: Each task is authorized to operate at least one component, and each task can only operate at least one authorized component.

5. The data-oriented particle system task design and scheduling method according to claim 1, characterized in that: When performing dependency parsing for tasks at different task stages in the task area and generating a directed acyclic task dependency graph, each node in the graph represents a task, and the edges between the nodes represent the dependency relationship between the tasks. The operation set corresponding to each task is defined to be composed of authorization components. When the second task is executed after the first task and the intersection of the authorization components in the two operation sets is not empty, the second task is considered to be dependent on the first task, and a directed edge is constructed from the node corresponding to the first task to the node corresponding to the second task.

6. The data-oriented particle system task design and scheduling method according to claim 1, characterized in that: The task dependency graph in each global task block is merged into a unique directed acyclic dependency graph corresponding to each global task block, with the goal of ensuring the original dependency relationship and merging as many task nodes as possible, including: With the goal of ensuring the original dependency and merging as many task nodes as possible, identify the same task nodes in the task dependency graph that need to be merged, and represent the same task nodes as the same task nodes in the unique directed acyclic dependency graph, while retaining the original in-edge and out-edge relationships of the task nodes. When a cycle appears in the unique directed acyclic dependency graph after the merger, undo the previous operation of merging task nodes until the cycle disappears.

7. The data-oriented particle system task design and scheduling method according to claim 6 is characterized in that: When undoing the previous operation of merging task nodes, choose to split the task nodes. The strategy for splitting task nodes is: only consider the edges connecting the task nodes in the ring and the new task nodes merged in the ring, and choose to split the task nodes that have only one type of edge as the input edge and another type of edge as the output edge; when there is no such task node, choose a task node with a certain edge input degree of 0.

8. A data-oriented particle system task design and scheduling device, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the one or more processors execute the executable code, they are used to implement the data-oriented particle system task design and scheduling method described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, the data-oriented particle system task design and scheduling method described in any one of claims 1-7 is implemented.

10. A computer product comprising a computer program, characterized in that When the computer program is executed by a processor, the data-oriented particle system task design and scheduling method described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Pipeline parallelization method for coarse-grained streaming application

    CN103377035A

  • Fractal image generation and rendering method based on game engine and CPU parallel processing

    CN105787865A

  • Particle system rendering method and device, electronic equipment and readable storage medium

    CN114432695A

  • Split frame rendering

    US20180211435A1