<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>James,<br></div><div>I had the same issue <a href="https://bugs.llvm.org/show_bug.cgi?id=41090">https://bugs.llvm.org/show_bug.cgi?id=41090</a></div><div>Clang-ykt works for me. I get all the math functions I need.<br></div><div>However,
when I use clang built from mainstream to build the clang-ykt offload
compiler, I got a device library issue when linking my application</div><div>My
solution is just building a clang using sources from clang-ykt repo
with -DOPENMP_ENABLE_LIBOMPTARGET=OFF first and then use it to build
clang-ykt with offload on.</div><div>Best,<br></div><div>Ye</div><div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">===================<br>
Ye Luo, Ph.D.<br>Computational Science Division & Leadership Computing Facility<br>
Argonne National Laboratory</div></div></div></div></div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Gheorghe-Teod Bercea via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org">openmp-dev@lists.llvm.org</a>> 于2019年3月19日周二 上午9:22写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="2" face="sans-serif">Hi James,</font><br><br><font size="2" face="sans-serif">If you're installing the compiler from
source please use the following version.</font><br><br><font size="2" face="sans-serif">This is a mirror of trunk:</font><br><br><a href="https://github.com/clang-ykt" target="_blank"><font size="2" face="sans-serif" color="blue">https://github.com/clang-ykt</font></a><br><br><font size="2" face="sans-serif">Clone Clang, LLVM and OpenMP runtime.</font><br><br><font size="2" face="sans-serif" color="#008000">IMPORTANT: For each repo
checkout <b>patched-upstream</b> branch.</font><br><br><font size="2" face="sans-serif">The Clang <b>patched-upstream</b> branch
contains a patch that fixes your problem.</font><br><br><font size="2" face="sans-serif">Thanks,</font><br><br><font size="2" face="sans-serif">--Doru</font><br><font size="2" face="sans-serif"><br></font><br><br><br><br><font size="1" face="sans-serif" color="#5f5f5f">From:
</font><font size="1" face="sans-serif">James Price via Openmp-dev
<<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>></font><br><font size="1" face="sans-serif" color="#5f5f5f">To:
</font><font size="1" face="sans-serif">"<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>"
<<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>></font><br><font size="1" face="sans-serif" color="#5f5f5f">Date:
</font><font size="1" face="sans-serif">03/19/2019 07:51 AM</font><br><font size="1" face="sans-serif" color="#5f5f5f">Subject:
</font><font size="1" face="sans-serif">[Openmp-dev]
Math functions when offloading to CUDA devices</font><br><font size="1" face="sans-serif" color="#5f5f5f">Sent by:
</font><font size="1" face="sans-serif">"Openmp-dev"
<<a href="mailto:openmp-dev-bounces@lists.llvm.org" target="_blank">openmp-dev-bounces@lists.llvm.org</a>></font><br><hr noshade><br><br><br><tt><font size="2">Hi,<br><br>One of the issues we frequently hit when using the Clang OpenMP implementation
on NVIDIA GPUs is the lack of support for many common math functions (e.g.
cos/sin). Trying to use them produces errors of the form:<br><br> fatal error: error in backend: Cannot select: 0x47b33a0:
f64 = fsin 0x47b2f90<br><br>Translating math functions in target regions is listed as a feature that
isn’t supported yet, but is this something that is expected to be implemented
soon? Failing that, if someone can describe the desired approach to implement
this I might be able to take a stab at getting some initial patches together
(depending on the complexity).<br><br>Some functions such as sqrt work fine, but I assume this is because they
map directly to NVVM intrinsics.<br><br>Cheers,<br><br>James<br><br>_______________________________________________<br>Openmp-dev mailing list<br><a href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a><br></font></tt><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" target="_blank"><tt><font size="2">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</font></tt></a><tt><font size="2"><br><br></font></tt><br><br><br>
_______________________________________________<br>
Openmp-dev mailing list<br>
<a href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
</blockquote></div></div>