System and method for compiler support for compile time customization of code

US2016188352A1 · US · A1

Patent metadata
FieldValue
Publication numberUS-2016188352-A1
Application numberUS-201514968740-A
CountryUS
Kind codeA1
Filing dateDec 14, 2015
Priority dateDec 29, 2014
Publication dateJun 30, 2016
Grant date

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

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.

First claim

Opening claim text (preview).

What is claimed is: 1 . A method of processing source code, the method comprising: accessing a portion of host source code; determining 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 a unique placeholder type instantiation based on the device lambda expression; modifying the device lambda expression based on the unique placeholder type instantiation to produce modified host source code; and making the modified host source code available to a host compiler. 2 . The method as described in claim 1 , wherein the device lambda expression is associated with a device code entry function template instantiation. 3 . The method as described in claim 1 , wherein the unique placeholder type instantiation comprises a type associated with a function enclosing the device lambda expression. 4 . The method as described in claim 3 , wherein the unique placeholder type instantiation comprises an address of the function enclosing the device lambda expression. 5 . The method as described in claim 1 , wherein the unique placeholder type instantiation comprises a unique identifier associated with the device lambda expression. 6 . The method as described in claim 1 , wherein the unique placeholder type instantiation comprises one or more variables associated with the device lambda expression. 7 . The method as described in claim 6 , wherein the unique placeholder type instantiation captures the one or more variables associated with the device lambda expression by explicitly passing the values of the one or more variables to a constructor of the placeholder type instantiation. 8 . The method as described in claim 1 further comprising: determining a device code entry function template specialization based on the unique placeholder type instantiation associated with the device lambda expression, wherein the host 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 for compiling code, the system comprising: a code access module operable to access source code from a data store, wherein the source code comprises host source code and device source code; a device lambda expression identification module configured to identify a device lambda expression in a portion of the host source code; a placeholder type determination module configured to determine a placeholder type instantiation based on the device lambda expression; and a code modification module configured to modify the host source code to replace the device lambda expression with the placeholder type instantiation. 10 . The system as described in claim 9 further comprising: a template specialization determination module configured to determine a device code entry function template specialization based on the device lambda expression. 11 . The system as described in claim 10 , wherein the code modification module is further configured to modify the host code based on the device code entry function template specialization determined by the template specialization determination module. 12 . The system as described in claim 9 further comprising: a code sending module configured to send the host source code as modified by the code modification module to a host compiler. 13 . The system as described in claim 9 , wherein the placeholder type instantiation comprises a type associated with a function enclosing the device lambda expression. 14 . The system as described in claim 13 , wherein the placeholder type instantiation comprises an address of the function enclosing the device lambda expression. 15 . The system as described in claim 9 , wherein the placeholder type instantiation comprises a unique identifier associated with the device lambda expression. 16 . The system as described in claim 9 , wherein the placeholder type instantiation comprises one or more variables associated with the device lambda expression. 17 . The system as described in claim 9 , wherein the placeholder type instantiation captures the one or more variables associated with the device lambda expression by explicitly passing the values of the one or more variables to a constructor of the placeholder type instantiation. 18 . A method for modifying code for compilation comprising: accessing a portion of host source code; determining whether the portion of the host source code comprises a device lambda expression associated with a device code entry function template instantiation; determining a unique placeholder type instantiation based on device lambda expression; determining 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; and generating modified host source code by replacing the device lambda expression with an instance of the unique placeholder type instantiation; generating a device code entry function specialization based on the unique placeholder type instantiation; and making the modified host source code available to a host compiler. 19 . The method as described in claim 18 , wherein the unique placeholder type instantiation comprises a type associated with a function enclosing the device lambda expression. 20 . The method as described in claim 19 , wherein the unique placeholder instantiation comprises an address of the function enclosing the device lambda expression and a unique integer identified associated with the device lambda expression.

Assignees

Inventors

Classifications

  • G06F8/41Primary

    Compilation · CPC title

  • Source to source · CPC title

  • Compiler construction; Parser generation · CPC title

  • Code distribution (considering CPU load at run-time G06F9/505; load rebalancing G06F9/5083) · CPC title

  • Runtime code conversion or optimisation · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US2016188352A1 cover?
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 d…
Who is the assignee on this patent?
Nvidia Corp
What technology area does this patent fall under?
Primary CPC classification G06F8/41. Mapped technology areas include Physics.
When was this patent published?
Publication date Thu Jun 30 2016 00:00:00 GMT+0000 (Coordinated Universal Time) (A1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 3 related publications on this page (citations in our corpus or others sharing the same primary CPC).