DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
marray.hpp File Reference
Include dependency graph for marray.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cl::sycl::marray< Type, NumElements >
 Provides a cross-patform math array class template that works on SYCL devices as well as in host C++ code. More...
 

Namespaces

 cl
 We provide new interfaces for matrix muliply in this patch:
 
 cl::sycl
 

Macros

#define __SYCL_BINOP(BINOP, OPASSIGN)
 
#define __SYCL_BINOP_INTEGRAL(BINOP, OPASSIGN)
 
#define __SYCL_RELLOGOP(RELLOGOP)
 
#define __SYCL_RELLOGOP_INTEGRAL(RELLOGOP)
 
#define __SYCL_UOP(UOP, OPASSIGN)
 
#define __SYCL_MAKE_MARRAY_ALIAS(ALIAS, TYPE, N)   using ALIAS##N = cl::sycl::marray<TYPE, N>;
 
#define __SYCL_MAKE_MARRAY_ALIASES_FOR_ARITHMETIC_TYPES(N)
 
#define __SYCL_MAKE_MARRAY_ALIASES_FOR_SIGNED_AND_UNSIGNED_TYPES(N)
 
#define __SYCL_MAKE_MARRAY_ALIASES_FOR_MARRAY_LENGTH(N)
 

Macro Definition Documentation

◆ __SYCL_BINOP

#define __SYCL_BINOP (   BINOP,
  OPASSIGN 
)
Value:
friend marray operator BINOP(const marray &Lhs, const marray &Rhs) { \
marray Ret; \
for (size_t I = 0; I < NumElements; ++I) { \
Ret[I] = Lhs[I] BINOP Rhs[I]; \
} \
return Ret; \
} \
template <typename T> \
friend typename std::enable_if< \
std::is_convertible<DataT, T>::value && \
(std::is_fundamental<T>::value || \
marray>::type \
operator BINOP(const marray &Lhs, const T &Rhs) { \
return Lhs BINOP marray(static_cast<DataT>(Rhs)); \
} \
friend marray &operator OPASSIGN(marray &Lhs, const marray &Rhs) { \
Lhs = Lhs BINOP Rhs; \
return Lhs; \
} \
template <std::size_t Num = NumElements> \
friend typename std::enable_if<Num != 1, marray &>::type operator OPASSIGN( \
marray &Lhs, const DataT &Rhs) { \
Lhs = Lhs BINOP marray(Rhs); \
return Lhs; \
}

Definition at line 114 of file marray.hpp.

◆ __SYCL_BINOP_INTEGRAL

#define __SYCL_BINOP_INTEGRAL (   BINOP,
  OPASSIGN 
)
Value:
template <typename T = DataT, \
typename = std::enable_if<std::is_integral<T>::value, marray>> \
friend marray operator BINOP(const marray &Lhs, const marray &Rhs) { \
marray Ret; \
for (size_t I = 0; I < NumElements; ++I) { \
Ret[I] = Lhs[I] BINOP Rhs[I]; \
} \
return Ret; \
} \
template <typename T, typename BaseT = DataT> \
friend typename std::enable_if<std::is_convertible<T, DataT>::value && \
std::is_integral<T>::value && \
std::is_integral<BaseT>::value, \
marray>::type \
operator BINOP(const marray &Lhs, const T &Rhs) { \
return Lhs BINOP marray(static_cast<DataT>(Rhs)); \
} \
template <typename T = DataT, \
typename = std::enable_if<std::is_integral<T>::value, marray>> \
friend marray &operator OPASSIGN(marray &Lhs, const marray &Rhs) { \
Lhs = Lhs BINOP Rhs; \
return Lhs; \
} \
template <std::size_t Num = NumElements, typename T = DataT> \
friend typename std::enable_if<Num != 1 && std::is_integral<T>::value, \
marray &>::type \
operator OPASSIGN(marray &Lhs, const DataT &Rhs) { \
Lhs = Lhs BINOP marray(Rhs); \
return Lhs; \
}

Definition at line 142 of file marray.hpp.

◆ __SYCL_MAKE_MARRAY_ALIAS

#define __SYCL_MAKE_MARRAY_ALIAS (   ALIAS,
  TYPE,
 
)    using ALIAS##N = cl::sycl::marray<TYPE, N>;

Definition at line 303 of file marray.hpp.

◆ __SYCL_MAKE_MARRAY_ALIASES_FOR_ARITHMETIC_TYPES

#define __SYCL_MAKE_MARRAY_ALIASES_FOR_ARITHMETIC_TYPES (   N)
Value:
__SYCL_MAKE_MARRAY_ALIAS(mchar, char, N) \
__SYCL_MAKE_MARRAY_ALIAS(mshort, short, N) \
__SYCL_MAKE_MARRAY_ALIAS(mint, int, N) \
__SYCL_MAKE_MARRAY_ALIAS(mlong, long, N) \
__SYCL_MAKE_MARRAY_ALIAS(mfloat, float, N) \
__SYCL_MAKE_MARRAY_ALIAS(mdouble, double, N) \
__SYCL_MAKE_MARRAY_ALIAS(mhalf, half, N)

