Skip to content

Commit

Permalink
[SYCL] Revert friend changes to assignment and incr/decr for swizzles (
Browse files Browse the repository at this point in the history
…#12682)

This commit does a partial revert of
#12396. This is to avoid an issue
where the new friend operators wouldn't accept the arguments as l-value
references.

---------

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
  • Loading branch information
steffenlarsen committed Feb 15, 2024
1 parent 3f445cf commit 6194f3c
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions sycl/include/sycl/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1814,19 +1814,6 @@ class SwizzleOp {
#ifdef __SYCL_OPASSIGN
#error "Undefine __SYCL_OPASSIGN macro."
#endif
#if defined(__INTEL_PREVIEW_BREAKING_CHANGES)
#define __SYCL_OPASSIGN(OPASSIGN, OP) \
friend SwizzleOp &operator OPASSIGN(SwizzleOp & Lhs, const DataT & Rhs) { \
Lhs.operatorHelper<OP>(vec_t(Rhs)); \
return Lhs; \
} \
template <typename RhsOperation> \
friend SwizzleOp &operator OPASSIGN(SwizzleOp & Lhs, \
const RhsOperation & Rhs) { \
Lhs.operatorHelper<OP>(Rhs); \
return Lhs; \
}
#else // defined(__INTEL_PREVIEW_BREAKING_CHANGES)
#define __SYCL_OPASSIGN(OPASSIGN, OP) \
SwizzleOp &operator OPASSIGN(const DataT & Rhs) { \
operatorHelper<OP>(vec_t(Rhs)); \
Expand All @@ -1837,7 +1824,6 @@ class SwizzleOp {
operatorHelper<OP>(Rhs); \
return *this; \
}
#endif // defined(__INTEL_PREVIEW_BREAKING_CHANGES)

__SYCL_OPASSIGN(+=, std::plus)
__SYCL_OPASSIGN(-=, std::minus)
Expand All @@ -1854,18 +1840,6 @@ class SwizzleOp {
#ifdef __SYCL_UOP
#error "Undefine __SYCL_UOP macro"
#endif
#if defined(__INTEL_PREVIEW_BREAKING_CHANGES)
#define __SYCL_UOP(UOP, OPASSIGN) \
friend SwizzleOp &operator UOP(SwizzleOp & Rhs) { \
Rhs OPASSIGN static_cast<DataT>(1); \
return Rhs; \
} \
friend vec_t operator UOP(SwizzleOp &Lhs, int) { \
vec_t Ret = Lhs; \
Lhs OPASSIGN static_cast<DataT>(1); \
return Ret; \
}
#else // defined(__INTEL_PREVIEW_BREAKING_CHANGES)
#define __SYCL_UOP(UOP, OPASSIGN) \
SwizzleOp &operator UOP() { \
*this OPASSIGN static_cast<DataT>(1); \
Expand All @@ -1876,7 +1850,6 @@ class SwizzleOp {
*this OPASSIGN static_cast<DataT>(1); \
return Ret; \
}
#endif // defined(__INTEL_PREVIEW_BREAKING_CHANGES)

__SYCL_UOP(++, +=)
__SYCL_UOP(--, -=)
Expand Down

0 comments on commit 6194f3c

Please sign in to comment.