[cfe-dev] [RFC][OpenCL] Allow -cl-std and other standard -cl- options in driver

Anastasia Stulova via cfe-dev cfe-dev at lists.llvm.org
Thu Jun 2 09:30:01 PDT 2016


Sure, feel free to setup the review.

Thanks!

Anastasia

From: Liu, Yaxun (Sam) [mailto:Yaxun.Liu at amd.com]
Sent: 01 June 2016 16:04
To: Anastasia Stulova; Shi, Aaron (en ye); cfe-dev at lists.llvm.org
Cc: xiuli.pan at intel.com; alexey.bader at intel.com; richard at metafoo.co.uk; Haustov, Nikolay; nd
Subject: RE: [RFC][OpenCL] Allow -cl-std and other standard -cl- options in driver

Hi Anastasia,

We would like to let driver accept all -cl- options listed here https://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clBuildProgram.html

Currently when users use clang to compile OpenCL program to ISA, they have to pass these options with -Xclang, e.g.

Clang -Xclang -cl-kernel-arg-info a.cl

When there are many -cl options, each one needs to be preceded with -Xclang, which is very inconvenient.

We took a look of Options.td and found there are lots of -cc1 options already there which are allowed to be used with driver and passed on to -cc1 instance. Since these -cl options are frequently used by OpenCL users, I think it is reasonable to also allow driver to accept them and pass on to -cc1.

Aaron has a patch for this. Only some simple changes are needed.

Thanks.

Sam

From: Anastasia Stulova [mailto:Anastasia.Stulova at arm.com]
Sent: Friday, May 27, 2016 11:44 AM
To: Shi, Aaron (en ye) <Aaronenye.Shi at amd.com<mailto:Aaronenye.Shi at amd.com>>; cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
Cc: xiuli.pan at intel.com<mailto:xiuli.pan at intel.com>; alexey.bader at intel.com<mailto:alexey.bader at intel.com>; richard at metafoo.co.uk<mailto:richard at metafoo.co.uk>; Haustov, Nikolay <Nikolay.Haustov at amd.com<mailto:Nikolay.Haustov at amd.com>>; Liu, Yaxun (Sam) <Yaxun.Liu at amd.com<mailto:Yaxun.Liu at amd.com>>; nd <nd at arm.com<mailto:nd at arm.com>>
Subject: RE: [RFC][OpenCL] Allow -cl-std and other standard -cl- options in driver

You should be able to pass -std=CL1.1|CL1.2|CL2.0 to the Clang driver. We have broken it lately though, but the fix is on the way: http://reviews.llvm.org/D20630

Some other options are supported too, but not called the same way i.e. -ffast-math (analogue to -cl-fast-relaxed-math).

Which options would you be interested in particular? I think we should try to avoid duplication with existing ones that are already in Clang.

The -cl options are generally a part of the OpenCL runtime API spec, but they might be useful to have for standalone compilation indeed.

Cheers,
Anastasia

From: Shi, Aaron (en ye) [mailto:Aaronenye.Shi at amd.com]
Sent: 26 May 2016 19:55
To: cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
Cc: Anastasia Stulova; xiuli.pan at intel.com<mailto:xiuli.pan at intel.com>; alexey.bader at intel.com<mailto:alexey.bader at intel.com>; richard at metafoo.co.uk<mailto:richard at metafoo.co.uk>; Haustov, Nikolay; Liu, Yaxun (Sam)
Subject: [RFC][OpenCL] Allow -cl-std and other standard -cl- options in driver

cfe-dev,

Currently, -cl-std= and -cl- options are only accepted by clang compiler with -cc1, which is not convenient for OpenCL users.

Is it possible to allow these options into clang driver (without -cc1)?

Thanks,

Aaron (En Ye) Shi
PEY, SW Engineering | Stream OpenCL
O +(1) 289-695-0685    M +(1) 647-709-3020

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


More information about the cfe-dev mailing list