You are on page 1of 25

US 20120259843Al

(19) United States (12) Patent Application Publication (10) Pub. No.: US 2012/0259843 A1
Child
(54) DATABASE ACCELERATION USING GPU
AND MULTICORE CPU SYSTEMS AND
METHODS (

(43) Pub. Date:
51
)

Oct. 11, 2012

Publication Classi?cation
I t Cl

G06F 1 7/30

n '

'

(2006.01)

(76) Inventor:
(21) Appl. NO.I
(22) Filed;

(Tljlélftlly Clllld, San Rafael, CA
13/444,778
APL 11, 2012
. .

_

_

(52)

US. Cl. .. 707/722; 707/792; 707/769; 707/E17.014;

'707/E17055; '707/E17141

(57)

ABSTRACT

A computer-implemented method for GPU acceleration of a database system, the method includes a) executing a parallel iZed query against a database using a database server, the paralleliZed query including an operation using a particular
stored procedure available to the database server that includes

Related U's' Apphcatlon Data
(60) Provisional application No. 61/474,228, ?led on Apr.

a GPU/Many-Core Kernel executable; and b) executing the
Particular SIOred procedure 011 One Or more GPU/Many-Core devices.

11,2011.

f 100
Application
\
v

102

Database
Sever
n
7

107

Database Stored Procedure Function Manager
k

V

GPU/Many-Core Host
k

/
/
v v v v

108
GPU/

GPU/

GPU/

GPU/

Many-Core
Device

Many-Core
Device

Many-Core
Device

Many-Core
Device

Patent Application Publication

Oct. 11, 2012 Sheet 1 of 15

US 2012/0259843 A1

f 100
101

103

\

\

Application i

102

Database
Sever

V

/
107

104
\

Database Stored Procedure
Function Manager

V

106

\
I."

\
I. I

~

"EE

5555

\

GPU/Many-Core Host
i /

/-A

/
v v v v

108
GPU/

GPU/

GPU/

GPU/

Many-Core
Device

Many-Core
Device

Many-Core
Device

Many-Core
Device

FIG. 1

