[Openmp-dev] Math functions when offloading to CUDA devices

Ye Luo via Openmp-dev openmp-dev at lists.llvm.org
Tue Mar 19 07:37:30 PDT 2019


James,
I had the same issue https://bugs.llvm.org/show_bug.cgi?id=41090
Clang-ykt works for me. I get all the math functions I need.
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
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.
Best,
Ye
===================
Ye Luo, Ph.D.
Computational Science Division & Leadership Computing Facility
Argonne National Laboratory


Gheorghe-Teod Bercea via Openmp-dev <openmp-dev at lists.llvm.org>
于2019年3月19日周二 上午9:22写道:

> Hi James,
>
> If you're installing the compiler from source please use the following
> version.
>
> This is a mirror of trunk:
>
> https://github.com/clang-ykt
>
> Clone Clang, LLVM and OpenMP runtime.
>
> IMPORTANT: For each repo checkout *patched-upstream* branch.
>
> The Clang *patched-upstream* branch contains a patch that fixes your
> problem.
>
> Thanks,
>
> --Doru
>
>
>
>
>
> From:        James Price via Openmp-dev <openmp-dev at lists.llvm.org>
> To:        "openmp-dev at lists.llvm.org" <openmp-dev at lists.llvm.org>
> Date:        03/19/2019 07:51 AM
> Subject:        [Openmp-dev] Math functions when offloading to CUDA
> devices
> Sent by:        "Openmp-dev" <openmp-dev-bounces at lists.llvm.org>
> ------------------------------
>
>
>
> Hi,
>
> 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:
>
>    fatal error: error in backend: Cannot select: 0x47b33a0: f64 = fsin
> 0x47b2f90
>
> 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).
>
> Some functions such as sqrt work fine, but I assume this is because they
> map directly to NVVM intrinsics.
>
> Cheers,
>
> James
>
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
>
>
>
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190319/afaa3a1f/attachment.html>


More information about the Openmp-dev mailing list