Skip to content

Commit e5a215e

Browse files
committed
[SYCL] Fix compilation of vector relational operators
Recently committed improvement to vector class using conversion to OpenCL vector type can be enabled only for the device code. Signed-off-by: Alexey Bader <[email protected]>
1 parent e0e7a7f commit e5a215e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sycl/include/CL/sycl/types.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,9 @@ template <typename Type, int NumElements> class vec {
724724
#ifdef __SYCL_RELLOGOP
725725
#error "Undefine __SYCL_RELLOGOP macro"
726726
#endif
727-
#ifdef __SYCL_USE_EXT_VECTOR_TYPE__
727+
// Use __SYCL_DEVICE_ONLY__ macro because cast to OpenCL vector type is defined
728+
// by SYCL device compiler only.
729+
#ifdef __SYCL_DEVICE_ONLY__
728730
#define __SYCL_RELLOGOP(RELLOGOP) \
729731
vec<rel_t, NumElements> operator RELLOGOP(const vec &Rhs) const { \
730732
return vec<rel_t, NumElements>{m_Data RELLOGOP vector_t(Rhs)}; \

0 commit comments

Comments
 (0)