2012 Sheet 2 of 15 US 2012/0259843 A1 Creating GPU/Multi-Core Environment Work?ow Compiling Programs on Multiple Devices Work?ow ( Start ) 201 y @ / 200 202 \ Create GPU Environment V Compile Programs On Multiple Devices V _/ End End Executing a Database Query With Stored Procedure Querying for Management Information 1 Start V l 203 ( 205 Start 7 l Query for Environment / \ Execute Query 206 " And Device Properties v \ Run GPU/Multi-Core Programs 207 v End Setting Environment And Device Properties \ 208 Results V Return 1 Start V > 204 \ Release Resources Setting Environment / And Device Properties End FIG.Patent Application Publication Oct. 2 . 11.

Patent Application Publication Oct. 3 . 11. 2012 Sheet 3 0f 15 US 2012/0259843 A1 300 / 301 / \ Establish Memory Pools l GPU/Many-Core Data Types 302 / Query for l 303 Cache \ Metadata Types Metadata Data Types FIG.

11. 2012 Sheet 4 0f 15 US 2012/0259843 A1 401 @ / Initialize GPU Host Environment V 400 / 404 402 Determine the Number of Vendors Platforms 403 V Obtain Vendors ' Platform Data Obtain Device Count for Each Platform vl Any More Devices Obtain Device Data 407 405 Any More Platforms / 408 Create Device Context Create Command Queue FIG. 4 .Patent Application Publication Oct.

11. 5 . 2012 Sheet 5 0f 15 US 2012/0259843 A1 / 500 501 —> Program For a Device Compile / 503 / 502 Are Yes Compiler Errors? Report Compiler Errors 504 \ Cache Program Binary 505 Yes Are More Devices FIG.Patent Application Publication Oct.

11.Patent Application Publication Oct. 2012 Sheet 6 0f 15 US 2012/0259843 A1 601 602 603 \ Map Types V 604 Validate \ Store procedure Mode To Storage Type 607 v /‘ Storage Type OK? Process Error 606 .

2012 Sheet 7 0f 15 US 2012/0259843 A1 701 ‘E? \ in Retrieve Next Procedure .Patent Application Publication Oct. 11. 7 . Argument Is the / 702 704 Argument \ ‘8’ A Argument? Metadata “ _ g Yes 703 V Process Argument : - Process Metaolata Argument / Yes Are There More 705 Arguments / FIG.

2012 Sheet 8 0f 15 US 2012/0259843 A1 f 800 806 801 Establish Run-Time Environment Execute Program 807 / 802 Copv Data to the Device Copv Data From the Device 803 808 / 804 Bind Program Co nve rt Arguments Data Specify Mocle Of Paralleism Format Results \\ \ 809 / / 805 Determine the The Number of Parallel Threads Return 810 Results 811 Release Non-Retained Resources FIG. 11.Patent Application Publication Oct. 8 .

Patent Application Publication Oct. 11. 2012 Sheet 9 0f 15 US 2012/0259843 A1 f 900 901 Set the Parallel Settings Mode for the System 904 No Yes Parallel Mode = Parallel Mode = Parallel Mode = DYNAMIC 906 Determine the Number of Parallel Threads Read the N D KERNEL FIXED 903 Range from the Kernel Source Code Input the N D Range Via the API / 905 / / End FIG. .

Patent Application Publication Oct.1 1002 l 1003 Start Scanning Arguments 1004 Is a 1005 Reference / ls Argument Size > Global 1007 1006 Set 1008 Transform Global Work Group Size = Argument Size Work Group Size FIG.1. 10 . 2012 Sheet 10 0f 15 US 2012/0259843 A1 / 1000 1001 Declare Reference Arguments l Set Global Work Group Size = 1. 11.

2012 Sheet 11 0f 15 US 2012/0259843 A1 1101 \ Start Mapping Return Arguments 1105 1102 / Map Argument No Map 1 103 / Retuning A Scalar ? Yes Procedure Zero th Array Element To Scalar 1106 Return Mapped Argument / 1107 Return Scalar / 1 104 Are There More Arguments Yes ? No FIG.Patent Application Publication Oct. 11. 11 .

Patent Application Publication Oct. 2012 Sheet 12 0f 15 US 2012/0259843 A1 f 1200 Establish 1201 Output \ Transformations Argument Start 1202 Arguments Scanning / 1204 Set Argument Size = Transformation x Global Work Group Size + Allocate 1205 1206 Argument Storage There More Arguments Yes . 11.

2012 Sheet 13 0f 15 US 2012/0259843 A1 / 1300 1301 / 1302 Query Environment Properties / Report Environment Properties l Device Query 5 1303 Properties 1304 Report Device / 1305 Properties FIG. 13 . 11.Patent Application Publication Oct.

2012 Sheet 14 0f 15 US 2012/0259843 A1 ‘i? 1401 / 1402 Get Platform And Device Index / Isthe Platform Index And Device Index Equal Current Values? V 1403 Reset Environment Properties 1404 Properties FIG.Patent Application Publication Oct. 11. 14 .

2012 Sheet 15 0f 15 US 2012/0259843 A1 1501 1502 Determine Determine f 1500 Number of Devices 1507 Rows —> \ Number of <— Arguments + 1503 Insert . 11. \ 1504 Data Types ‘ Create Determine With Initial values l 1508 —> Execute Kernel \ Temp Table 1505 \ Buffers l Create Update ROW 1509 1506 \ 1513 ‘ Map Buffers To Rows Yes more Kernels to Execute ? 1510 Are there / ea? <— 1514 + Aggregate / Results \ Drop Table 1512 Results Return / .Patent Application Publication Oct.

a database server execut system executes on the data being retrieved by database que ries or by API calls. obtaining a GPU Kernel code executable. the contents of Which are expressly incorporated by reference thereto in its entirety. Database systems have usedparallel data I/O for many years. Each column or ?eld has a speci?c related to paralleliZation of database systems that utiliZes GPU and Many Core systems. BRIEF SUMMARY OF THE INVENTION [0001] This application claims the bene?t of US. Much of the data in Information Technology industry is stored in relational databases. and a GPU/ Many-Core ho st computationally communicated to the one or language. each GPU/Many Core device including a compute unit having one or more arithmetic logic units executing one or more Kernel instruc tions and a memory storing data and variables. or PL/SQL and other programming lan guages like C. [0007] With the increasing groWth of so called “Big DataApplications” there is a need to process even more data b) obtaining GPU/Many-Core Kernel programs for a plurality of GPU/Many-Core devices executable by the database server as stored procedures. 2011. to use of GPU Many-Core Systems program ming languages as Stored Procedure languages for databases. These processing units are capable of being used for massively parallel processing. at faster speeds With more complex analytical algorithms. At run-time their able by the GPU/Many-Core host in response to the particular stored procedure. Which are made up of columns or ?elds. and computations inparallel. These systems have used utiliZe parallel computational pro cessing in a speci?c manner to solve a narroW set of problems. To run a Kernel. includes a) hosting a GPU/Many-Core program Kernel code executable inside a database available to the database as a stored procedure. and abstract as a Whole. [0004] Database and Indexed Files systems utiliZe Stored Procedures or User De?ned Functions (UDF). or a With a GPU programming ing the paralleliZed query against the database. Wherein the particular stored procedure includes the GPU Kernel code executable. [0006] GPU and Many-Core devices use specialiZed pro gramming languages like NV1dia’s CUDA and the Khronos OrganiZation’s OpenCL. or embedded on the same Silicon more GPU/Many-Core devices. 11. A Stored Procedure or UDF can be Written in a variety of languages. 2012 DATABASE ACCELERATION USING GPU AND MULTICORE CPU SYSTEMS AND METHODS CROSS REFERENCE TO RELATED APPLICATIONS These systems have typically required that the database pro grammer create and execute ad hoc methods to characteriZe and implement a query used in solving these narroW set of problems. They use Kernels. Java. . They require a compilation and linking phase to convert the source code to machine instructions and link With run-time libraries. draWings. But there have been feW systems to b) executing the GPU/Many-Core program Kernel code executable on the one or more GPU/Many-Core devices by utiliZe parallel computational processing With databases. One Way processing more data in shorter timescales is to perform more calculations and [0013] A computer-implemented method for programming one or more GPU/Many-Core devices. BACKGROUND OF THE INVENTION [0002] The present invention relates generally to GPU and Many-Core programming. including SQL languages like. Provi sional Application 61/474. A GPU may be an independent co-processor or device. and more speci?cally. calling a query against the database using a database server and the stored procedure. transfer data betWeen host environments and run the Kernels. [0005] Graphics Processing Units (GPU) and Many-Core Systems are computer processing units that contain a large number of Arithmetic Logic Units (ALU) or ‘Cores’ process ing units. [0011] A GPU accelerated database system for a database storing a database table includes an application producing a paralleliZed query for the database. c) querying the GPU/Many-Core environment to obtain a GPU/Many-Core characteriZation. Embodiments of the present invention improve performance of database operations by using GPU/Many-Core systems and improve performance of GPU/Many-Core systems by using database operations. the GPU/Many-Core host creating a computing environment that de?nes the one or chip. A full appreciation of the various aspects of the invention can be gained by taking the entire speci?cation. [0012] A computer-implemented method includes a) creat ing a GPU/Many-Core environment inside a database server. and is not intended to be a full database type. of roWs or record. They use various programming language data types as arguments. C++. Wherein the paralleliZed query includes a particular stored procedure executed by the stored procedure function manager. Which are specialiZed Sub-Routines designed to be run in parallel. Transact-SQL. one or more GPU/Many-Core devices. These stored procedures or functions are sub-routines that the database description of the present invention. claims. [0009] Disclosed is a system and method for processing data stored in database With GPU and Many-Core System in a highly paralleliZed manner. more GPU/Many-Core devices. [0008] What is needed is a generic system and method for processing data stored in database With GPU and Many-Core System in a highly paralleliZed manner. These programming languages leverage the parallel processing capabilities of GPU and Many-Core devices. The present invention is applicable to other GPU and Many Core programming. Data is stored in tables or ?les that comprises. a stored pro cedure function manager that executes a stored procedure. and Wherein the stored procedure function man ager initiates the executing of the GPU Kernel code execut they require the establishment of a host operating environ ment to support their execution. sometimes requiring detailed knoWledge of GPU code and programming best practices that are outside of the typical knoWledge set for database programmers.US 2012/0259843 A1 Oct. and d) presenting the GPU/Many-Core environment as a data structure Within the database server. but not exclusively. Kernels are declared like sub-routines. and executing the GPU Kernel code execut able using the one or more GPU/Many-Core devices.228 ?led on Apr. 11. [0010] The folloWing summary of the invention is provided to facilitate an understanding of some of technical features [0003] SQL Databases and Non-SQL Databases and Indexed Files Systems (IFS) are used as persistent data stores for a variety of computer applications. operating environments load the machine code.

