[cfe-dev] [OpenCL] upstreaming khronos OpenCL header files

Anastasia Stulova via cfe-dev cfe-dev at lists.llvm.org
Tue Mar 22 11:49:18 PDT 2016


If there are no further comments to this, I think it makes sense to setup the review and continue with detailed discussions via cfe-commits.

I plan to address the PCH size issue in general as a separate thread.

Cheers,
Anastasia

From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Anastasia Stulova via cfe-dev
Sent: 10 March 2016 18:56
To: Liu, Yaxun (Sam); 'cfe-dev at lists.llvm.org' (cfe-dev at lists.llvm.org)
Cc: Stellard, Thomas; nd; Bader, Alexey (alexey.bader at intel.com); Sumner, Brian; Pan, Xiuli
Subject: Re: [cfe-dev] [OpenCL] upstreaming khronos OpenCL header files

> but it seems PCHs have even larger size by a factor of 10.
To remove any confusion in my previous email, it's actually factor of 2 (not 10!).

From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Anastasia Stulova via cfe-dev
Sent: 10 March 2016 18:16
To: Liu, Yaxun (Sam); cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
Cc: nd; Bader, Alexey (alexey.bader at intel.com<mailto:alexey.bader at intel.com>); Stellard, Thomas; Sumner, Brian; Pan, Xiuli
Subject: Re: [cfe-dev] [OpenCL] upstreaming khronos OpenCL header files

I see a benefit for the OpenCL users of open source Clang to be able to have the standard includes automatically or at least to have them in the same place as the compiler.

I am not sure if we might have some issue with their size though.

Each header is approximately 1MB large. It might be an issue not just for space but also parsing time. Using PCH would help to reduce compilation time but it seems PCHs have even larger size by a factor of 10.

For example:
  opencl-12.h  -  916K
  opencl-12.h.pch   -  1.9M

It is a bit surprising though since PCHs are stored using compressed bitstream as LLVM's bitcode file format according to the documentation page. Has anyone looked at it before? Size is generally a problem for embedded devices.

Anastasia

From: Liu, Yaxun (Sam) [mailto:Yaxun.Liu at amd.com]
Sent: 09 March 2016 19:29
To: cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
Cc: Bader, Alexey (alexey.bader at intel.com<mailto:alexey.bader at intel.com>); Sumner, Brian; Stellard, Thomas; Anastasia Stulova; Pan, Xiuli
Subject: RFC: [OpenCL] upstreaming khronos OpenCL header files

Hi,

OpenCL predefines many overloaded builtin functions ('builtin' in the sense of OpenCL spec) which are not defined in Clang. As such, to compile OpenCL kernels which call OpenCL 'builtin' functions, a header file declaring these functions is needed.

The khronos OpenCL header files can be found at these links:


https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl-20.h

https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl-12.h


I am wondering if upstreaming these header files to Clang trunk at clang/lib/Headers would save the OpenCL users the trouble of downloading these header files from different places.

Also with these header files upstreamed, we could make them implicitly included so that users do not need to include them explicitly.

Your feedback is welcome.

Thanks.

Sam

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160322/c2c314e1/attachment-0001.html>


More information about the cfe-dev mailing list