IP Library Granted Patent US 9,250,956
Granted Patent B2
US 9,250,956 · App. 14/163,717 · Granted Feb 2, 2016

Application interface on multiple processors

Inventors: Aaftab AbdulLatif Munshi (Los Gatos, CA); Jeremy Sandmel (San Mateo, CA)
Assignee: Apple Inc.
G06F9/4843G06F8/314G06F8/41G06F9/505G06F9/5027G06F9/541G06F8/445
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,250,956
App. No.
14/163,717
Granted
Feb 2, 2016
Kind
B2
Abstract

A method and an apparatus that execute a parallel computing program in a programming language for a parallel computing architecture are described. The parallel computing program is stored in memory in a system with parallel processors. The system includes a host processor, a graphics processing unit (GPU) coupled to the host processor and a memory coupled to at least one of the host processor and the GPU. The parallel computing program is stored in the memory to allocate threads between the host processor and the GPU. The programming language includes an API to allow an application to make calls using the API to allocate execution of the threads between the host processor and the GPU. The programming language includes host function data tokens for host functions performed in the host processor and kernel function data tokens for compute kernel functions performed in one or more compute processors, e.g GPUs or CPUs, separate from the host processor. Standard data tokens in the programming language schedule a plurality of threads for execution on a plurality of processors, such as CPUs or GPUs in parallel. Extended data tokens in the programming language implement executables for the plurality of threads according to the schedules from the standard data tokens.

Claims (41)

1. A non-transitory computer readable storage medium having stored thereon executable instructions for a platform layer and a runtime layer for a host processor coupled to at least one compute devices comprising at least one central processing unit (CPU) and at least one graphics processing unit (GPU), the instructions comprising:

instructions to cause the platform layer to

provide an interface for an application executing on the host processor to request identification of any compute devices that meet processing requirements for a task corresponding to source code in the host application,

identify at least one of the at least one CPU or the at least one GPU of the plurality of compute devices in response to the identification request from the host application by evaluating processing capabilities of the at least one CPU and the at least one GPU, and

provide an interface for the host application to request creation of a context for either a CPU or GPU selected by the host application from the compute identifiers for the identified compute devices; and

instructions to cause the runtime layer to

provide an interface for the host application to request creation of a kernel to execute the task on the selected compute device, and

provide an interface for the host application to request the kernel be executed on the selected CPU or GPU.

2. The non-transitory computer readable storage medium of claim 1 , wherein the creation of the kernel comprises:

compiling, by the runtime layer during execution of the host application, the kernel from the source code based on the context.

3. The non-transitory computer readable storage medium of claim 2 , wherein the context specifies a queue for the selected compute device and the request that the kernel be executed further causes the runtime layer to place the kernel in the queue.

4. The non-transitory computer readable storage medium of claim 1 , wherein the selected compute device comprises multiple physical processors and the task comprises a plurality of threads of execution that are processed concurrently on the multiple processors.

5. The non-transitory computer readable storage medium of claim 4 , wherein the request to execute the kernel comprises a number of threads to be executed as a block on a physical processor.

6. The non-transitory computer readable storage medium of claim 1 , wherein the runtime layer further receives a request, from the host application, to allocate global memory for an input stream and an output stream for the kernel, the global memory coupled to the selected compute device.

7. The non-transitory computer readable storage medium of claim 6 , wherein the host application writes data to the input stream for execution by kernel on the selected compute device and reads data from the output stream in response to the execution of the kernel on the selected compute device.

8. The non-transitory computer readable storage medium of claim 6 , wherein the input stream and the output stream each comprises one of an image stream and a variable stream.

9. The non-transitory computer readable storage medium of claim 1 , wherein the requests from the host application are processed by an interpreter during execution of the host application.

10. A computerized method comprising:

executing, on a host processor coupled to a plurality of compute devices comprising at least one central processing unit (CPU) and at least one graphics processing unit (GPU), a platform layer process that provides an interface for a host application executing on the host processor to request identification of any compute devices that meet processing requirements for a task corresponding to source code in the host application, identify at least one of the at least one CPU or the at least one GPU of the plurality of compute devices in response to the identification request from the host application by evaluating processing capabilities of the at least one CPU and the at least one GPU, and provides an interface for the host application to request creation of a context for either a CPU or a GPU selected by the host application from compute identifiers for compute devices returned by the platform layer in response to the identification request; and