converted to a scalar return type. a GPU/Many-Core Host 105 that creates an environment that de?nes one or more host platforms and cedures execution. together With the detailed description of the invention. BRIEF DESCRIPTION OF THE DRAWINGS [0017] The accompanying ?gures. [0038] GPU/Many-Core environment means a run-time environment created With a host computer program that pro major phases of the system. or the like. The folloWing description is presented to enable one of ordinary skill in the art to make and use the invention and is provided in the context of a patent application and its includes a GPU/Many-Core Kernel executable. one or more database tables 103 that Stored Procedure. [0025] FIG. GPU/Many-Core device. [0039] GPU/Many-Core Kernel Stored procedure means a database stored procedure or User De?ned Function that can be called and run as a sub -routine from a database query. query and cache the metadata information on the GPU/Many-Core data types. GPU/ Many-Core environment. [0016] Other features. the present invention Will be better understood by reference to several specialized terms and concepts. 8 illustrates the sequence of events required to execute the query and return the results. and b) executing the particular stored procedure on one or more records in order to combine results from multiples devices or GPU/Many-Core devices. platform and device information is queried. the executed program instructions multiple Kernel executions. the paralleliZed query including an operation using a particular stored procedure available to the database server [0030] FIG. and [0032] FIG. It provides a mecha nism via APIs to discover and manage a number of GPU/ steps required to determine the GPU platforms and devices available to the database. 5 illustrates hoW the GPU/Many-Core Stored Procedure are compiled for multiple devices and the results are caches for use during the execution phase. [0018] FIG. [0035] In the context of this patent application. 1. [0022] FIG. including the speci?cation. [0040] FIG. the method including a) executing a paralleliZed query against a database using a database server. 1 illustrates the major components of a GPU Accelerated Database system With the principal data ?oWs betWeen these components. a database server 102 that executes the queries. [0037] GPU/Many-Core device means a specialized com puter processor that is capable of performing many parallel operations. It shoW the vides support for compiling.US 2012/0259843 A1 Oct. 3 illustrates the steps require to create the memory pools. and claims. DETAILED DESCRIPTION OF THE INVENTION executing a method. With each GPU/Many-Core device 106 including: a plu . [0024] FIG. [0015] A computer program product comprising a com puter readable medium carrying program instructions for GPU acceleration of a database system When executed using a computing system. [0021] FIG. further illustrate the concepts include: database. [0023] FIG. 12 illustrates hoW the siZe of an output argu ment is determined parametrically. and advantages of the present invention Will be apparent upon a revieW of the present disclosure. compiles and links GPU Kernel code and runs GPU Kernel code on one or more GPU devices accessible to data base system 100. an application 101 that runs queries against a database. 10 illustrates hoW the number threads in deter FIG. 11. 2 illustrates the high level How charts of the comprised of softWare programs that manage the creation. Database system 100 includes a number of components. [0036] Database means a database management system present invention and. 11 illustrates hoW a single element array is mined When using the systems dynamic parallelism method. Thus. One or more GPU/Many-Core devices 106 [0029] FIG. 9 illustrates hoW the method of determining hoW the number of parallel threads in speci?ed for the pro store persistent database information. includes an illustrative representation of an overall architecture of a GPU Kernel. and stored procedure including GPU/Many-Core program Kernel executable. [0019] FIG. [0031] FIG. [0026] FIG. Whether in a graphics processor unit. 15 illustrates a ?owchart of a process using GPU Kernel argument buffers as columns in database roWs or that includes a GPU/Many-Core Kernel executable. in Which like reference With the principles and features described herein. 7 illustrates hoW metadata is passed to the accelerated database system 100. the paralleliZed query including an operation using a particu lar stored procedure available to the database server that [0033] Embodiments of the present invention provide a system and method for processing data stored in database With GPU and Many-Core System in a highly paralleliZed manner. the present invention is not intended to be limited to the embodi ment shoWn but is to be accorded the Widest scope consistent GPU/Many-Core devices. FIG. maintenance and used of computeriZed data and Will include indexed ?le systems and the like. draWings. a multicore microprocessor. [0027] [0028] FIG. devices. [0034] Various modi?cations to the preferred embodiment and the generic principles and features described herein Will be readily apparent to those skilled in the art. bene?ts. 14 illustrates hoW the environment. 2012 [0014] A computer-implemented method for GPU accel eration of a database system. and b) executing the particular stored procedure on one or more requirements. 6 illustrates the steps required for the valida Many-Core device. [0020] FIG. platform and device information is changed. These specialiZed terms and numerals refer to identical or functionally-similar elements throughout the separate vieWs and Which are incorporated in and form a part of the speci?cation. a database stored pro cedure function manager 104 that is responsible for executing Stored Procedures. and executes on a GPU/Many Core device. serve to explain the principles of the present invention. loading and running GPU/Many Core Kernel Subroutines. 1 illustrates a set of components of a GPU tion of arguments and mapping arguments types betWeen the database Stored Procedure and the GPU/Many-Core program accelerated database system along With representation of data ?oWs betWeen this set of components. 4 illustrates the sequence of operation required to create the environment for running GPU code. the method includes a) execut ing a paralleliZed query against a database using a database server. linking. 13 illustrates hoW the environment. are computationally communicated to GPU/Many-Core Host 105.

