[llvm-bugs] [Bug 42799] New: std::fpclassify missing long double when offload is enabled

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 27 15:27:12 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42799

            Bug ID: 42799
           Summary: std::fpclassify missing long double when offload is
                    enabled
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: xw111luoye at gmail.com
                CC: llvm-bugs at lists.llvm.org

std::fpclassify(long double) when offload is enabled

#include <cmath>

int main()
{
  long double a(0);
  return (std::fpclassify(a) == 2);
}

clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda test.cpp 
test.cpp:6:11: error: call to 'fpclassify' is ambiguous
  return (std::fpclassify(a) == 2);
          ^~~~~~~~~~~~~~~
/home/yeluo/opt/llvm-clang/mirror-20190727/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h:103:16:
note: candidate function
__DEVICE__ int fpclassify(double);
               ^
/home/yeluo/opt/llvm-clang/mirror-20190727/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h:104:16:
note: candidate function
__DEVICE__ int fpclassify(float);
               ^
1 error generated.

A simple fix is in
lib/Headers/__clang_cuda_math_forward_declares.h
add
+__DEVICE__ int fpclassify(long double);
 __DEVICE__ int fpclassify(double);
 __DEVICE__ int fpclassify(float);

clang++ -v
clang version 10.0.0 (https://github.com/llvm-mirror/clang.git
0345de1b90a4c75cd7e47505bebbbcf46b841940)
(https://github.com/llvm-mirror/llvm.git
c64f519ea0da2c3bf49a4e421c25a82b66230a17)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yeluo/opt/llvm-clang/mirror-latest/bin
Found candidate GCC installation:
/opt/gcc/6.5.0/lib/gcc/x86_64-pc-linux-gnu/6.5.0
Selected GCC installation: /opt/gcc/6.5.0/lib/gcc/x86_64-pc-linux-gnu/6.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda-10.1, version 10.1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190727/4b21f5c5/attachment.html>


More information about the llvm-bugs mailing list