HIPIFY: [HIPIFY] hipify-clang terminates with error.
After f19e7c29dfcef3d0c941c977ce6d1448ad4e288a commit hipify-clang terminates with this error:
~/source/HIP/samples/0_Intro/square$ ~/software/hip/hipify-clang square.cu -- -x cuda --cuda-path=$CUDA_PATH
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:537:3: error: constexpr function 'fpclassify' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
fpclassify(float __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:248:9: note: conflicting __device__ function declared here
using ::fpclassify;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:542:3: error: constexpr function 'fpclassify' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
fpclassify(double __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:248:9: note: conflicting __device__ function declared here
using ::fpclassify;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:562:3: error: constexpr function 'isfinite' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isfinite(float __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:252:9: note: conflicting __device__ function declared here
using ::isfinite;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:566:3: error: constexpr function 'isfinite' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isfinite(double __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:252:9: note: conflicting __device__ function declared here
using ::isfinite;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:584:3: error: constexpr function 'isinf' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isinf(float __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:255:9: note: conflicting __device__ function declared here
using ::isinf;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:592:3: error: constexpr function 'isinf' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isinf(double __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:255:9: note: conflicting __device__ function declared here
using ::isinf;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:611:3: error: constexpr function 'isnan' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isnan(float __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:259:9: note: conflicting __device__ function declared here
using ::isnan;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:619:3: error: constexpr function 'isnan' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isnan(double __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:259:9: note: conflicting __device__ function declared here
using ::isnan;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:638:3: error: constexpr function 'isnormal' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isnormal(float __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:260:9: note: conflicting __device__ function declared here
using ::isnormal;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:642:3: error: constexpr function 'isnormal' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isnormal(double __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:260:9: note: conflicting __device__ function declared here
using ::isnormal;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:661:3: error: constexpr function 'signbit' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
signbit(float __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:287:9: note: conflicting __device__ function declared here
using ::signbit;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:665:3: error: constexpr function 'signbit' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
signbit(double __x)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:287:9: note: conflicting __device__ function declared here
using ::signbit;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:683:3: error: constexpr function 'isgreater' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isgreater(float __x, float __y)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:253:9: note: conflicting __device__ function declared here
using ::isgreater;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:687:3: error: constexpr function 'isgreater' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isgreater(double __x, double __y)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:253:9: note: conflicting __device__ function declared here
using ::isgreater;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:709:3: error: constexpr function 'isgreaterequal' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isgreaterequal(float __x, float __y)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:254:9: note: conflicting __device__ function declared here
using ::isgreaterequal;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:713:3: error: constexpr function 'isgreaterequal' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isgreaterequal(double __x, double __y)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:254:9: note: conflicting __device__ function declared here
using ::isgreaterequal;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:735:3: error: constexpr function 'isless' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isless(float __x, float __y)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:256:9: note: conflicting __device__ function declared here
using ::isless;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:739:3: error: constexpr function 'isless' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
isless(double __x, double __y)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:256:9: note: conflicting __device__ function declared here
using ::isless;
^
In file included from <built-in>:1:
In file included from /home/kaveh/software/hip/include/__clang_cuda_runtime_wrapper.h:36:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:761:3: error: constexpr function 'islessequal' without __host__ or __device__ attributes cannot overload __device__ function with same signature. Add a __host__ attribute, or build with -fno-cuda-host-device-constexpr.
islessequal(float __x, float __y)
^
/home/kaveh/software/hip/include/__clang_cuda_math_forward_declares.h:257:9: note: conflicting __device__ function declared here
using ::islessequal;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated when compiling for host.
Error while processing /tmp/square.cu-937183.hip.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 28
Commits related to this issue
- Merge pull request #1612 from emankov/hipify [HIPIFY][cmake][#1572] Fix: Do not override CMAKE_INSTALL_PREFIX — committed to ROCm/HIP by emankov 5 years ago
Please, try once again. I believe, now you don’t need CPATH to bin/include as only hipify-clang related headers installed there, finally.
Ok, now I see it, sorry, will fix it soon.
Why do you need to add bin/include to CPATH?
Ok, could you please check HIP’s fallback (nvcc) path as well? Anyway:
If I add this line to my environment then nvcc would not function correctly:
export CPATH=/home/kaveh/software/hip/include/:$CPATHbecause it uses stddef.h in /home/kaveh/software/hip/include .
So, the changed environment indeed? hipify-clang doesn’t need HIP includes, and now it looks like there might be conflicts.
It is up-to-date LLVM’s source code, resides here: https://github.com/llvm/llvm-project.git
Here is a quick guide: http://llvm.org/docs/GettingStarted.html#getting-started-quickly-a-summary
But it looks like it is not needed for the issue, right?
Under investigation. Could you please also run against trunk LLVM twice (with and without installation)? Thanks in advance.
Btw, unrelated, you may omit
-- -x cuda.