else a seventh step 407 determines Whether there are more vendor platforms to pro cess. and a fourth step 404 obtains a count of devices for the GPU/Many-Core Kernel code. procedure. A third step 403 obtains properties of each platform. This term is spe each platform. The database programmer is able to e?iciently de?ne and use the GPU/Multi-Core environment Without many of the chal object codes. process 400 returns to third step 403 is ci?cally used to refer to creation of the stored procedure by compilation and linking of appropriate libraries and the like. steps determining the GPU platforms and devices available to database system 100. database system 100 con?gures itself to enumerate and de?ne the GPU/Many-Core environment. [0047] FIG. [0044] In some cases. and a neW pool is created.g. [0041] Database system 100 alloWs a database programmer Who is coding a database program/ query for use in a parallel environment to access GPU/Many-Core devices using a more familiar database paradigm to alloW simpler and more e?i cient coding and use of these devices. A second step 206 runs the GPU/Many-Core Ker nel code. FIG. A ?fth step 405 obtains device data. If there are. a paralleliZed query and cache metadata infor mation on the GPU/Many-Core data types. Some of the powerful features of these environment. Platform and Device properties and present the results as database tables or records.g. Platform and Devices. executing. A system may include several plat forms and devices from one or more vendors. the description refers to “obtaining” a stored procedure or similar general term. otherWise process 400 performs eighth step 408 and creates a memory context for all the devices. Managing data base server 102 and GPU/Many-Core Host 105 environment in compatible and complementary methods is achieved by allocating memory in multiple pools. Devices. The pool is de-allocated after Kemel execution completes. each having one or more Arithmetic Logic Units (ALUs) that execute the Kernel instructions. and a sixth step 406 determines Whether there are more devices. If so. A third step 207 returns the results as database tables or records to the applications.. The second phase for database system 100 is compilation/access of any special stored procedures speci?c for the GPU/Many-Core environ ment. A pool is created When a for Kernel execution.US 2012/0259843 A1 Oct. a GPU memory 1 08 (e. The pools are de allocated When a Kemel lenges associated With the conventional GPU/Many-Core programming model. These phases include a con?guration phase. 2 Buffer Pool Stores buffers program is changed or recompiled. Upon initialiZation. Thereafter pro by a predetermined address or reference. 4 is an illustrative ?oW chart 400 of [0043] An executing a database query With stored proce dure Work?oW includes a sequence of processes. executed. 1. 2 illustrates high level processes of major phases of database system 100 illustrated in FIG. metadata and various other database stops executing. 2012 rality of GPU Compute Units 107. Queues. Platform and Device properties and present the results as database tables or records. RAM and the like) that stores the GPU’s data and variables. such as multiple Kernel When the database stops executions. as Well as access of a precompiled/linked procedure. A ?rst step 205 in this Work?oW steps to execute a query With a stored Work How steps to create GPU/Many-Core Environment. The pool is de-allocated When the stored procedures appropriate for the speci?c GPU/Many Core environment. A ?rst step 301 establishes one or more memory pools. [0046] FIG. and an execution stage. A com piling programs on multiple devices Work?oW includes a process 202 to obtain (e. The third phase includes execution of the code using the Memory Pool Name Device Pool Description Stores object related to the GPU Host Pool Object Lifetime The pool objects exist Whilst the database is running. 4 illustrates a sequence of operation required to create an environment for running GPU code. A creating GPU/Many-Core Environment Work?oW process include a step 201 to create the GPU/ Many-Core Environment inside database server 102. Platforms. Contexts. such as repeated. A pool is created at start up time. A setting environment and device properties Work?oW includes a process 204 to step 302 queries a database system metadata store for infor mation about special types used by the Kernel as metadata and GPU speci?c data types. 3 illustrates a sequence of steps for creation of memory pools. process 400 repeats ?fth step 405.. A fourth step 208 releases any resources that Were used in executing the query and running [0048] A ?rst step 401 initialiZed a GPU/Many-Core host environment and a second step 402 determines a number of vendor platforms. . compile and link or access. that are no longer needed. A second dynamically linked library or pre-compiled executable) GPU/Many-Core Kernel programs on multiple devices. Preferred embodiments of the present invention restructure the conventional ad hoc [0045] FIG. Each pool has a speci?c life that is dependent on the type of object allocated in the pool as further explained in Table I. FIG. TABLE I A Table Describing Various Memory Pools programming approach into a more e?icient GPU paradigm that includes three distinct phases that are uncoupled from other phases. embodiments include i) storage of GPU/Many-Core environ ment parameters in a manner that appears as database tables long life objects Program Pool Stores the Kemel source and The objects are created When a kernel is compiled or Within the database so the programmer may easily dynami cally adapt the database code for optimal use of the GPU/ Many-Core environment and ii) use of GPU/Many-Core spe ci?c code objects Within the database as stored procedures. Retained Pools Stores buffers to be used across Kernel is executed. A third step caches the metadata for these types in the GPU Host environment for future use during any Kernel compilation and the Kernel execution steps. A querying for environment and device properties Work?oW includes a process 203 to query the GPU/Many-Core Envi ronment. a compile phase. 11. It represents update or change GPU/Many-Core Environment. Platform and Devices. 300 represents a Work?oW to create the GPU/Many-Core environment. The pool is de-allocated represents various high level components 200 and their high level ?oWcharts. [0042] FIG. 3. Memory pools are a technique in managing memory support dynamic memory allocation in ?xed siZed pools that limits memory fragmen tation.

