Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions sycl/include/CL/sycl/multi_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,36 @@ template <typename ElementType, access::address_space Space> 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;
Expand Down