未验证 提交 81e16a85 编写于 作者: N niuliling123 提交者: GitHub

Fix HOSTDEVICE redefinition during XPU KP compilation, test=kunlun (#47885)

上级 798ab3f9
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <limits> #include <limits>
#include "paddle/phi/core/hostdevice.h"
#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUDA
#include <cuda.h> #include <cuda.h>
...@@ -36,16 +37,6 @@ ...@@ -36,16 +37,6 @@
#define PADDLE_ALIGN(x) __declspec(align(x)) #define PADDLE_ALIGN(x) __declspec(align(x))
#endif #endif
#if (defined(__CUDACC__) || defined(__HIPCC__))
#define HOSTDEVICE __host__ __device__
#define DEVICE __device__
#define HOST __host__
#else
#define HOSTDEVICE
#define DEVICE
#define HOST
#endif
namespace phi { namespace phi {
namespace dtype { namespace dtype {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <limits> #include <limits>
#include "paddle/phi/core/hostdevice.h"
#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUDA
#include <cuComplex.h> #include <cuComplex.h>
#include <thrust/complex.h> #include <thrust/complex.h>
...@@ -36,16 +37,6 @@ ...@@ -36,16 +37,6 @@
#define PADDLE_ALIGN(x) __declspec(align(x)) #define PADDLE_ALIGN(x) __declspec(align(x))
#endif #endif
#if (defined(__CUDACC__) || defined(__HIPCC__))
#define HOSTDEVICE __host__ __device__
#define DEVICE __device__
#define HOST __host__
#else
#define HOSTDEVICE
#define DEVICE
#define HOST
#endif
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
// todo // todo
#define PADDLE_WITH_CUDA_OR_HIP_COMPLEX #define PADDLE_WITH_CUDA_OR_HIP_COMPLEX
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <iostream> #include <iostream>
#include <limits> #include <limits>
#include "paddle/phi/core/hostdevice.h"
#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUDA
#include <cuda.h> #include <cuda.h>
#endif // PADDLE_WITH_CUDA #endif // PADDLE_WITH_CUDA
...@@ -51,16 +52,6 @@ ...@@ -51,16 +52,6 @@
#define CUDA_ARCH_FP16_SUPPORTED(CUDA_ARCH) (CUDA_ARCH >= 600) #define CUDA_ARCH_FP16_SUPPORTED(CUDA_ARCH) (CUDA_ARCH >= 600)
#if (defined(__CUDACC__) || defined(__HIPCC__))
#define HOSTDEVICE __host__ __device__
#define DEVICE __device__
#define HOST __host__
#else
#define HOSTDEVICE
#define DEVICE
#define HOST
#endif
namespace phi { namespace phi {
namespace dtype { namespace dtype {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册