[cfe-dev] Implementing OpenMP function variants

John McCall via cfe-dev cfe-dev at lists.llvm.org
Wed Dec 18 12:18:24 PST 2019

On 18 Dec 2019, at 15:02, Doerfert, Johannes wrote:
> On 12/18, John McCall wrote:
>> On 18 Dec 2019, at 14:25, Doerfert, Johannes wrote:
>>> On 12/18, John McCall wrote:
>>>> On 18 Dec 2019, at 11:16, Doerfert, Johannes wrote:
>>>>> Is there a good reason to make 5.1-type variants different from
>>>>> multi-versions (as we have them)? They do not depend on the 
>>>>> lexical call
>>>>> context but only on the compilation parameters.
>>>> Are multi-versions yet another feature?  Do they interact with this 
>>>> one?
>>> In 5.1, `begin/end declare variant` multi-version a function 
>>> basically
>>> the same way as `__attribute__((target(...)))` does. The condition 
>>> can
>>> be more than only a target though. (I mispoke earlier, it can 
>>> include
>>> call site context information). So we have multiple versions of a
>>> function, let's say "sin", and depending on the compilation target,
>>> e.g., are we compiling for nvptx or not, ans call site context, 
>>> e.g.,
>>> are we syntacitally inside a parallel region, we pick on of them. 
>>> The
>>> prototype for this reuses almost all of the multi-version code that
>>> enables the target attribute as it seemed to be the natural fit.
>> I see.  And that’s still totally statically selected at use time, 
>> right?
> Yes, as of OpenMP TR8 (Nov this year). But (to me) it is fairly 
> certain
> we'll also get an dynamic dispatch version too, maybe even this year 
> (for
> OpenMP 5.1).

A dynamic version of `__attribute__((target))`, or of variants, or both?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191218/29d718c8/attachment.html>

More information about the cfe-dev mailing list