US2019196797A1PendingUtilityA1
System and method for compiler support for compile time customization of code
Est. expiryDec 29, 2034(~8.5 yrs left)· nominal 20-yr term from priority
G06F 8/51G06F 8/41G06F 8/47
55
PatentIndex Score
0
Cited by
0
References
0
Claims
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.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method comprising:
identifying, by a processor, whether a portion of source code comprises a device lambda expression; creating, based on the device lambda expression, a unique instantiation; and modifying the device lambda expression based on the unique instantiation.
2 . The method of claim 1 , wherein the device lambda expression is associated with a device code entry function template instantiation.
3 . The method of claim 1 , wherein the unique instantiation comprises a type associated with a function enclosing the device lambda expression.
4 . The method of claim 3 , wherein the unique instantiation comprises an address of the function enclosing the device lambda expression.
5 . The method of claim 1 , wherein the unique instantiation comprises a unique identifier associated with the device lambda expression.
6 . The method of claim 1 further comprising modifying the source code using the modified device lambda expression
7 . The method of claim 1 , wherein the unique instantiation includes one or more variables, and wherein the unique instantiation captures the one or more variables by explicitly passing the values of the one or more variables to a constructor of the unique instantiation.
8 . The method of claim 1 further comprising:
identifying a device code entry function template specialization based on the unique instantiation, wherein the source code comprises a device code entry function template; and
modifying the device code entry function template based on the device code entry function template specialization.
9 . A system comprising:
a device lambda expression identification module configured to identify a device lambda expression in a portion of source code; a constructor module configured to create, based on the device lambda expression, a unique instantiation; and a code modification module configured to modify the source code to replace the device lambda expression with the unique instantiation.
10 . The system of claim 9 further comprising:
a template specialization determination module configured to identify a device code entry function template specialization based on the device lambda expression.
11 . The system of claim 10 , wherein the code modification module is further configured to modify the source code based on the device code entry function template specialization.
12 . The system of claim 9 further comprising:
a sending module configured to send the modified source code to a host compiler.
13 . The system of claim 9 , wherein the unique instantiation comprises a type associated with a function enclosing the device lambda expression.
14 . The system of claim 13 , wherein the unique instantiation comprises an address of the function enclosing the device lambda expression.
15 . The system of claim 9 , wherein the unique instantiation comprises a unique identifier associated with the device lambda expression.
16 . The system of claim 9 , wherein the source code comprises host source code and device source code.
17 . The system of claim 9 , wherein the unique instantiation includes one or more variables, and wherein the unique instantiation captures the one or more variables by explicitly passing the values of the one or more variables to a constructor of the unique instantiation.
18 . A method comprising:
identifying, by a processor, whether a portion of source code comprises a device lambda expression; creating, based on the device lambda expression, a unique instantiation; and generating a device code entry function template based on the unique instantiation.
19 . The method of claim 18 , wherein the unique instantiation comprises a type associated with a function enclosing the device lambda expression.
20 . The method of claim 19 , wherein the unique instantiation comprises an address of the function enclosing the device lambda expression and a unique integer associated with the device lambda expression.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.