Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 04 Sep 2015 12:53:57 +0200
From: magnum <>
Subject: Re: OpenCL static/inline

On 2015-09-03 21:52, Solar Designer wrote:
> On Wed, Sep 02, 2015 at 08:06:18PM +0200, magnum wrote:
>> Most/all drivers I know of will always inline, no matter what keyword
>> you write (or don't write). Many drivers will quitely do this regardless
>> of static and/or inline keywords. But more importantly, some drivers
>> will not accept 'static' (neither with nor without 'inline') and others
>> will demand either 'static' or 'inline' (but the result is still inline).
>> So the bottom line afaik is we should declare all and any functions in
>> kernels as 'inline' (and not 'static'), for portability. Your recent
>> patch to cryptmd5 kernel used 'static inline' and I had to change them
>> to just 'inline' in order to get them working on [iirc] some semi-old
>> Intel driver.
> Oh, OK.  Let's standardize on just "inline" for now.
> It is not true that all drivers will always inline, though.  Most of the
> time yes, but not always.  I've already posted a counter-example in
> here, for some functions in Agnieszka's Argon2 kernels on NVIDIA.

No but I think they will always try to. If the PTX build output mentions 
a "stack frame", you got an actual function, someone said. That's often 
considered a bad thing and I think it happens independently of any use 
of "inline" but I may be wrong.

BTW you can use a __kernel function as a non-inlined function (call it 
from another kernel). That is a surefire way to NOT inline but I haven't 
tried it.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.