-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
When #1336 added usage of new intrinsics to <cmath>, we forgot about CUDA. 🙀 (Long ago, we broke CUDA by adding new type traits intrinsics in C++14 mode, but these math functions were just different enough that I didn't remember the interaction. Oops!)
I'm not exactly sure why our CUDA unit test didn't catch this, given that the affected overloads aren't templates:
Lines 62 to 70 in f675d68
| _NODISCARD _Check_return_ inline float ceil(_In_ float _Xx) noexcept /* strengthened */ { | |
| #ifdef _M_CEE | |
| return _CSTD ceilf(_Xx); | |
| #elif defined(__clang__) | |
| return __builtin_ceilf(_Xx); | |
| #else // ^^^ __clang__ / !__clang__ vvv | |
| return __ceilf(_Xx); | |
| #endif // __clang__ | |
| } |
We are including <cmath>, so there's probably some detail of the CUDA compilation process that I don't understand:
STL/stl/inc/__msvc_all_public_headers.hpp
Line 156 in f675d68
| #include <cmath> |
| #define _MSVC_TESTING_NVCC | |
| #include <__msvc_all_public_headers.hpp> |
In any event, fixing this should be easy, we just need to backport it to VS 2019 16.9.
Originally encountered in pytorch/pytorch#54382 and tracked by Microsoft-internal VSO-1314894 / AB#1314894 .