10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_META_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_META_H
17 template<
bool cond>
struct Cond {};
30 template <
typename T,
typename X,
typename Y>
34 return static_cast<T>(
x == 0 ? 0 : (
x - 1) /
y + 1);
41 return static_cast<T>(
x == 0 ? 0 : (
x - 1) /
y + 1);
48 static const size_t size = 1;
53 template <
typename Scalar,
typename Device>
55 typedef typename internal::packet_traits<Scalar>::type
type;
59 #if defined(EIGEN_USE_GPU) && defined(EIGEN_HAS_GPU_FP16) && defined(EIGEN_GPU_COMPILE_PHASE)
61 typedef ulonglong2 Packet4h2;
64 typedef Packet4h2
type;
65 static const int size = 8;
93 #if defined(EIGEN_USE_SYCL)
95 namespace TensorSycl {
98 template <
typename Index, Index A, Index B>
struct PlusOp {
99 static constexpr
Index Value =
A +
B;
102 template <
typename Index, Index A, Index B>
struct DivOp {
103 static constexpr
Index Value =
A /
B;
107 template <
class Indx, Indx...>
class StepOp>
109 template <
typename UnaryOperator>
112 static_for<Index, StepOp<Index, start, step>::Value,
end, step,
117 template <
class Indx, Indx...>
class StepOp>
119 template <
typename UnaryOperator>
123 template <
typename OutScalar,
typename Device,
bool Vectorizable>
125 static constexpr
int PacketSize = 1;
126 typedef OutScalar PacketReturnType;
129 template <
typename OutScalar,
typename Device>
130 struct Vectorise<OutScalar, Device, true> {
136 return ((((
x) + (y)-1) / (y)) * (y));
143 struct PacketType<half, SyclDevice> {
145 static const int size = 1;
161 template <
typename Scalar>
162 struct PacketType<Scalar, SyclDevice> : internal::default_packet_traits {
185 template <
typename Scalar>
186 struct PacketType<Scalar, const SyclDevice> : PacketType<Scalar, SyclDevice>{};
188 #ifndef EIGEN_DONT_VECTORIZE_SYCL
189 #define PACKET_TYPE(CVQual, Type, val, lengths, DEV)\
190 template<> struct PacketType<CVQual Type, DEV> : internal::sycl_packet_traits<val, lengths> \
192 typedef typename internal::packet_traits<Type>::type type;\
193 typedef typename internal::packet_traits<Type>::half half;\
197 PACKET_TYPE(
const,
float, 1, 4, SyclDevice)
198 PACKET_TYPE(,
float, 1, 4, SyclDevice)
199 PACKET_TYPE(
const,
float, 1, 4,
const SyclDevice)
200 PACKET_TYPE(,
float, 1, 4,
const SyclDevice)
202 PACKET_TYPE(
const,
double, 0, 2, SyclDevice)
203 PACKET_TYPE(,
double, 0, 2, SyclDevice)
204 PACKET_TYPE(
const,
double, 0, 2,
const SyclDevice)
205 PACKET_TYPE(,
double, 0, 2,
const SyclDevice)
208 template<>
struct PacketType<half, const SyclDevice>: PacketType<half, SyclDevice>{};
209 template<>
struct PacketType<const half, const SyclDevice>: PacketType<half, SyclDevice>{};
214 template <
typename U,
typename V>
struct Pair {
238 template <
typename U,
typename V>
241 return (
x.first ==
y.first &&
x.second ==
y.second);
244 template <
typename U,
typename V>
271 return {
static_cast<Index>(idx[First]),
static_cast<Index>(idx[Is])... };
273 template<
typename IndexType,
typename Index>
280 template<
typename Index, std::
size_t NumIndices,
typename IndexType>
287 template <
typename B,
typename D>
291 typedef char (&yes)[1];
292 typedef char (&no)[2];
294 template <
typename BB,
typename DD>
297 operator BB*()
const;
302 static yes check(D*,
T);
303 static no check(B*,
int);
305 static const bool value =
sizeof(check(Host<B,D>(),
int())) ==
sizeof(yes);
SparseMatrix< double > A(n, n)
#define EIGEN_ALWAYS_INLINE
#define EIGEN_DEVICE_FUNC
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
static const lastp1_t end
EIGEN_CONSTEXPR array< Index, 1+sizeof...(Is)> customIndices2Array(IndexType &idx, numeric_list< Index, First, Is... >)
EIGEN_CONSTEXPR Index first(const T &x) EIGEN_NOEXCEPT
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
EIGEN_CONSTEXPR bool operator==(const Pair< U, V > &x, const Pair< U, V > &y)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
EIGEN_ALWAYS_INLINE T divup(const X x, const Y y)
EIGEN_CONSTEXPR bool operator!=(const Pair< U, V > &x, const Pair< U, V > &y)
EIGEN_ALWAYS_INLINE const T1 & choose(Cond< true >, const T1 &first, const T2 &)
EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE IndexPair()
void set(IndexPair< Idx > val)
EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE IndexPair(Idx f, Idx s)
internal::packet_traits< Scalar >::type type
EIGEN_CONSTEXPR Pair(const U &f, const V &s)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW U first