[PATCH] D23712: [OpenCL] Override supported OpenCL extensions with -cl-ext option

Andrew Savonichev via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 20 04:57:35 PDT 2016


asavonic added a comment.

Hi @Anastasia,

Sorry for my late reply.

> > > What would be the use case to override the supported extensions for the end user?

> 

> > 

> 

> > 

> 

> > Some extensions may be supported by the platform in general, but not by the

> 

> >  specific version of the OpenCL runtime.

> 

> 

> Would triple not be suitable in this case, because they include OS/RT information?


This can be achieved with a custom triple, yes, but it is not a flexible solution. 
We need to create a triple for every combination of extensions. If we want to change it, we need to modify the clang source code and recompile it.

I think it is better to have a default set of extensions (from target triple) and allow user to tweak it without creating one more triple.

So instead of:

  clang -cc1 -triple spir-unknown-intel-skl-nofp64-nofp16 <...>

we could write:

  clang -cc1 -triple spir-unknown-unknown -cl-ext=-cl_khr_fp64,-cl_khr_fp16 <...>

Both have the same result, but the latter one is more flexible and it can be changed without changing the clang code.


https://reviews.llvm.org/D23712





More information about the cfe-commits mailing list