Visible to Intel only — GUID: GUID-BA3E20AE-6716-4043-9E4F-1C21D976D111
Visible to Intel only — GUID: GUID-BA3E20AE-6716-4043-9E4F-1C21D976D111
DPCT1011
Message
The tool detected overloaded operators for built-in vector types, which may conflict with the SYCL 2020 standard operators (see 4.14.2.1 Vec interface). The tool inserted a namespace to avoid the conflict. Use SYCL 2020 standard operators instead.
Detailed Help
You may have overloaded operators for vector types such as double2. This resulted in a conflict because overloaded operators with the same signature are also defined in the SYCL* standard. Intel® DPC++ Compatibility Tool adds the namespace for overloaded operators to differentiate them from the ones defined in SYCL. You may need to rewrite the code.
Suggestions to Fix
You may need to rewrite this code.
For example, this original CUDA* code:
__host__ __device__ double2 &operator+=(double2 &a, const double2 &b) { a.x += b.x; a.y += b.y; return a; } void foo(double2 &a, double2 &b) { a += b; }
results in the following migrated SYCL code:
/* DPCT1011:0: The tool detected overloaded operators for built-in vector types, which may conflict with the SYCL 2020 standard operators (see 4.14.2.1 Vec interface). The tool inserted a namespace to avoid the conflict. Use SYCL 2020 standard operators instead. */ namespace dpct_operator_overloading { sycl::double2 &operator+=(sycl::double2 &a, const sycl::double2 &b) { a.x() += b.x(); a.y() += b.y(); return a; } } // namespace dpct_operator_overloading void foo(sycl::double2 &a, sycl::double2 &b) { dpct_operator_overloading::operator+=(a, b); }
which is rewritten to:
void foo(sycl::double2 &a, sycl::double2 &b) { // In this case, the user-defined overloading of `+=` has been supported by sycl::double2, so we can use the operator `+=` directly. a += b; }