[PATCH] D89372: [OpenCL] Remove unused extensions

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 14 09:26:09 PDT 2020


Anastasia added a comment.

In D89372#2330217 <https://reviews.llvm.org/D89372#2330217>, @yaxunl wrote:

> With this change, clang basically will have no knowledge about the removed extensions, i.e., it will not know which extension is supported in which version of OpenCL and have no way to enable/disable those extensions. There will be no way to define corresponding macros in clang.
>
> Basically the responsibility of defining those macros will be shifted to OpenCL runtime for JIT and shifted to users for offline compilation. They need to have knowledge about which extensions are supported in which version of OpenCL and which cpu/platform supports them. I am not sure whether this is the direction we want to move to.

But why do you think anyone would need to use those macros in OpenCL C?

Let's take `cl_khr_icd` as an exmaple: https://www.khronos.org/registry/OpenCL//sdk/2.2/docs/man/html/cl_khr_icd.html

`cl_khr_icd - Extension through which the Khronos OpenCL installable client driver loader (ICD Loader) may expose multiple separate vendor installable client drivers (Vendor ICDs) for OpenCL.`

Why would anyone need any macro while compiling OpenCL C code for this functionality. It is dialing with the driver loader that runs on the host before compiling anything.

I believe that the addition of such extensions into the kernel language are accidental and we should trying to improve this. There is no need to have something that isn't needed. We have neough code and complexity to maintain that is useful. Let's try to simplify by at lesst removing what is not needed.

On a separate note the extensions that need macro definition and don't require the functionality in the clang parsing also doesn't have to be in the clang source code. I have mentioned it in my RFC as well: http://lists.llvm.org/pipermail/cfe-dev/2020-September/066911.html


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89372/new/

https://reviews.llvm.org/D89372



More information about the cfe-commits mailing list