<div dir="ltr">Adding Justin as well.<div><br></div><div>Overall this seems reasonable to me depending on the actual patch :)</div><div><br></div><div>-eric<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 6, 2017 at 7:23 PM Rodgers, Gregory via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There are at least four clang frontends for offloading to accelerators:<br class="gmail_msg">
1 Cuda clang  2 OpenMP  3 HCC and 4 OpenCL.    These frontends will<br class="gmail_msg">
want to embed object code for multiple offload targets into a single<br class="gmail_msg">
application binary to provide portability across different subarchitectures<br class="gmail_msg">
(e.g. sm_35, sm_50) and across different architectures (e.g nvptx64,amdgcn).<br class="gmail_msg">
<br class="gmail_msg">
Problem:  Different frontends are using different flags to provide a<br class="gmail_msg">
list of subarchitectures.  For example, cuda clang repeats the flag<br class="gmail_msg">
“--cuda-gpu-arch=sm_35  --cuda-gpu-arch=sm_50” and HCC uses<br class="gmail_msg">
“--amdgpu-target=gfx701 --amdgpu-target=gfx802”.<br class="gmail_msg">
<br class="gmail_msg">
We propose a common clang flag to provide a list of target<br class="gmail_msg">
subarchitectures called “target-subarchs”. For example,<br class="gmail_msg">
<br class="gmail_msg">
--target-subarchs=sm_35,sm_50,gfx701,gfx802<br class="gmail_msg">
<br class="gmail_msg">
In discussions with HCC and OpenMP maintainers,  we believe a new<br class="gmail_msg">
flag name would have these requirements:<br class="gmail_msg">
   end in “s” because it is a list;<br class="gmail_msg">
   not have vendor specific names like cuda and amd;<br class="gmail_msg">
   not contain “gpu” because offloading may extend to non-gpu archs;<br class="gmail_msg">
   avoid “arch” by itself so as not to be confused with first field of a triple;<br class="gmail_msg">
   and not collide with existing flags to allow both options.<br class="gmail_msg">
<br class="gmail_msg">
"--target-subarchs" satisfies all the above.  Comments?<br class="gmail_msg">
<br class="gmail_msg">
Greg Rodgers<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div></div></div>