DPC++ Runtime
Runtime libraries for oneAPI DPC++
vector_arith.hpp File Reference
#include <sycl/aliases.hpp>
#include <sycl/detail/generic_type_traits.hpp>
#include <sycl/detail/type_list.hpp>
#include <sycl/detail/type_traits.hpp>
#include <sycl/ext/oneapi/bfloat16.hpp>
#include <cstddef>
#include <type_traits>
Include dependency graph for vector_arith.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sycl::_V1::detail::vec_arith< DataT, NumElements >
 
class  sycl::_V1::detail::vec_arith< std::byte, NumElements >
 
class  sycl::_V1::detail::vec_arith_common< DataT, NumElements >
 

Namespaces

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

Macros

#define BINOP_BASE(BINOP, OPASSIGN, CONVERT, COND)
 
#define __SYCL_BINOP(BINOP, OPASSIGN, CONVERT, COND)
 
#define __SYCL_UOP(UOP, OPASSIGN)
 
#define RELLOGOP_BASE(RELLOGOP, COND)
 
#define __SYCL_RELLOGOP(RELLOGOP, COND)
 

Macro Definition Documentation

◆ __SYCL_BINOP

#define __SYCL_BINOP (   BINOP,
  OPASSIGN,
  CONVERT,
  COND 
)
Value:
BINOP_BASE(BINOP, OPASSIGN, CONVERT, COND) \
\
template <typename T = DataT> \
friend std::enable_if_t<(COND), vec_t> operator BINOP(const vec_t & Lhs, \
const DataT & Rhs) { \
return Lhs BINOP vec_t(Rhs); \
} \
template <typename T = DataT> \
friend std::enable_if_t<(COND), vec_t> operator BINOP(const DataT & Lhs, \
const vec_t & Rhs) { \
return vec_t(Lhs) BINOP Rhs; \
} \
template <typename T = DataT> \
friend std::enable_if_t<(COND), vec_t> &operator OPASSIGN( \
vec_t & Lhs, const vec_t & Rhs) { \
Lhs = Lhs BINOP Rhs; \
return Lhs; \
} \
template <int Num = NumElements, typename T = DataT> \
friend std::enable_if_t<(Num != 1) && (COND), vec_t &> operator OPASSIGN( \
vec_t & Lhs, const DataT & Rhs) { \
Lhs = Lhs BINOP vec_t(Rhs); \
return Lhs; \
}
#define BINOP_BASE(BINOP, OPASSIGN, CONVERT, COND)

Definition at line 69 of file vector_arith.hpp.

◆ __SYCL_RELLOGOP

#define __SYCL_RELLOGOP (   RELLOGOP,
  COND 
)
Value:
RELLOGOP_BASE(RELLOGOP, COND) \
\
template <typename T = DataT> \
friend std::enable_if_t<(COND), vec<ocl_t, NumElements>> operator RELLOGOP( \
const vec_t & Lhs, const DataT & Rhs) { \
return Lhs RELLOGOP vec_t(Rhs); \
} \
template <typename T = DataT> \
friend std::enable_if_t<(COND), vec<ocl_t, NumElements>> operator RELLOGOP( \
const DataT & Lhs, const vec_t & Rhs) { \
return vec_t(Lhs) RELLOGOP Rhs; \
}
#define RELLOGOP_BASE(RELLOGOP, COND)

Definition at line 243 of file vector_arith.hpp.

◆ __SYCL_UOP

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

Definition at line 180 of file vector_arith.hpp.

◆ BINOP_BASE

#define BINOP_BASE (   BINOP,
  OPASSIGN,
  CONVERT,
  COND 
)
Value:
template <typename T = DataT> \
friend std::enable_if_t<(COND), vec_t> operator BINOP(const vec_t & Lhs, \
const vec_t & Rhs) { \
vec_t Ret{}; \
for (size_t I = 0; I < NumElements; ++I) { \
Ret[I] = Lhs[I] BINOP Rhs[I]; \
} \
return Ret; \
}

Definition at line 57 of file vector_arith.hpp.

◆ RELLOGOP_BASE

#define RELLOGOP_BASE (   RELLOGOP,
  COND 
)
Value:
template <typename T = DataT> \
friend std::enable_if_t<(COND), vec<ocl_t, NumElements>> operator RELLOGOP( \
const vec_t & Lhs, const vec_t & Rhs) { \
vec<ocl_t, NumElements> Ret{}; \
for (size_t I = 0; I < NumElements; ++I) { \
Ret[I] = static_cast<ocl_t>(-(Lhs[I] RELLOGOP Rhs[I])); \
} \
return Ret; \
}

Definition at line 231 of file vector_arith.hpp.