# US 2010/0250564 A1 · Translating a comprehension into code for execution on a single instruction, multiple data (simd) execution

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2010/0250564 A1
- Document ID: US20100250564A1
- Status: Published application
- Kind: A1
- Application number: 12/413,780
- Filed: 2009-03-30
- Published: 2010-09-30
- Earliest claimed: 2009-03-30
- Assignees: Microsoft Corporation
- Inventors: Amit Agarwal; Igor Ostrovsky; John Duffy; Vivan Sewelson
- Web page: https://patentgrep.com/patent/US20100250564A1

## CPC

- G06F 8/41: Compilation
- G06F 8/30: Creation or generation of source code
- G06F 16/24524: {Access plan code generation and invalidation; Reuse of access plans}
- G06F 16/24532: {of parallel queries}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method of translating a comprehension into executable code for execution on a SIMD (Single Instruction, Multiple Data stream) execution unit, includes receiving a user specified comprehension. The comprehension is compiled into a first set of executable code. An intermediate representation is generated based on the first set of executable code. The intermediate representation is translated into a second set of executable code that is configured to be executed by a SIMD execution unit.

## Claims

### Claim 1

A method of translating a comprehension into executable code for execution on a SIMD (Single Instruction, Multiple Data stream) execution unit, comprising:
receiving a user specified comprehension;
compiling the comprehension into a first set of executable code;
generating an intermediate representation based on the first set of executable code; and
translating the intermediate representation into a second set of executable code that is configured to be executed by a SIMD execution unit.

### Claim 2 (depends on 1)

The method of claim 1, wherein generating an intermediate representation comprises:
executing the first set of executable code, thereby generating a data structure; and
translating the data structure into an execution graph.

### Claim 3 (depends on 1)

The method of claim 1, wherein the comprehension is a language integrated query.

### Claim 4 (depends on 1)

The method of claim 1, wherein the comprehension comprises at least one operator and at least one expression parameter for the at least one operator.

### Claim 5 (depends on 2)

The method of claim 2, wherein the generated data structure is representative of the comprehension.

### Claim 6 (depends on 2)

The method of claim 2, wherein the generated data structure comprises at least one operator tree and at least one associated expression tree.

### Claim 7 (depends on 2)

The method of claim 2, wherein the execution graph comprises a directed acyclic graph (DAG).

### Claim 8 (depends on 1)

The method of claim 1, wherein the comprehension is specified in a high-level programming language.

### Claim 9 (depends on 1)

The method of claim 1, wherein the SIMD execution unit is a graphical processing unit (GPU), and wherein the method further comprises:
analyzing the comprehension; and
determining whether to execute the comprehension on a CPU, a GPU, or both the CPU and the GPU based on the analysis of the comprehension.

### Claim 10 (depends on 9)

The method of claim 9, and further comprising:
executing a first portion of the comprehension on a CPU; and
executing a second portion of the comprehension on a GPU.

### Claim 11 (depends on 10)

The method of claim 10, wherein the first and second portions of the comprehension are executed concurrently.

### Claim 12

A computer-readable storage medium storing computer-executable instructions for performing a method, comprising:
receiving a user specified language integrated query comprising at least one operator and at least one expression parameter for the at least one operator;
compiling the query into a first set of executable code;
executing the first set of executable code, thereby generating a data structure;
translating the data structure into an execution graph; and
translating the execution graph into a second set of executable code that is configured to be executed by a GPU.

### Claim 13 (depends on 12)

The computer-readable storage medium of claim 12, wherein the generated data structure is representative of the query.

### Claim 14 (depends on 12)

The computer-readable storage medium of claim 12, wherein the generated data structure comprises at least one operator tree and at least one associated expression tree.

### Claim 15 (depends on 12)

The computer-readable storage medium of claim 12, wherein the execution graph comprises a directed acyclic graph (DAG).

### Claim 16 (depends on 12)

The computer-readable storage medium of claim 12, wherein the query is specified in a high-level programming language.

### Claim 17 (depends on 16)

The computer-readable storage medium of claim 16, wherein the high-level programming language is C#.

### Claim 18

A method of executing a query, comprising:
receiving a user specified language integrated query comprising at least one operator and at least one expression parameter for the at least one operator;
compiling a first portion of the query into a first set of executable code;
executing the first set of executable code, thereby generating a data structure;
translating the data structure into an execution graph;
translating the execution graph into a second set of executable code that is configured to be executed by a GPU; and
translating a second portion of the query into a third set of executable code that is configured to be executed by a CPU.

### Claim 19 (depends on 18)

The method of claim 18, wherein the generated data structure comprises at least one operator tree and at least one associated expression tree.

### Claim 20 (depends on 18)

The method of claim 18, wherein the execution graph comprises a directed acyclic graph (DAG).
