@@ -126,8 +126,11 @@ template <typename ElementType, access::address_space Space> class multi_ptr {
126
126
return reinterpret_cast <ElementType *>(m_Pointer);
127
127
}
128
128
129
- // Explicit conversion to a multi_ptr<void>
130
- explicit operator multi_ptr<void , Space>() const ;
129
+ // Implicit conversion to a multi_ptr<void>
130
+ operator multi_ptr<void , Space>() const {
131
+ using void_ptr_t = typename detail::PtrValueType<void , Space>::type *;
132
+ return multi_ptr<void , Space>(reinterpret_cast <void_ptr_t >(m_Pointer));
133
+ };
131
134
132
135
// Arithmetic operators
133
136
multi_ptr &operator ++() {
@@ -210,6 +213,14 @@ template <access::address_space Space> class multi_ptr<void, Space> {
210
213
multi_ptr (std::nullptr_t ) : m_Pointer(nullptr ) {}
211
214
~multi_ptr () = default ;
212
215
216
+ // TODO: this constructor is a temporary solution for the cases where
217
+ // the conversion to void multi pointer is used. Without it the compiler
218
+ // fails due to having 3 different same rank paths available.
219
+ // The issue is being discussed in Khronos groups now.
220
+ // See https://gitlab.khronos.org/sycl/Specification/issues/215 for details.
221
+ template <typename ElementType>
222
+ multi_ptr (const multi_ptr<ElementType, Space> &ETP) : m_Pointer(ETP.get()) {}
223
+
213
224
// Assignment operators
214
225
multi_ptr &operator =(const multi_ptr &) = default ;
215
226
multi_ptr &operator =(multi_ptr &&) = default ;
0 commit comments