[cfe-commits] [PATCH] OpenCL inline calls have internal linkage

Douglas Gregor dgregor at apple.com
Fri Jun 22 08:22:32 PDT 2012


On Jun 21, 2012, at 5:07 PM, Tanya Lattner wrote:

> 
> On Jun 14, 2012, at 4:15 AM, Anton Lokhmotov <Anton.Lokhmotov at arm.com> wrote:
> 
>> Hi Tanya,
>> 
>>> In OpenCL inline calls without a specified storage class should have
>>> internal linkage. The attached patch makes this modification and adds a
>>> test case.
>> 
>> If this is OpenCL 1.2 specific, it should be guarded on a new language
>> option OpenCL_1_2 [1].
>> 
> 
> A "recent" change in Clang caused functions that are not marked with extern inline to only include the definition for inlining. This was to adhere more closely to the C99 standard (as far as I know). This also changed the behavior for OpenCL which is a problem for us. When you have a kernel that uses some function that is marked "inline" and doesn't get inlined because its too large, the function body no longer exists. I would imagine that other OpenCL framework implementors would also be upset at this change as well.
> 
> After discussing offline, it would be better if OpenCL followed C++ semantics here instead of C99 and my patch should be modified. But this is technically not in the spec. 


Will someone be taking this to the OpenCL committee? A general agreement among implementors is good, but the OpenCL specification needs to codify the semantics of 'inline'.

	- Doug



More information about the cfe-commits mailing list