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

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

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