Fix __clang_cuda_math_forward_declares.h
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Thu, 11 Jun 2020 03:41:51 +0000 (23:41 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Thu, 11 Jun 2020 03:47:13 +0000 (23:47 -0400)
Recent change from `#if !defined(__CUDA__)` to `#if !__CUDA__` caused
regression on ROCm 3.5 since there is `#define __CUDA__`
before inclusion of the header file, which causes `#if !__CUDA__`
to be invalid.

Change `#if !__CUDA__` back to `#if !defined(__CUDA__)` for backward
compatibility.

clang/lib/Headers/__clang_cuda_math_forward_declares.h

index 7c0b357..8a27085 100644 (file)
@@ -8,7 +8,7 @@
  */
 #ifndef __CLANG__CUDA_MATH_FORWARD_DECLARES_H__
 #define __CLANG__CUDA_MATH_FORWARD_DECLARES_H__
-#if !__CUDA__ && !__HIP__
+#if !defined(__CUDA__) && !__HIP__
 #error "This file is for CUDA/HIP compilation only."
 #endif