Similarly to isinfinite, isinf, and isnan, a _MSC_VER version of signbit(long double) is required for MSVC headers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Not too sure how to properly write a testcase for this. I've reduced the failing case, but it requires the user to copy/install the hip headers from the HIP project.
test.cpp:
#include <hip/hip_runtime.h>
Running command:
C:\hip/bin/clang -std=c++14 -fms-extensions -fms-compatibility -isystem C:\hip/include -DHIP_ROCclr=1 -x hip test.cpp -o test.exe
In file included from test.cpp:1:
In file included from C:\hip/include\hip/hip_runtime.h:60:
In file included from C:\hip/include\hip/hcc_detail/hip_runtime.h:602:
In file included from C:\hip\lib\clang\12.0.0\include/cuda_wrappers/complex:75:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\complex:249:16: error:call to 'signbit' is ambiguous return (_STD signbit)(_Left);...
For CUDA we have tests in the test-suite (https://github.com/llvm/llvm-test-suite/tree/main/External/CUDA) and a handful of buildbots running them (e.g. http://lab.llvm.org:8011/#/builders/55).
AMD should probably set up some public build/test bots for HIP, too.
In this case, manual testing and rollback if something breaks is about all we can do.
I was able to shrink down the testcase, but it still requires 2019 MSVC to be installed and Windows Kits 10 at a minimum.
test.cpp:
#include <__clang_cuda_math_forward_declares.h> #include <cuda_wrappers/complex> int main() {}
clang cc1 command:
C:\hip\bin\clang.exe -cc1 -triple amdgcn-amd-amdhsa -aux-triple x86_64-pc-windows-msvc -emit-obj -fcuda-is-device -isystem C:\hip\lib\clang\12.0.0\include -internal-isystem "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" -internal-isystem "C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" -std=c++14 -fms-extensions -fms-compatibility -fms-compatibility-version=19.28.29336 -x hip test.cpp
In file included from test.cpp:3:
In file included from C:\hip\lib\clang\12.0.0\include\cuda_wrappers/complex:75:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\complex:249:16: error: call to 'signbit' is ambiguousreturn (_STD signbit)(_Left);
I will work with our team and look into adding HIP to the test-suite and AMD buildbots to the public llvm testing.
For now, is it OK to merge this patch?
Let's land this fix now. It will take some time to set up the buildbot. I think we already have this issue covered in HIP directed tests, right?