executing, on the host processor, a runtime layer process that provides an interface for the host application to request creation of a kernel to execute the task on the selected compute device, and provides an interface for the host application to request the kernel be executed on the selected GPU or CPU.

11. The computerized method of claim 10 , wherein the runtime layer process further compiles the kernel from the source code based on the context during execution of the host application to create the kernel.

12. The computerized method of claim 11 , wherein the context specifies a queue for the selected compute device and the request that the kernel be executed further causes the runtime layer process to place the kernel in the queue.

13. The computerized method of claim 10 , wherein the selected compute device comprises multiple physical processors and the task comprises a plurality of threads of execution that are processed concurrently on the multiple processors.

14. The computerized method of claim 13 , wherein the request to execute the kernel comprises a number of threads to be executed as a block on a physical processor.

15. The computerized method of claim 10 , wherein the runtime layer process further receives, from the host application, a request to allocate global memory for an input stream and an output stream for the kernel, the global memory coupled to the selected compute device.

16. The computerized method of claim 15 , wherein the host application writes data to the input stream for execution by kernel on the selected compute device and reads data from the output stream in response to the execution of the kernel on the selected compute device.

17. The computerized method of claim 15 , wherein the input stream and the output stream each comprises one of an image stream and a variable stream.

18. The computerized method of claim 10 , wherein the requests from the host application are processed by an interpreter during execution of the host application.

19. A system comprising:

a host processor coupled to a memory through a bus;

a plurality of compute devices coupled to the host processor through a bus and comprising at least one central processing unit (CPU) and at least one graphics processing unit (GPU);

a platform layer process stored as instructions in the memory to cause the host processor to provide an interface for a host application executing on the host processor to request identification of any compute devices that meet processing requirements for a task corresponding to source code in the host application, identify at least one of the at least one CPU or the at least one GPU of the plurality of compute devices in response to the identification request from the host application by evaluating processing capabilities of the at least one CPU and the at least one GPU; and to provide an interface for the host application to request creation of a context for either a GPU or a CPU selected by the host application from compute identifiers for compute devices returned by the platform layer in response to the identification request; and

a runtime layer process stored as instructions in the memory to cause the host processor to provide an interface for the host application to request creation of a kernel to execute the task on the selected compute device, and to provide an interface for the host application to request the kernel be executed on the selected GPU or CPU.

20. The system of claim 19 , wherein the runtime layer process compiles the kernel from the source code based on the context during execution of the host application to create the kernel.

21. The system of claim 20 , wherein the context specifies a queue for the selected compute device and the request that the kernel be executed further causes the runtime layer process to place the kernel in the queue.

22. The system of claim 19 , wherein the selected compute device comprises multiple physical processors and the task comprises a plurality of threads of execution that are processed concurrently on the multiple processors.

23. The system of claim 22 , wherein the request to execute the kernel comprises a number of threads to be executed as a block on a physical processor.

24. The system of claim 19 further comprising global memory coupled to the host processor and the selected compute device and wherein the runtime layer process further receives, from the host application, a request to allocate global memory for an input stream and an output stream for the kernel.

25. The system of claim 24 , wherein the host application writes data to the input stream for execution by kernel on the selected compute device and reads data from the output stream in response to the execution of the kernel on the selected compute device.

26. The system of claim 24 , wherein the input stream and the output stream each comprises one of an image stream and a variable stream.

27. The system of claim 19 further comprising an interpreter process stored as instruction in the memory to cause the host processor to interpret the request from the host application during execution of the host application.

Assignments (1)
CHANGE OF NAME Recorded Oct 30, 2015
From: APPLE COMPUTER, INC.
To: APPLE INC.
Reel/Frame 036925/0001 →
Continuity (5)
Continuation 13723014 · Dec 20, 2012
Continuation 11800183 · May 3, 2007
Provisional Application 60923030 · Apr 11, 2007
Provisional Application 60925574 · Dec 25, 2012
Related Publication 20140201765A1 · Jul 17, 2014