<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
Correct some of the feature macros that add features through the libraries are
<div>now unconditionally defined in the internal header files. Although clang was
</div>
<div>always setting all optional features to supported ones for generic targets like
</div>
<div>SPIR however there was a frontend-only flag '-cl-ext' that allowed to override
</div>
<div>this. </div>
<div><br>
</div>
<div>We have started the discussion to restore this functionality for library-based
</div>
<div>features and here are two short-term approaches that have been discussed so </div>
<div>far: </div>
<div><br>
</div>
<div>1. Use '-D__undef_<feature name>' flag to skip defining the macros. I have </div>
<div>created an RFC patch to demonstrate the idea earlier:</div>
<div>https://reviews.llvm.org/D91531</div>
<div><br>
</div>
<div>2. Extend '-cl-ext' interface to handle such features. </div>
<div>Anton has been looking at this in:</div>
<div>https://reviews.llvm.org/D103241?id=348222#inline-97980 </div>
<div><br>
</div>
<div>Overall, originally SPIR has been added to clang as a device-agnostic target in
</div>
<div>a primary use case. But I feel in a long term we should consider improving the</div>
<div>design by adding an ability to specify a concrete device or maybe a class of</div>
<div>devices compiled for. Otherwise, I don't think always enumerating the list of
</div>
<div>features/extensions using '-cl-ext'/'-D' with each clang invocation is extremely</div>
<div>usable. So this area definitely needs some improvements. </div>
<div><br>
</div>
<div>FYI this topic is being discussed in the scope of OpenCL Tooling </div>
teleconferences within Khronos. The next session is on Thu next week.<br>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Anastasia<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> David Airlie <airlied@redhat.com><br>
<b>Sent:</b> 07 July 2021 05:00<br>
<b>To:</b> cfe-dev (cfe-dev@lists.llvm.org) <cfe-dev@lists.llvm.org>; Anastasia Stulova <Anastasia.Stulova@arm.com>; anton.zabaznov@intel.com <anton.zabaznov@intel.com><br>
<b>Subject:</b> Re: SPIR target enables all CL optional extensions</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On Wed, Jul 7, 2021 at 1:29 PM David Airlie <airlied@redhat.com> wrote:<br>
><br>
> Hi,<br>
><br>
> I'm trying to bring back up the mesa CL 3.0 support at the moment, and<br>
> running into a problem I'm not sure how to solve.<br>
<br>
Jesse set me straight on irc.<br>
c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_generic_address_space");<br>
<br>
sprinkling a bunch of these around gets me going.<br>
<br>
Dave.<br>
<br>
</div>
</span></font></div>
</body>
</html>