[Libclc-dev] libclc + llvm: enabling extensions

Tom Stellard tom at stellard.net
Mon Jan 19 06:43:29 PST 2015


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

> 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




More information about the Libclc-dev mailing list