Definition at line 306 of file marray.hpp.

◆ __SYCL_MAKE_MARRAY_ALIASES_FOR_MARRAY_LENGTH

#define __SYCL_MAKE_MARRAY_ALIASES_FOR_MARRAY_LENGTH (   N)
Value:
__SYCL_MAKE_MARRAY_ALIASES_FOR_SIGNED_AND_UNSIGNED_TYPES(N)

Definition at line 324 of file marray.hpp.

◆ __SYCL_MAKE_MARRAY_ALIASES_FOR_SIGNED_AND_UNSIGNED_TYPES

#define __SYCL_MAKE_MARRAY_ALIASES_FOR_SIGNED_AND_UNSIGNED_TYPES (   N)
Value:
__SYCL_MAKE_MARRAY_ALIAS(mschar, signed char, N) \
__SYCL_MAKE_MARRAY_ALIAS(muchar, unsigned char, N) \
__SYCL_MAKE_MARRAY_ALIAS(mushort, unsigned short, N) \
__SYCL_MAKE_MARRAY_ALIAS(muint, unsigned int, N) \
__SYCL_MAKE_MARRAY_ALIAS(mulong, unsigned long, N) \
__SYCL_MAKE_MARRAY_ALIAS(mlonglong, long long, N) \
__SYCL_MAKE_MARRAY_ALIAS(mulonglong, unsigned long long, N)

Definition at line 315 of file marray.hpp.

◆ __SYCL_RELLOGOP

#define __SYCL_RELLOGOP (   RELLOGOP)
Value:
friend marray<bool, NumElements> operator RELLOGOP(const marray &Lhs, \
const marray &Rhs) { \
marray<bool, NumElements> Ret; \
for (size_t I = 0; I < NumElements; ++I) { \
Ret[I] = Lhs[I] RELLOGOP Rhs[I]; \
} \
return Ret; \
} \
template <typename T> \
friend typename std::enable_if<std::is_convertible<T, DataT>::value && \
(std::is_fundamental<T>::value || \
std::is_same<T, half>::value), \
marray<bool, NumElements>>::type \
operator RELLOGOP(const marray &Lhs, const T &Rhs) { \
return Lhs RELLOGOP marray(static_cast<const DataT &>(Rhs)); \
}

Definition at line 196 of file marray.hpp.

◆ __SYCL_RELLOGOP_INTEGRAL

#define __SYCL_RELLOGOP_INTEGRAL (   RELLOGOP)
Value:
template <typename T = DataT> \
friend typename std::enable_if<std::is_integral<T>::value, \
marray<bool, NumElements>>::type \
operator RELLOGOP(const marray &Lhs, const marray &Rhs) { \
marray<bool, NumElements> Ret; \
for (size_t I = 0; I < NumElements; ++I) { \
Ret[I] = Lhs[I] RELLOGOP Rhs[I]; \
} \
return Ret; \
} \
template <typename T, typename BaseT = DataT> \
friend typename std::enable_if<std::is_convertible<T, DataT>::value && \
std::is_integral<T>::value && \
std::is_integral<BaseT>::value, \
marray<bool, NumElements>>::type \
operator RELLOGOP(const marray &Lhs, const T &Rhs) { \
return Lhs RELLOGOP marray(static_cast<const DataT &>(Rhs)); \
}

Definition at line 214 of file marray.hpp.

◆ __SYCL_UOP

#define __SYCL_UOP (   UOP,
  OPASSIGN 
)
Value:
friend marray &operator UOP(marray &Lhs) { \
Lhs OPASSIGN 1; \
return Lhs; \
} \
friend marray operator UOP(marray &Lhs, int) { \
marray Ret(Lhs); \
Lhs OPASSIGN 1; \
return Ret; \
}

Definition at line 251 of file marray.hpp.

type
__SYCL_MAKE_MARRAY_ALIASES_FOR_ARITHMETIC_TYPES
#define __SYCL_MAKE_MARRAY_ALIASES_FOR_ARITHMETIC_TYPES(N)
Definition: marray.hpp:306
T
cl::sycl::ext::intel::experimental::type
type
Definition: fpga_utils.hpp:22
__SYCL_MAKE_MARRAY_ALIAS
#define __SYCL_MAKE_MARRAY_ALIAS(ALIAS, TYPE, N)
Definition: marray.hpp:303
cl::sycl::half
cl::sycl::detail::half_impl::half half
Definition: aliases.hpp:76