Skip to content

Commit 6194f3c

Browse files
[SYCL] Revert friend changes to assignment and incr/decr for swizzles (#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>
1 parent 3f445cf commit 6194f3c

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

sycl/include/sycl/types.hpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,19 +1814,6 @@ class SwizzleOp {
18141814
#ifdef __SYCL_OPASSIGN
18151815
#error "Undefine __SYCL_OPASSIGN macro."
18161816
#endif
1817-
#if defined(__INTEL_PREVIEW_BREAKING_CHANGES)
1818-
#define __SYCL_OPASSIGN(OPASSIGN, OP) \
1819-
friend SwizzleOp &operator OPASSIGN(SwizzleOp & Lhs, const DataT & Rhs) { \
1820-
Lhs.operatorHelper<OP>(vec_t(Rhs)); \
1821-
return Lhs; \
1822-
} \
1823-
template <typename RhsOperation> \
1824-
friend SwizzleOp &operator OPASSIGN(SwizzleOp & Lhs, \
1825-
const RhsOperation & Rhs) { \
1826-
Lhs.operatorHelper<OP>(Rhs); \
1827-
return Lhs; \
1828-
}
1829-
#else // defined(__INTEL_PREVIEW_BREAKING_CHANGES)
18301817
#define __SYCL_OPASSIGN(OPASSIGN, OP) \
18311818
SwizzleOp &operator OPASSIGN(const DataT & Rhs) { \
18321819
operatorHelper<OP>(vec_t(Rhs)); \
@@ -1837,7 +1824,6 @@ class SwizzleOp {
18371824
operatorHelper<OP>(Rhs); \
18381825
return *this; \
18391826
}
1840-
#endif // defined(__INTEL_PREVIEW_BREAKING_CHANGES)
18411827

18421828
__SYCL_OPASSIGN(+=, std::plus)
18431829
__SYCL_OPASSIGN(-=, std::minus)
@@ -1854,18 +1840,6 @@ class SwizzleOp {
18541840
#ifdef __SYCL_UOP
18551841
#error "Undefine __SYCL_UOP macro"
18561842
#endif
1857-
#if defined(__INTEL_PREVIEW_BREAKING_CHANGES)
1858-
#define __SYCL_UOP(UOP, OPASSIGN) \
1859-
friend SwizzleOp &operator UOP(SwizzleOp & Rhs) { \
1860-
Rhs OPASSIGN static_cast<DataT>(1); \
1861-
return Rhs; \
1862-
} \
1863-
friend vec_t operator UOP(SwizzleOp &Lhs, int) { \
1864-
vec_t Ret = Lhs; \
1865-
Lhs OPASSIGN static_cast<DataT>(1); \
1866-
return Ret; \
1867-
}
1868-
#else // defined(__INTEL_PREVIEW_BREAKING_CHANGES)
18691843
#define __SYCL_UOP(UOP, OPASSIGN) \
18701844
SwizzleOp &operator UOP() { \
18711845
*this OPASSIGN static_cast<DataT>(1); \
@@ -1876,7 +1850,6 @@ class SwizzleOp {
18761850
*this OPASSIGN static_cast<DataT>(1); \
18771851
return Ret; \
18781852
}
1879-
#endif // defined(__INTEL_PREVIEW_BREAKING_CHANGES)
18801853

18811854
__SYCL_UOP(++, +=)
18821855
__SYCL_UOP(--, -=)

0 commit comments

Comments
 (0)