发明名称 |
Method and apparatus for compiler processing for a function marked with multiple execution spaces |
摘要 |
A method for processing a function with a plurality of execution spaces is disclosed. The method comprises creating an internal compiler representation for the function. Creating the internal compiler representation comprises copying substantially all lexical tokens corresponding to a body of the function. Further, the creating comprises inserting the lexical tokens into a plurality of conditional if-statements, wherein a conditional if-statement is generated for each corresponding execution space of said plurality of execution spaces, and wherein each conditional if-statement determines which execution space the function is executing in. During compilation, the method finally comprises performing overload resolution at a call site of an overloaded function by checking for compatibility with a first execution space specified by one of the plurality of conditional if-statements, wherein the overloaded function is called within the body of the function. |
申请公布号 |
US9229698(B2) |
申请公布日期 |
2016.01.05 |
申请号 |
US201314089542 |
申请日期 |
2013.11.25 |
申请人 |
NVIDIA CORPORATION |
发明人 |
Marathe Jaydeep |
分类号 |
G06F9/45 |
主分类号 |
G06F9/45 |
代理机构 |
|
代理人 |
|
主权项 |
1. A method for processing a function with a plurality of execution spaces comprising:
creating an internal compiler representation for said function, wherein said creating comprises:
copying substantially all lexical tokens corresponding to a body of said function; andinserting said lexical tokens into a plurality of conditional if-statements, wherein a conditional if-statement is generated for each corresponding execution space of said plurality of execution spaces, and wherein each conditional if-statement determines which execution space said function is executing in; and during compilation, performing overload resolution at a call site of an overloaded function by checking for compatibility with a first execution space specified by one of said plurality of conditional if-statements, wherein said overloaded function is called within said body of said function. |
地址 |
Santa Clara CA US |