[Openmp-dev] Math symbols are not found during configuration

Itaru Kitayama via Openmp-dev openmp-dev at lists.llvm.org
Thu Jul 25 04:00:04 PDT 2019


The host code is affected with Clang 9 at this moment. I was originally
reporting the host code can not be compiled with -fopemp-targets.

On Thu, Jul 25, 2019 at 19:50 Doerfert, Johannes <jdoerfert at anl.gov> wrote:

> Now, and in future releases, host code should not be impacted.
>
> ________________________________________
> From: Itaru Kitayama <itaru.kitayama at gmail.com>
> Sent: Thursday, July 25, 2019 05:28
> To: Doerfert, Johannes
> Cc: Jeff Hammond; openmp-dev at lists.llvm.org
> Subject: Re: [Openmp-dev] Math symbols are not found during configuration
>
> In future releases, is NAN supported at least in host code? It's scattered
> everywhere in the codebase I am currently working.
>
> On Thu, Jul 25, 2019 at 12:13 PM Doerfert, Johannes <jdoerfert at anl.gov
> <mailto:jdoerfert at anl.gov>> wrote:
> You are correct, there is a regression but also a major improvement:
>
> Clang 8.0: M_PI  works in host code and NVPTX-device code
> Clang 8.0: std::sin etc. works in host code but not NVPTX-device code
> Clang 9.0: M_PI works in host code but not in NVPTX-device code
> Clang 9.0: std::sin etc. works in host code and NVPTX-device code
>
> So we basically traded in system math declarations that had a valid
> implementation
> for NVPTX-devices, thus no vector intrinsics, inline assembly etc., for
> specialized math
> declarations that are distributed with Clang CUDA (as builtin math
> functions).
>
> I hope this does not cause too much trouble for you and you can benefit
> from the
> additional support. Know that we are working to get both up and running.
>
> Does this help?
>
> ________________________________________
> From: Itaru Kitayama <itaru.kitayama at gmail.com<mailto:
> itaru.kitayama at gmail.com>>
> Sent: Wednesday, July 24, 2019 19:47
> To: Doerfert, Johannes
> Cc: Jeff Hammond; openmp-dev at lists.llvm.org<mailto:
> openmp-dev at lists.llvm.org>
> Subject: Re: [Openmp-dev] Math symbols are not found during configuration
>
> Johannes,
> Clang 8.0.0 works without making modifications to the source code, thus I
> am confused as to
> what needs to be done.
>
> On Thu, Jul 25, 2019 at 5:32 AM Doerfert, Johannes <jdoerfert at anl.gov
> <mailto:jdoerfert at anl.gov><mailto:jdoerfert at anl.gov<mailto:
> jdoerfert at anl.gov>>> wrote:
> #define works, the preprocessor works.
>
> When the target region is compiled we do not include math.h. This will
> change once we get support for variants. Till then, it is either no math
> functions or only he ones Clang CUDA provides automatically, which seems
> not to include these defines, maybe because they are not ISO C but POSIX
> extensions.
>
>
> On 07/24, Jeff Hammond wrote:
> > How does #define not act on the full source code? How is that a
> compliant implementation of the preprocessor?
> >
> > Jeff
> >
> > > On Jul 24, 2019, at 12:25 PM, Doerfert, Johannes via Openmp-dev <
> openmp-dev at lists.llvm.org<mailto:openmp-dev at lists.llvm.org><mailto:
> openmp-dev at lists.llvm.org<mailto:openmp-dev at lists.llvm.org>>> wrote:
> > >
> > > Hi Itaru,
> > >
> > > For now, you need to define them yourself when you need them in the
> target region.
> > > We are working on a permanent solution.
> > >
> > > Thanks,
> > >  Johannes
> > >
> > > ________________________________________
> > > From: Openmp-dev <openmp-dev-bounces at lists.llvm.org<mailto:
> openmp-dev-bounces at lists.llvm.org><mailto:
> openmp-dev-bounces at lists.llvm.org<mailto:openmp-dev-bounces at lists.llvm.org>>>
> on behalf of Itaru Kitayama via Openmp-dev <openmp-dev at lists.llvm.org
> <mailto:openmp-dev at lists.llvm.org><mailto:openmp-dev at lists.llvm.org
> <mailto:openmp-dev at lists.llvm.org>>>
> > > Sent: Tuesday, July 23, 2019 22:58
> > > To: openmp-dev at lists.llvm.org<mailto:openmp-dev at lists.llvm.org
> ><mailto:openmp-dev at lists.llvm.org<mailto:openmp-dev at lists.llvm.org>>
> > > Subject: [Openmp-dev] Math symbols are not found during configuration
> > >
> > > Hi,
> > > Adding the flag -fopenmp-targets=nvptx64 makes math symbols M_E and
> M_PI defined in cmath not detected during the execution of CMake. How do I
> work around this? I am using the latest trunk Clang at this moment, and
> without the above flag, both symbols are detected properly.
> > >
> > > Thanks,
> > > Itaru.
> > > _______________________________________________
> > > Openmp-dev mailing list
> > > Openmp-dev at lists.llvm.org<mailto:Openmp-dev at lists.llvm.org><mailto:
> Openmp-dev at lists.llvm.org<mailto:Openmp-dev at lists.llvm.org>>
> > > https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
> --
>
> Johannes Doerfert
> Researcher
>
> Argonne National Laboratory
> Lemont, IL 60439, USA
>
> jdoerfert at anl.gov<mailto:jdoerfert at anl.gov><mailto:jdoerfert at anl.gov
> <mailto:jdoerfert at anl.gov>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20190725/f96e511d/attachment.html>


More information about the Openmp-dev mailing list