[Libclc-dev] libclc + llvm: enabling extensions

Aaron Watry awatry at gmail.com
Mon Jan 19 11:46:16 PST 2015


On Jan 19, 2015 8:43 AM, "Tom Stellard" <tom at stellard.net> wrote:
>
> On Thu, Jan 15, 2015 at 09:42:30AM -0500, Richard Gorton wrote:
> >
> > Hi,
> >
> > I'm working with libclc/llvm, and encountered a compilation error on
generic/include/clc/clc.h
> >
> > #ifndef cl_clang_storage_class_specifiers
> > #error Implementation requires cl_clang_storage_class_specifiers
extension!
> > #endif
> >
> > Quite reasonable; as I'm investigating what goes on in LLVM3.5 I do not
see any apparent instances where the various features are turned on for a
given target.  What (if any) is the 'normal' convention used to turn the
various extensions on or off for a given target?
> >
>
> There is no convention for this, but what I would suggest is to wrap any
extended features
> in:
>
> #if feature_x
> ...
> #endif
>
> And then have either you OpenCL implementation or the target defintion in
> clang enable them by defining feature_x.
>
> This won't work for all extensions, though.  If you want to enable an
extension
> that adds a new type, you will need to make modifications to clang.
>
> -Tom

Note that in the case of storage class specifiers, I'm not sure that
defining the feature is enough.  I tried doing that in clover a while back
and that wasn't enough to enable usage of the static keyword for functions
in clc source.

I had hoped to figure that out for clover a while ago, but babies eat up
all available energy/free time.

--Aaron

>
> > Regards,
> >
> >       Richard Gorton
> >       rcgorton at cog-e.com
> > _______________________________________________
> > Libclc-dev mailing list
> > Libclc-dev at pcc.me.uk
> > http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev
>
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20150119/8341ac2f/attachment-0001.html>


More information about the Libclc-dev mailing list