Skip to content

[SYCL] Change which constructor is gated for devices #1183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2020
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