Application programming interfaces for data parallel computing on multiple processors
AssigneeApple Inc.
InventorsAaftab A. Munshi, Nathaniel Begeman
Life of this patent
Estimating the term…
Abstract
A method and an apparatus for a parallel computing program calling APIs (application programming interfaces) in a host processor to perform a data processing task in parallel among compute units are described. The compute units are coupled to the host processor including central processing units (CPUs) and graphic processing units (GPUs). A program object corresponding to a source code for the data processing task is generated in a memory coupled to the host processor according to the API calls. Executable codes for the compute units are generated from the program object according to the API calls to be loaded for concurrent execution among the compute units to perform the data processing task.
Claims24
A parallel computing system comprising:
- a host processor;
- one or more compute units coupled to the host processor;
- a memory coupled to at least one of the host processor and the one or more compute units, wherein a parallel computing program is stored in the memory, wherein the parallel computing program is executable by the host processor, the parallel computing program specifying a source code and processing requirements for a data processing task based on the source code, wherein the source code is not yet compiled before runtime when the parallel computing program is executed, the parallel computing program including calls to one or more APIs (application programming interface) for the host processor to perform during the runtime of the parallel computing program:
- selecting the compute units based on the processing requirements which include a multi-dimensional value specifying a number of threads to perform the data processing task, at least one of the APIs is called with the processing requirements;
- generating executable codes from the source code for the one or more compute units, at least one of the APIs is called with a specification of the source code;
- and
- loading the executable codes to be executed concurrently via the number of threads among the one or more compute units to perform the data processing task.
A parallel computing system comprising a host processor;
- one or more compute units coupled to the host processor;
- a memory coupled to at least one of the host processor and the one or more compute units, wherein a parallel computing program is stored in the memory, the parallel computing program specifying a source code and processing requirements for a data processing task based on the source code, the parallel computing program including calls to one or more APIs (application programming interface) for the host processor to perform:
- selecting the compute units based on the processing requirements which include a multi-dimensional value specifying a number of threads to perform the data processing task, at least one of the APIs is called with the processing requirements;
- generating executable codes from the source code for the one or more compute units, at least one of the APIs is called with a specification of the source code;
- loading the executable codes to be executed concurrently among the one or more compute units to perform the data processing task, wherein the loading of the executable codes comprises:
- generating a kernel object associated with a function name identifying a function implementing the data processing task in the source codes, the kernel object including storage for arguments of the function, and
- scheduling execution of the executable codes among the one or more compute units, wherein the execution including the number of threads in a thread group to execute one of the executable codes concurrently in at least one of the one or more compute units.
A machine readable non-transitory storage medium storing a plurality of tokens comprising:
- host function tokens associated with function parameters, the function parameters specifying a source code and processing requirements for a data processing task based on the source code, wherein the host function tokens including executable code, wherein the source code is not yet compiled before runtime of the executable code for the host function tokens, the host function tokens corresponding to one or more APIs (application programming interfaces) for a host processor to perform, during the runtime of the executable code, one or more host functions including:
- selecting one or more compute units coupled to the host processor based on the processing requirements, wherein the processing requirements include a multi-dimensional value specifying a number of threads to perform the data processing task, at least one of the APIs is called with the processing requirements,
- generating executable codes from the source code for the one or more compute units selected, at least one of the APIs is called with a specification of the source code, and
- loading the executable codes to be executed concurrently among the one or more compute units to perform the data processing task via the number of threads, and
- kernel function tokens corresponding to the source code for the data processing task.
Dependencies are inferred from the claim text.