Closed llvmbot closed 8 years ago
Should be fixed in r259944
No, it was not intentional. The wrapper for math functions should only define overloads for functions with signatures not yet provided by CUDA headers in global scope.
This is a failed test reduced from SHOC's s3d benchmark. I noticed this test failing after http://reviews.llvm.org/D16593.
Extended Description
Is this intended?
// pow.cu using namespace std;
global void foo(double* dd) {
dd[0] = pow(dd[1], dd[2]);
}
$ clang++ pow.cu -c
pow.cu:4:11: error: call to 'pow' is ambiguous dd[0] = pow(dd[1], dd[2]); ^~~ /usr/local/cuda/include/math_functions_dbl_ptx3.hpp:350:41: note: candidate function MATH_FUNCTIONS_DBL_PTX3_DECL double pow(double a, double b) ^ /usr/local/google/home/jingyue/Work/llvm/install-git/bin/../lib/clang/3.9.0/include/clang_cuda_cmath.h:186:19: note: candidate function DEVICE double pow(double base, double exp) { return ::pow(base, exp); } ^ /usr/local/google/home/jingyue/Work/llvm/install-git/bin/../lib/clang/3.9.0/include/clang_cuda_cmath.h:187:19: note: candidate function DEVICE double pow(double base, int iexp) { return ::powi(base, iexp); } ^ /usr/local/google/home/jingyue/Work/llvm/install-git/bin/../lib/clang/3.9.0/include/clang_cuda_cmath.h:184:18: note: candidate function DEVICE float pow(float base, float exp) { return ::powf(base, exp); } ^ /usr/local/google/home/jingyue/Work/llvm/install-git/bin/../lib/clang/3.9.0/include/clang_cuda_cmath.h:185:18: note: candidate function DEVICE float pow(float base, int iexp) { return ::powif(base, iexp); } ^ 1 error generated.