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

Finkel, Hal J. via Openmp-dev openmp-dev at lists.llvm.org
Tue Mar 19 09:02:48 PDT 2019


Hi, Doru,

What's the underlying problem and how does clang-ykt fix it? Do we have open reviews that resolve this upstream?

I recall that these functions are provided by libdevice.*.bc and that some renaming needs to happen to get this to work. Also, I recall there being some reviews open on this, but I don't now recall which ones and where.

Thanks again,

Hal

On 3/19/19 9:22 AM, Gheorghe-Teod Bercea via Openmp-dev wrote:
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><mailto:openmp-dev at lists.llvm.org>
To:        "openmp-dev at lists.llvm.org"<mailto:openmp-dev at lists.llvm.org> <openmp-dev at lists.llvm.org><mailto: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><mailto: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<mailto: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<mailto:Openmp-dev at lists.llvm.org>
https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190319/962f9b3a/attachment-0001.html>


More information about the Openmp-dev mailing list