ttg_data_copy.h
Go to the documentation of this file.
292 //std::cout << "data-copy " << this << " inc_current_version " << " count " << m_num_dev_data << std::endl;
326 //std::cout << "data-copy " << this << " add data " << data << " count " << m_num_dev_data << std::endl;
331 //std::cout << "data-copy " << this << " remove data " << data << " count " << m_num_dev_data << std::endl;
437 int32_t m_readers = 1;
442 std::vector<ttg_parsec_data_wrapper_t*> m_dev_data; //< used if there are multiple device copies
538 void ttg_parsec_data_wrapper_t::reset_parsec_data(void *ptr, size_t size, bool sync_to_device) {
549 ttg_parsec_data_wrapper_t::ttg_parsec_data_wrapper_t()
573 ttg_parsec_data_wrapper_t& ttg_parsec_data_wrapper_t::operator=(ttg_parsec_data_wrapper_t&& other) {
constexpr auto data(C &c) -> decltype(c.data())
Definition: span.h:189
ttg_data_copy_t *& ttg_data_copy_container()
Definition: thread_local.h:14
Definition: iovec.h:11
ttg_data_copy_container_setter(T *ptr)
Definition: ttg_data_copy.h:117
ttg_data_copy_self_t(ttg_data_copy_t *dc)
Definition: ttg_data_copy.h:130
parsec_list_item_t super
Definition: ttg_data_copy.h:128
parsec_task_t * m_next_task
Definition: ttg_data_copy.h:436
bool is_mutable() const
Definition: ttg_data_copy.h:211
static constexpr int mutable_tag
Definition: ttg_data_copy.h:146
ttg_data_copy_t()
Definition: ttg_data_copy.h:148
ttg_parsec_data_wrapper_t * m_single_dev_data
Definition: ttg_data_copy.h:444
parsec_task_t * get_next_task() const
Definition: ttg_data_copy.h:266
ttg::span< ttg::iovec > iovec_span()
Definition: ttg_data_copy.h:423
ttg_data_copy_t(const ttg_data_copy_t &c)
Definition: ttg_data_copy.h:152
void reset_readers()
Definition: ttg_data_copy.h:237
std::vector< ttg_parsec_data_wrapper_t * > m_dev_data
Definition: ttg_data_copy.h:442
int num_dev_data() const
Definition: ttg_data_copy.h:353
void foreach_wrapper(Fn &&fn)
Definition: ttg_data_copy.h:358
std::size_t iovec_count() const
Definition: ttg_data_copy.h:427
void remove_device_data(ttg_parsec_data_wrapper_t *data)
Definition: ttg_data_copy.h:330
virtual void * get_ptr()=0
void transfer_ownership(int access, int device=0)
Definition: ttg_data_copy.h:299
ttg_data_copy_t(ttg_data_copy_t &&c)
Definition: ttg_data_copy.h:160
int increment_readers()
Definition: ttg_data_copy.h:224
int m_num_dev_data
Definition: ttg_data_copy.h:445
ttg_data_copy_t & operator=(const ttg_data_copy_t &c)
Definition: ttg_data_copy.h:199
void inc_current_version()
Definition: ttg_data_copy.h:291
void foreach_parsec_data(Fn &&fn)
Definition: ttg_data_copy.h:367
std::vector< ttg::iovec > m_iovecs
Definition: ttg_data_copy.h:440
void iovec_add(const ttg::iovec &iov)
Definition: ttg_data_copy.h:419
virtual ~ttg_data_copy_t()=default
int decrement_readers()
Definition: ttg_data_copy.h:247
void add_device_data(ttg_parsec_data_wrapper_t *data)
Definition: ttg_data_copy.h:311
iovec_iterator iovec_begin()
Definition: ttg_data_copy.h:407
ttg_data_copy_t & operator=(ttg_data_copy_t &&c)
Definition: ttg_data_copy.h:178
std::atomic< int32_t > m_refs
Definition: ttg_data_copy.h:438
int num_readers() const
Definition: ttg_data_copy.h:259
typename std::vector< ttg::iovec >::iterator iovec_iterator
Definition: ttg_data_copy.h:405
void set_next_task(parsec_task_t *task)
Definition: ttg_data_copy.h:270
iovec_iterator iovec_end()
Definition: ttg_data_copy.h:411
ttg_data_value_copy_t(ttg_data_value_copy_t &&c) noexcept(std::is_nothrow_move_constructible_v< value_type >)
Definition: ttg_data_copy.h:471
virtual ~ttg_data_value_copy_t()=default
requires(std::constructible_from< ValueT, T >) ttg_data_value_copy_t(T &&value)
Definition: ttg_data_copy.h:461
ttg_data_value_copy_t & operator=(const ttg_data_value_copy_t &c) noexcept(std::is_nothrow_copy_assignable_v< value_type >)
Definition: ttg_data_copy.h:502
ttg_data_value_copy_t(const ttg_data_value_copy_t &c) noexcept(std::is_nothrow_copy_constructible_v< value_type >)
Definition: ttg_data_copy.h:481
virtual void * get_ptr() override final
Definition: ttg_data_copy.h:520
ValueT value_type
Definition: ttg_data_copy.h:457
ttg_data_value_copy_t & operator=(ttg_data_value_copy_t &&c) noexcept(std::is_nothrow_move_assignable_v< value_type >)
Definition: ttg_data_copy.h:491
value_type & operator*()
Definition: ttg_data_copy.h:513
void remove_from_owner()
Definition: ttg_data_copy.h:530
static void delete_null_parsec_data(parsec_data_t *)
Definition: ttg_data_copy.h:75
void set_owner(ttg_data_copy_t &new_copy)
Definition: ttg_data_copy.h:100
static parsec_data_t * create_parsec_data(void *ptr, size_t size, bool sync_to_device)
Definition: ttg_data_copy.h:40
static void delete_parsec_data(parsec_data_t *data)
Definition: ttg_data_copy.h:58
void add_copy(int parsec_dev, void *ptr)
Definition: ttg_data_copy.h:105
const parsec_data_t * parsec_data() const
Definition: ttg_data_copy.h:54
friend ttg_data_copy_t
Definition: ttg_data_copy.h:38
virtual ~ttg_parsec_data_wrapper_t()
Definition: ttg_data_copy.h:587
ttg_parsec_data_wrapper_t()
Definition: ttg_data_copy.h:549
ttg_data_copy_t * m_ttg_copy
Definition: ttg_data_copy.h:35
ttg_parsec_data_wrapper_t(const ttg_parsec_data_wrapper_t &other)=delete
std::unique_ptr< parsec_data_t, decltype(&parsec_data_destroy)> parsec_data_ptr
Definition: ttg_data_copy.h:33
parsec_data_ptr m_data
Definition: ttg_data_copy.h:36
ttg_parsec_data_wrapper_t & operator=(const ttg_parsec_data_wrapper_t &other)=delete
parsec_data_t * parsec_data()
Definition: ttg_data_copy.h:50
void reset_parsec_data(void *ptr, size_t size, bool sync_to_device)
Definition: ttg_data_copy.h:538
Definition: ptr.h:15