mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-28 15:52:01 +08:00
Disable vectorization on device only when compiling for sycl
This commit is contained in:
parent
e44519744e
commit
0585b2965d
10
Eigen/Core
10
Eigen/Core
@ -35,17 +35,17 @@
|
|||||||
#undef EIGEN_INTERNAL_DEBUGGING
|
#undef EIGEN_INTERNAL_DEBUGGING
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Do not try to vectorize on CUDA and SYCL!
|
|
||||||
#ifndef EIGEN_DONT_VECTORIZE
|
|
||||||
#define EIGEN_DONT_VECTORIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef EIGEN_EXCEPTIONS
|
#ifdef EIGEN_EXCEPTIONS
|
||||||
#undef EIGEN_EXCEPTIONS
|
#undef EIGEN_EXCEPTIONS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// All functions callable from CUDA code must be qualified with __device__
|
// All functions callable from CUDA code must be qualified with __device__
|
||||||
#ifdef __CUDACC__
|
#ifdef __CUDACC__
|
||||||
|
// Do not try to vectorize on CUDA and SYCL!
|
||||||
|
#ifndef EIGEN_DONT_VECTORIZE
|
||||||
|
#define EIGEN_DONT_VECTORIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EIGEN_DEVICE_FUNC __host__ __device__
|
#define EIGEN_DEVICE_FUNC __host__ __device__
|
||||||
// We need math_functions.hpp to ensure that that EIGEN_USING_STD_MATH macro
|
// We need math_functions.hpp to ensure that that EIGEN_USING_STD_MATH macro
|
||||||
// works properly on the device side
|
// works properly on the device side
|
||||||
|
@ -83,6 +83,27 @@ struct PacketType<half, GpuDevice> {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(EIGEN_USE_SYCL)
|
||||||
|
template <typename T>
|
||||||
|
struct PacketType<T, SyclDevice> {
|
||||||
|
typedef T type;
|
||||||
|
static const int size = 1;
|
||||||
|
enum {
|
||||||
|
HasAdd = 0,
|
||||||
|
HasSub = 0,
|
||||||
|
HasMul = 0,
|
||||||
|
HasNegate = 0,
|
||||||
|
HasAbs = 0,
|
||||||
|
HasArg = 0,
|
||||||
|
HasAbs2 = 0,
|
||||||
|
HasMin = 0,
|
||||||
|
HasMax = 0,
|
||||||
|
HasConj = 0,
|
||||||
|
HasSetLinear = 0,
|
||||||
|
HasBlend = 0
|
||||||
|
};
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Tuple mimics std::pair but works on e.g. nvcc.
|
// Tuple mimics std::pair but works on e.g. nvcc.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user