Flowchart 900 includes steps 901-906. [0051] FIG. 5 illustrates how a GPU/Many-Core Stored Procedure is compiled for multiple devices and the results are cached for use during an execution phase. and a step 808 converts the data to database types. The database stored procedure declara tions use a well-de?ned standard language or API. Thereafter. So to avoid the potential problem of having incompatible code. [0052] FIG. When there are no errors at second step 502. a step 803 binds the program to be compiled against. language to declare kernel bindings. 605. If there are more arguments. GPU/ Many-Core devices are massively parallel device that may incorporate from 32 to 2000 ALU cores. Kernel code compiled on one device type may not be compatible with another device type. A ?rst step 501 compiles a program for a particular one device and a second step 502 determines whether there are compilation errors. One for the database in the database language or APl’s. Database system 102 may be able to access many different kinds GPU/Many Core devices. So. The number of threads can be determined in a number of ways. the process advances to third step 703 where the argument is processed as a metadata type. with the process concluding when there are no more arguments. 8 is an illustrative ?owchart 800 of a process executing a program binary in the Program Memory Pool. a fourth step 604 determines a correspondence of metadata attributes of the arguments and a ?fth step 605 determines whether the correspondence is suf?cient. TABLE II A Table ofParallel Mode Settings more arguments. the process performs seventh step 607 to reports the error to the system. Embodi for validating and mapping arguments between database stored procedures and GPU/Many-Core Kernel routines. 11. A step 809 formats the data for the database. and a second step 702 determines whether the argument’s type is a meta data type. arguments of the database stored procedure are compatible with the GPU Kernel code. DYNAMIC The Database will determine the number threads based on inspection of the Kernel arguments sizes and meta data provided to the Kernel. 7 illustrates how metadata is passed to the Stored Procedure. A GPU Kernel may be run on each kind of device. 5 is an illustrative ?owchart 500 of a work?ow for communicating metadata information between a Stored Procedure declaration and a GPU Kernel declaration. One for the GPU/Many-Core Kernel language. The choice of method is speci?ed via anAPl call that can be used from the database. [0049] FIG. a step 802 copies or transfers data from the database to a GPU device. the process returns to ?rst step 701 and when there are no more to compile each kernel program for each device. so in order to prevent errors at run-time when the Stored Procedure calls the GPU Kernel it is necessary to validate arguments to ensure that arguments for the copied data. a sixth step 606 determines whether there are more arguments to process. If so. When there are ments of the present invention specify three ways of control ling the number thread used as described in Table II. second step 602 or ?fth step Name FIXED Description The number of threads used will be constant. For each Stored Procedure and GPU kernel there are two types of subroutine call declarations and bindings. 6 is an illustrative ?owchart 600 of a process [0056] FIG. the process returns to ?rst step 601. process 500 returns to ?rst step 501. [0055] FIG. 6 illustrates validation of arguments and map ping arguments types between a database Stored Procedure and a GPU/Many-Core program Kernel.US 2012/0259843 A1 Oct. and then performs the test at sixth step 606. A ?rst step 701 retrieves a next procedure argument. 2012 cess 400 concludes with a ninth step 409 which creates a [0054] FIG. When the test at second step 702 determines the type is not a metadata type. a fourth step 504 caches the query and return results from the execution of the query. the process advances to a ?fth step 705 and determines whether there are more arguments to process. A ?rst step 601 tests names and positions of the stored proce dure arguments for a match. The use of standard languages and APl’s constraints the type of information that can be communicated between the two programming lan guages without extending the language orAPl. a step 806 executes a Kernel on the GPU device. [0053] FIG. After both third step 703 and fourth step 704. Kernels are compiled for all the different types of devices. When correspon dence is su?icient at ?fth step 605. a step 810 returns the results as database rows or records to the application. a third step maps the types between the database and the GPU kernel language. and a step 804 determines how the mode of parallelism is de?ned. a step 807 copies or transfers data from the GPU device to the Host. It’s speci?ed in the Kernel source code. 9 is an illustrative ?owchart 900 of a process for controlling determination of the number of parallel threads. When they are equal. . When the test at second step 702 determines the type as a metadata type. Each programming language has its own set of data types and metadata attributes. It’s speci?ed via an API call. [0050] FIG. FIG. When there are errors at ?rst step 601. Step 901 sets the mode and step 902 determines whether the parallel mode ming languages metadata types have been developed to com municate meta information at compile and run time. a second step 602 checks that the data types match. The sequence of events includes steps 801-811. process 500 arguments. 9 illustrates how a process determining how a number of parallel threads is speci?ed for execution. The GPU Kernel declaration also uses its own well de?ned standard KERNEL The number of threads used will be constant.A ?fth step 505 determines whether there are more devices the program needs database stored procedure query and returning the results to the calling application. A step 805 determines a number of parallel threads to be used. the process concludes. the process advances to fourth step 704 where the pro gram data argument is processed as a program data argument. and a step 811 releases resources that are not to be retained for a future execution. In case there are errors at second step 502. A particular number of these cores used for program execution is determined by a number of parallel Kernel threads launched. When the types match at second step 602. in order to communicate additional metadata between the two pro gram [0057] FIG. otherwise this work?ow ends. 8 illustrates a sequence of events to execute a performs a third step 503 which reports the errors. A step 801 establishes a run-time environment for database system 100. 7 is an illustrative ?owchart 700 of a process command queue for each device.