[cfe-dev] [OpenCL patch] Half type as native when OpenCL's cl_khr_fp16 extension is enabled

Timo Viitanen viitanet at gmail.com
Mon Jan 14 13:49:31 PST 2013


Hi,

We are working on adding cl_khr_fp16 extension support to pocl
(https://launchpad.net/pocl) based on this patch. FWIW it would be very
helpful to us to have this patch committed to trunk. It has worked without
problems so far.


-- 
Timo Viitanen
Research assistant, Department of Pervasive Computing, Tampere University of
Technology




Anton Lokhmotov wrote
> Hi Doug,
> 
>> > While the conformance tests are not sacred, it can be argued that the
>> > composition of '&' and '[]' should result in half*, so should not be
>> > rejected.  Unfortunately, we found no obvious way to implement this 
>> > in Clang, so leave this case as TODO.
>> 
>> One way to handle the "storage-only" version is for buffer[index] to
>> produce a non-modifiable lvalue (so you can't write it) and to ban the
>> lvalue-to-rvalue conversion for such a value (for the latter, see
>> Sema::DefaultLValueConversion).
> 
> We've tried to implement your proposal, but ended up with putting
> OpenCLOptions into ASTContext, which is not the cleanest of solutions.  If
> it's the only problem with this patch, would it be possible to commit it
> as-is?  Meanwhile, we'll try to come up with a better solution (fixing the
> FIXMEs).
> 
> Many thanks,
> Anton.





--
View this message in context: http://clang-developers.42468.n3.nabble.com/Re-OpenCL-patch-Half-type-as-native-when-OpenCL-s-cl-khr-fp16-extension-is-enabled-tp3980492p4029735.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list