19 #include <rmm/mr/host/pinned_memory_resource.hpp>
29 : size_{n}, data_{static_cast<T*>(pinned_mr.allocate(n * sizeof(T)))}
31 std::uninitialized_fill(data_, data_ + n,
static_cast<T
>(0));
43 data_ =
static_cast<T*
>(pinned_mr.allocate(n *
sizeof(T)));
44 std::uninitialized_fill(data_, data_ + n,
static_cast<T
>(0));
47 T*
data() {
return data_; }
51 T*
end() {
return data_ + size_; }
53 std::size_t
size() {
return size_; }
55 T
operator[](std::size_t idx)
const {
return *(data_ + idx); }
56 T&
operator[](std::size_t idx) {
return *(data_ + idx); }
59 rmm::mr::pinned_memory_resource pinned_mr{};
Definition: pinned_host_vector.hpp:24
pinned_host_vector & operator=(pinned_host_vector &&)=delete
T & operator[](std::size_t idx)
Definition: pinned_host_vector.hpp:56
pinned_host_vector()=default
T * begin()
Definition: pinned_host_vector.hpp:49
pinned_host_vector(pinned_host_vector const &)=delete
T operator[](std::size_t idx) const
Definition: pinned_host_vector.hpp:55
void resize(std::size_t n)
Definition: pinned_host_vector.hpp:40
T * end()
Definition: pinned_host_vector.hpp:51
T * data()
Definition: pinned_host_vector.hpp:47
pinned_host_vector(std::size_t n)
Definition: pinned_host_vector.hpp:28
pinned_host_vector(pinned_host_vector &&)=delete
std::size_t size()
Definition: pinned_host_vector.hpp:53
~pinned_host_vector()
Definition: pinned_host_vector.hpp:33
pinned_host_vector & operator=(pinned_host_vector const &)=delete
Definition: dbscan.hpp:30