buffer.h
Go to the documentation of this file.
63 Buffer(std::unique_ptr<element_type[], Deleter> ptr, std::size_t n, ttg::scope scope = ttg::scope::SyncIn)
74 Buffer(std::shared_ptr<element_type[]> ptr, std::size_t n, ttg::scope scope = ttg::scope::SyncIn)
125 if (!device.is_host()) throw std::runtime_error("MADNESS backend does not support non-host memory!");
172 if (device.is_device()) throw std::runtime_error("MADNESS missing support for non-host memory!");
180 if (device.is_device()) throw std::runtime_error("MADNESS missing support for non-host memory!");
194 if (device.is_device()) throw std::runtime_error("MADNESS missing support for non-host memory!");
262 void reset(std::shared_ptr<element_type[]> ptr, std::size_t n, ttg::scope scope = ttg::scope::SyncIn) {
auto wrap(funcT &&func, const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &inedges, const std::tuple< output_edgesT... > &outedges, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_edge_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
Definition: make_tt.h:590
constexpr auto get(span< E, S > s) -> decltype(s[N])
Definition: span.h:492
@ SyncIn
A runtime-managed buffer mirrored between host and device memory.
Definition: buffer.h:13
ttg::device::Device get_owner_device() const
Definition: buffer.h:137
Buffer & operator=(const Buffer &db)=delete
void reset(std::shared_ptr< element_type[]> ptr, std::size_t n, ttg::scope scope=ttg::scope::SyncIn)
Definition: buffer.h:262
const element_type * device_ptr_on(const ttg::device::Device &device) const
Definition: buffer.h:178
const element_type * current_device_ptr() const
Definition: buffer.h:149
bool is_current_on(ttg::device::Device dev) const
Definition: buffer.h:130
element_type * device_ptr_on(const ttg::device::Device &device)
Definition: buffer.h:170
const element_type * owner_device_ptr() const
Definition: buffer.h:163
void reset(std::size_t n, ttg::scope scope=ttg::scope::SyncIn)
Definition: buffer.h:244
Buffer(const Buffer &db)=delete
Buffer(std::shared_ptr< element_type[]> ptr, std::size_t n, ttg::scope scope=ttg::scope::SyncIn)
Definition: buffer.h:74
bool is_valid_on(const ttg::device::Device &device) const
Definition: buffer.h:192
void allocate_on(const ttg::device::Device &device_id)
Definition: buffer.h:198
typename allocator_traits::allocator_type allocator_type
Definition: buffer.h:18
std::allocator_traits< Allocator > allocator_traits
Definition: buffer.h:17
Buffer(std::unique_ptr< element_type[], Deleter > ptr, std::size_t n, ttg::scope scope=ttg::scope::SyncIn)
Definition: buffer.h:63
Buffer(std::size_t n, ttg::scope scope=ttg::scope::SyncIn)
Definition: buffer.h:52
void set_current_device(const ttg::device::Device &device)
Definition: buffer.h:123