System and method for compiler support for compile time customization of code
First Claim
Patent Images
1. A method of processing source code, the method comprising:
- accessing, by a processor of a computing device, a portion of host source code, the portion of host source code being stored in a data store;
determining, by the processor, whether the portion of the host source code comprises a device lambda expression;
in response to the portion of host code comprising the device lambda expression, determining, by the processor, a unique placeholder type instantiation based on the device lambda expression, wherein the unique placeholder type instantiation comprises one or more variables associated with the device lambda expression;
modifying, by the processor, the device lambda expression based on the unique placeholder type instantiation to produce modified host source code; and
sending the modified host source code to a host compiler executed by the processor.
1 Assignment
0 Petitions
Accused Products
Abstract
A system and method for processing source code for compilation. The method includes accessing a portion of host source code and determining whether the portion of the host source code comprises a device lambda expression. The method further includes in response to the portion of host code comprising the device lambda expression, determining a unique placeholder type instantiation based on the device lambda expression and modifying the device lambda expression based on the unique placeholder type instantiation to produce modified host source code. The method further includes sending the modified host source code to a host compiler.
25 Citations
18 Claims
-
1. A method of processing source code, the method comprising:
-
accessing, by a processor of a computing device, a portion of host source code, the portion of host source code being stored in a data store; determining, by the processor, whether the portion of the host source code comprises a device lambda expression; in response to the portion of host code comprising the device lambda expression, determining, by the processor, a unique placeholder type instantiation based on the device lambda expression, wherein the unique placeholder type instantiation comprises one or more variables associated with the device lambda expression; modifying, by the processor, the device lambda expression based on the unique placeholder type instantiation to produce modified host source code; and sending the modified host source code to a host compiler executed by the processor. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A system for compiling code, the system comprising:
-
a code access module instantiated by a processor of a computing device and operable to access source code from a data store of the computing device, wherein the source code comprises host source code and device source code; a device lambda expression identification module instantiated by a processor of the computing device and configured to identify a device lambda expression in a portion of the host source code; a placeholder type determination module instantiated by a processor of the computing device and configured to determine a placeholder type instantiation based on the device lambda expression, wherein the placeholder type instantiation comprises one or more variables associated with the device lambda expression; and a code modification module instantiated by a processor of the computing device and configured to modify the host source code to replace the device lambda expression with the placeholder type instantiation. - View Dependent Claims (9, 10, 11, 12, 13, 14, 15)
-
-
16. A method for modifying code for compilation comprising:
-
accessing, by a processor of a computing device, a portion of host source code in a data store of the computing device; determining, by the processor, whether the portion of the host source code comprises a device lambda expression associated with a device code entry function template instantiation; determining, by the processor, a unique placeholder type instantiation based on device lambda expression, wherein the unique placeholder type instantiation comprises one or more variables associated with the device lambda expression; determining, by the processor, a device code entry function template specialization based on the unique placeholder type instantiation, wherein the host source code comprises a device code entry function template; generating, by the processor, modified host source code by replacing the device lambda expression with an instance of the unique placeholder type instantiation; generating, by the processor, a device code entry function specialization based on the unique placeholder type instantiation; and sending the modified host source code to a host compiler executed by the processor. - View Dependent Claims (17, 18)
-
Specification