diff --git a/sycl/include/CL/sycl/multi_ptr.hpp b/sycl/include/CL/sycl/multi_ptr.hpp index 808d165e868d1..89ad90dc027b5 100644 --- a/sycl/include/CL/sycl/multi_ptr.hpp +++ b/sycl/include/CL/sycl/multi_ptr.hpp @@ -44,31 +44,36 @@ template class multi_ptr { multi_ptr() : m_Pointer(nullptr) {} multi_ptr(const multi_ptr &rhs) = default; multi_ptr(multi_ptr &&) = default; - multi_ptr(pointer_t pointer) : m_Pointer(pointer) {} #ifdef __SYCL_DEVICE_ONLY__ + multi_ptr(pointer_t pointer) : m_Pointer(pointer) {} +#endif + multi_ptr(ElementType *pointer) : m_Pointer((pointer_t)(pointer)) { // TODO An implementation should reject an argument if the deduced // address space is not compatible with Space. } -#endif + multi_ptr(std::nullptr_t) : m_Pointer(nullptr) {} ~multi_ptr() = default; // Assignment and access operators multi_ptr &operator=(const multi_ptr &) = default; multi_ptr &operator=(multi_ptr &&) = default; + +#ifdef __SYCL_DEVICE_ONLY__ multi_ptr &operator=(pointer_t pointer) { m_Pointer = pointer; return *this; } -#ifdef __SYCL_DEVICE_ONLY__ +#endif + multi_ptr &operator=(ElementType *pointer) { // TODO An implementation should reject an argument if the deduced // address space is not compatible with Space. m_Pointer = (pointer_t)pointer; return *this; } -#endif + multi_ptr &operator=(std::nullptr_t) { m_Pointer = nullptr; return *this;