System and method for unified application programming interface and model
AssigneeApple Inc.
InventorsRichard W. Schreyer, Kenneth C. Dyke, Alexander K. Kan
Life of this patent
Estimating the term…
Abstract
Systems, computer readable media, and methods for a unified programming interface and language are disclosed. In one embodiment, the unified programming interface and language assists program developers write multi-threaded programs that can perform both graphics and data-parallel compute processing on GPUs. The same GPU programming language model can be used to describe both graphics shaders and compute kernels, and the same data structures and resources may be used for both graphics and compute operations. Developers can use multithreading efficiently to create and submit command buffers in parallel.
Claims20
A non-transitory computer readable medium comprising instructions stored thereon to support workload management for a graphics processing unit (GPU), wherein the instructions, when executed, cause one or more processors to:
- submit one or more commands to each of at least two different types of command encoders;
- create two or more command buffers;
- append the two or more command buffers to a command queue in a given order;
- encode, with at least one of the at least two different types of command encoders, at least one command, wherein the at least one encoded command are stored in their respective command buffers prior to the command buffers being submitted to the GPU for execution;
- determine when a commit command has been called on each of the two or more command buffers, wherein the commit command indicates the respective command buffer is eligible for submission to the GPU for execution;
- commit the two or more command buffers to the GPU for execution after a respective determination has been made that each respective command buffer is eligible for submission to the GPU for execution;
- and
- submit the two or more committed command buffers to the GPU for execution, wherein an order in which the two or more command buffers are executed is determined by the given order of the two or more command buffers in the command queue.
An apparatus, comprising:
- a processing device comprising a central processing unit (CPU) and a graphics processing unit (GPU);
- and
- a memory, wherein the CPU is configured to execute program code stored in the memory to:
- submit one or more commands to each of at least two different types of command encoders;
- create two or more command buffers;
- append the two or more command buffers to a command queue in a given order;
- encode, with at least one of the at least two different types of command encoders, at least one command, wherein the at least one encoded command are stored in their respective command buffers prior to the command buffers being submitted to the GPU for execution;
- determine when a commit command has been called on each of the two or more command buffers, wherein the commit command indicates the respective command buffer is eligible for submission to the GPU for execution;
- commit the two or more command buffers to the GPU for execution after a respective determination has been made that each respective command buffer is eligible for submission to the GPU for execution;
- and
- submit the two or more committed command buffers to the GPU for execution, wherein an order in which the two or more command buffers are executed is determined by the given order of the two or more command buffers in the command queue.
A method, comprising:
- submitting one or more commands to each of at least two different types of command encoders;
- creating two or more command buffers;
- appending the two or more command buffers to a command queue in a given order;
- encoding, with at least one of the at least two different types of command encoders, at least one command, wherein the at least one encoded command are stored in their respective command buffers prior to the command buffers being submitted to a graphics processing unit (GPU) for execution;
- determining when a commit command has been called on each of the two or more command buffers, wherein the commit command indicates the respective command buffer is eligible for submission to the GPU for execution;
- committing the two or more command buffers to the GPU for execution after a respective determination has been made that each respective command buffer is eligible for submission to the GPU for execution;
- and
- submitting the two or more committed command buffers to the GPU for execution, wherein an order in which the two or more command buffers are executed is determined by the given order of the two or more command buffers in the command queue.
Dependencies are inferred from the claim text.