Interpreter for simplified programming of graphics processor units in general purpose programming languages
AssigneeMicrosoft Corporation
InventorsDavid Read Tarditi, Jr., Raymond E. Endres, Vivian Sewelson
Life of this patent
Estimating the term…
Abstract
Although GPUs have been harnessed to solve non-graphics problems, these solutions are not widespread because GPUs remain difficult to program. Instead, an interpreter simplifies the task of programming a GPU by providing language constructs such as a set of data types and operations that are more familiar to non-graphics programmers. The interpreter maps these familiar language constructs to the more difficult graphics programming languages such as DirectX®, OpenGL®, Cg®, and/or HLSL®.
Claims23
A computerized method comprising:
- providing a library to applications programmers comprising at least one abstract datatype representing parallel arrays with at least one dimension and parallel operations associated with the parallel arrays, wherein the applications programmers assign standard language arrays to the parallel arrays because the parallel operations cause a graphic processing unit to operate on the elements of the parallel arrays in parallel;
- in response to receiving at least one call to a parallel operation provided by the library, building a graph data structure representation of the parallel operation and returning a pointer to the graph data structure representation wherein a node of the graph data structure representation comprises a standard array resident in a memory associated with a central-processing unit;
- in response to receiving at least one call to a parallel operation provided by the library wherein the call's arguments include the pointer to the graph data structure representation, building a larger graph data structure representation of the parallel operation wherein a first node of the larger graph data structure representation comprises the standard array resident in the memory associated with of the central-processing unit and a second node of the larger graph data structure representation comprises a parallel operation associated with at least one of the parallel arrays;
- in response to receiving at least one call requiring evaluation of the parallel operation represented by the larger graph data structure representation, evaluating the parallel operation represented by the larger graph data structure representation, the evaluation comprising,
- traversing the larger graph data structure representation and constructing a shader graph comprising plural pixel shader programs,
- traversing the shader graph and invoking at least one operation via the graphic-processing unit to evaluate each pixel shader program, wherein the standard array is copied to a memory associated with the graphic-processing unit as input to at least one of the pixel shader programs, and
- copying an output of at least one pixel shader program from the memory associated with the graphic-processing unit to the memory associated with the central-processing unit;
- returning the output comprising a standard array resident in the memory of the central-processing unit.
A computer system comprising:
- a graphics card comprising graphics memory and a graphics processing unit;
- computer memory and a central processing unit coupled to the graphics card;
- an application program requesting parallel processing via a library component;
- the library component providing to the application program at least,
- abstract data types having parallel arrays and associated parallel operations, and
- an interpreter for receiving parallel processing requests from the application program and performing a method comprising:
- receiving a first parallel operation request, building a graph data structure representation of the parallel operation and returning a pointer to the graph data structure representation wherein a node of the graph data structure representation comprises a standard array resident in the computer memory;
- receiving a second parallel operation request wherein the request's arguments include the pointer to the graph data structure representation, and building a larger graph data structure representation of the second parallel operation, wherein a node of the larger graph data structure representation comprises the standard array resident in the computer memory;
- responsive to receiving a request requiring evaluation of the second parallel operation represented by the larger graph data structure representation, evaluating the second parallel operation represented by the larger graph data structure representation, the evaluation comprising,
- traversing the larger graph data structure representation and constructing a shader graph comprising plural pixel shader programs,
- traversing the shader graph and invoking at least one operation to evaluate each pixel shader program on a graphic-processor unit, wherein the standard array is copied to graphics memory as input to at least one of the pixel shader programs, and
- copying an output of at least one pixel shader program from graphics memory to the computer memory;
- returning the output comprising a standard array resident in the computer memory.
A computer-readable storage medium having stored thereon computer-executable instructions comprising:
- instructions providing a library to applications programmers comprising at least one abstract datatype representing parallel arrays with at least one dimension and parallel operations associated with the parallel arrays, wherein the applications programmers assign standard language arrays to the parallel arrays because the parallel operations cause the a graphic-processing unit to operate on the elements of the parallel arrays in parallel;
- instructions for responsive to receiving at least one call to a parallel operation provided by the library, building a graph data structure representation of the parallel operation and returning a pointer to the graph data structure representation wherein a node of the graph data structure representation comprises a standard array resident in a memory associated with a central-processing unit;
- instructions for responsive to receiving at least one call to a parallel operation provided by the library wherein the call's arguments include the pointer to the graph data structure representation, building a larger graph data structure representation of the parallel operation wherein a node of the larger graph data structure representation comprises the standard array resident in the memory associated with the central-processing unit;
- instructions for evaluating the parallel operation represented by the larger graph data structure representation, the evaluation comprising,
- traversing the larger graph data structure representation and constructing a shader graph comprising plural pixel shader programs,
- traversing the shader graph and invoking at least one operation to evaluate each pixel shader program on the graphic-processing unit, and wherein the standard array is copied to a memory associated with the graphic-processing unit as input to at least one of the pixel shader programs, and
- copying an output of at least one pixel shader program from the memory associated with the graphic-processing unit to the memory associated with the central-processing unit;
- instructions for responsive to receiving at least one call requiring evaluation of the parallel operation represented by the larger graph data structure representation, performing the evaluation and returning the output comprising a standard array resident in the memory of a central-processing unit.
A computer system comprising:
- a graphics card comprising graphics memory and a graphics processing unit;
- computer memory and a central processing unit coupled to the graphics card;
- an application program requesting parallel processing via a library component;
- the library component providing to the application program at least,
- abstract data types having parallel arrays and associated parallel operations, and
- an interpreter for receiving parallel processing requests from the application program and performing a method comprising:
- receiving a first parallel operation request, building a directed acyclical graph data structure representation of the parallel operation and returning a pointer to the directed acyclical graph data structure representation, wherein a first node of the directed acyclical graph data structure representation comprises a standard array with at least two dimensions resident in the computer memory;
- receiving a second parallel operation request, wherein the request's arguments include the pointer to the directed acyclical graph data structure representation, and building a larger directed acyclical graph data structure representation of the second parallel operation, wherein a second node of the larger directed acyclical graph data structure representation comprises a standard array resident in the computer memory, the second node of the larger directed acyclical graph comprising a multiplication operator, and at least one edge of the larger directed acyclical graph represents operands for the multiplication operator;
- responsive to receiving a request requiring evaluation of the second parallel operation represented by the larger directed acyclical graph data structure representation, evaluating the second parallel operation represented by the larger directed acyclical graph data structure representation, the evaluation comprising:
- traversing the larger directed acyclical graph data structure representation and constructing a shader graph comprising plural pixel shader programs,
- traversing the shader graph and invoking at least one operation to evaluate each pixel shader program on a graphic-processor unit, wherein the standard array is copied to graphics memory as input to at least one of the pixel shader programs and the at least one operation comprises identifying a recently compiled pixel shader in a shader cache and invoking the identified pixel shader program, and
- copying an output of the identified pixel shader program from graphics memory to the computer memory;
- responsive to receiving a request requiring evaluation of the second parallel operation represented by the larger graph representation, returning the output comprising a standard array with at least two dimensions resident in the computer memory.
Dependencies are inferred from the claim text.