DPC++ Runtime
Runtime libraries for oneAPI DPC++
marray.hpp File Reference
#include <sycl/aliases.hpp>
#include <sycl/detail/common.hpp>
#include <sycl/half_type.hpp>
#include <array>
#include <cstddef>
#include <cstdint>
#include <type_traits>
#include <utility>
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

struct  sycl::_V1::detail::GetMArrayArgsSize<>
 
struct  sycl::_V1::detail::GetMArrayArgsSize< marray< T, N >, Ts... >
 
struct  sycl::_V1::detail::GetMArrayArgsSize< T, Ts... >
 
class  sycl::_V1::marray< Type, NumElements >
 Provides a cross-platform math array class template that works on SYCL devices as well as in host C++ code. More...
 

Namespaces

 sycl
 
 sycl::_V1
 
 sycl::_V1::detail
 

Macros

#define __SYCL_BINOP(BINOP, OPASSIGN)
 
#define __SYCL_BINOP_INTEGRAL(BINOP, OPASSIGN)
 
#define __SYCL_RELLOGOP(RELLOGOP)
 
#define __SYCL_UOP(UOP, OPASSIGN)
 
#define __SYCL_MAKE_MARRAY_ALIAS(ALIAS, TYPE, N)    using ALIAS##N = 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 
)

Definition at line 174 of file marray.hpp.

◆ __SYCL_BINOP_INTEGRAL

#define __SYCL_BINOP_INTEGRAL (   BINOP,
  OPASSIGN 
)

Definition at line 211 of file marray.hpp.

◆ __SYCL_MAKE_MARRAY_ALIAS

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

Definition at line 366 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(mbool, bool, N) \
__SYCL_MAKE_MARRAY_ALIAS(mchar, std::int8_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(mshort, std::int16_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(mint, std::int32_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(mlong, std::int64_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(mlonglong, std::int64_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(mfloat, float, N) \
__SYCL_MAKE_MARRAY_ALIAS(mdouble, double, N) \
__SYCL_MAKE_MARRAY_ALIAS(mhalf, half, N)
#define __SYCL_MAKE_MARRAY_ALIAS(ALIAS, TYPE, N)
Definition: marray.hpp:366
conditional< sizeof(long)==8, long, long long >::type int64_t
Definition: kernel_desc.hpp:35
sycl::detail::half_impl::half half
Definition: aliases.hpp:101

Definition at line 369 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)
#define __SYCL_MAKE_MARRAY_ALIASES_FOR_ARITHMETIC_TYPES(N)
Definition: marray.hpp:369

Definition at line 392 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, std::int8_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(muchar, std::uint8_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(mushort, std::uint16_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(muint, std::uint32_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(mulong, std::uint64_t, N) \
__SYCL_MAKE_MARRAY_ALIAS(mulonglong, std::uint64_t, N)

Definition at line 384 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_t<std::is_convertible_v<T, DataT> && \
(std::is_fundamental_v<T> || \
std::is_same_v<T, half>), \
marray<bool, NumElements>> \
operator RELLOGOP(const marray &Lhs, const T &Rhs) { \
return Lhs RELLOGOP marray(static_cast<const DataT &>(Rhs)); \
} \
template <typename T> \
friend typename std::enable_if_t<std::is_convertible_v<T, DataT> && \
(std::is_fundamental_v<T> || \
std::is_same_v<T, half>), \
marray<bool, NumElements>> \
operator RELLOGOP(const T &Lhs, const marray &Rhs) { \
return marray(static_cast<const DataT &>(Lhs)) RELLOGOP Rhs; \
}

Definition at line 273 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 314 of file marray.hpp.