Some function overloads for floats were missing, found by running a test
suite [0] with the OpenMP overlay.
[0] https://github.com/TApplencourt/OmpVal
Depends on D77239.
Differential D77240
[CUDA] Add missing cmath overloads jdoerfert on Apr 1 2020, 1:21 PM. Authored by
Details
Some function overloads for floats were missing, found by running a test [0] https://github.com/TApplencourt/OmpVal Depends on D77239.
Diff Detail
Unit Tests Event TimelineComment Actions We'll need to make sure that all of these new functions are vailable in all supported CUDA versions. Comment Actions At least that one is defined in what is "now" __clang_cuda_math.h: __DEVICE__ float acoshf(float __a) { return __nv_acoshf(__a); } Comment Actions Cool. We may be OK, but we still need to verify it. Math headers are rather fragile and we need to make sure it all still works two different standard libraries and all CUDA versions. Comment Actions Thank you very much! I (now) know what pain math headers are... These are almost the last infrastructure changes I need, there is a problem with the include path order on some system but for that I first need to write a patch. Comment Actions We do have a problem. With your patch I see a lot of errors about function redefinitions conflicting with the ones in CUDA's math_functions.hpp: E.g: In file included from <built-in>:1: In file included from /usr/local/google/home/tra/work/llvm/build/release+assert+zapcc/lib/clang/11.0.0/include/__clang_cuda_runtime_wrapper.h:398: /usr/local/google/home/tra/work/llvm/build/release+assert+zapcc/lib/clang/11.0.0/include/__clang_cuda_cmath.h:60:18: error: redefinition of 'acosh' __DEVICE__ float acosh(float __x) { return ::acoshf(__x); } ^ /usr/local/google/home/tra/local/cuda-10.0/include/crt/math_functions.hpp:624:31: note: previous definition is here __MATH_FUNCTIONS_DECL__ float acosh(float a) Full list of conflicting functions in CUDA 9.0, 10.0, 10.1, 10.2 redefinition of 'acosh' redefinition of 'asinh' redefinition of 'atanh' redefinition of 'cbrt' redefinition of 'erf' redefinition of 'erfc' redefinition of 'exp2' redefinition of 'expm1' redefinition of 'fdim' redefinition of 'hypot' redefinition of 'ilogb' redefinition of 'lgamma' redefinition of 'llrint' redefinition of 'llround' redefinition of 'log1p' redefinition of 'log2' redefinition of 'logb' redefinition of 'lrint' redefinition of 'lround' Comment Actions I just noticed those as well. I forgot to put the new definitions into the forward declare header. Will do it in a second. The OpenMP math overlay doesn't have one so I forgot :( Comment Actions I'm not sure how it's going to help. The problem is that the functions are already defined by CUDA headers. Moving the duplicate definition to a different header does not change that. Comment Actions I see. In my CUDA headers float acos(float) is conditionally defined as well but as a __cudart_builtin__. I'll move the new functions into an OpenMP only header. I thought they might be needed here too but that was wrong. Thanks for spending the time on this! |
clang-format: please reformat the code