diff --git a/sycl/include/CL/sycl/multi_ptr.hpp b/sycl/include/CL/sycl/multi_ptr.hpp index 11403bf890180..40ca217e15728 100644 --- a/sycl/include/CL/sycl/multi_ptr.hpp +++ b/sycl/include/CL/sycl/multi_ptr.hpp @@ -126,8 +126,11 @@ template class multi_ptr { return reinterpret_cast(m_Pointer); } - // Explicit conversion to a multi_ptr - explicit operator multi_ptr() const; + // Implicit conversion to a multi_ptr + operator multi_ptr() const { + using void_ptr_t = typename detail::PtrValueType::type *; + return multi_ptr(reinterpret_cast(m_Pointer)); + }; // Arithmetic operators multi_ptr &operator++() { @@ -210,6 +213,14 @@ template class multi_ptr { multi_ptr(std::nullptr_t) : m_Pointer(nullptr) {} ~multi_ptr() = default; + // TODO: this constructor is a temporary solution for the cases where + // the conversion to void multi pointer is used. Without it the compiler + // fails due to having 3 different same rank paths available. + // The issue is being discussed in Khronos groups now. + // See https://gitlab.khronos.org/sycl/Specification/issues/215 for details. + template + multi_ptr(const multi_ptr &ETP) : m_Pointer(ETP.get()) {} + // Assignment operators multi_ptr &operator=(const multi_ptr &) = default; multi_ptr &operator=(multi_ptr &&) = default;