ttg_data_copy.h
Go to the documentation of this file.
67 //std::fprintf(stderr, "parsec_data_destroy %p device_copy[0] %p\n", data, data->device_copies[0]);
286 //std::cout << "data-copy " << this << " inc_current_version " << " count " << m_num_dev_data << std::endl;
320 //std::cout << "data-copy " << this << " add data " << data << " count " << m_num_dev_data << std::endl;
325 //std::cout << "data-copy " << this << " remove data " << data << " count " << m_num_dev_data << std::endl;
431 int32_t m_readers = 1;
436 std::vector<ttg_parsec_data_wrapper_t*> m_dev_data; //< used if there are multiple device copies
542 ttg_parsec_data_wrapper_t::ttg_parsec_data_wrapper_t()
571 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:111
ttg_data_copy_self_t(ttg_data_copy_t *dc)
Definition: ttg_data_copy.h:124
parsec_list_item_t super
Definition: ttg_data_copy.h:122
parsec_task_t * m_next_task
Definition: ttg_data_copy.h:430
bool is_mutable() const
Definition: ttg_data_copy.h:205
static constexpr int mutable_tag
Definition: ttg_data_copy.h:140
ttg_data_copy_t()
Definition: ttg_data_copy.h:142
ttg_parsec_data_wrapper_t * m_single_dev_data
Definition: ttg_data_copy.h:438
parsec_task_t * get_next_task() const
Definition: ttg_data_copy.h:260
ttg::span< ttg::iovec > iovec_span()
Definition: ttg_data_copy.h:417
ttg_data_copy_t(const ttg_data_copy_t &c)
Definition: ttg_data_copy.h:146
void reset_readers()
Definition: ttg_data_copy.h:231
std::vector< ttg_parsec_data_wrapper_t * > m_dev_data
Definition: ttg_data_copy.h:436
int num_dev_data() const
Definition: ttg_data_copy.h:347
void foreach_wrapper(Fn &&fn)
Definition: ttg_data_copy.h:352
std::size_t iovec_count() const
Definition: ttg_data_copy.h:421
void remove_device_data(ttg_parsec_data_wrapper_t *data)
Definition: ttg_data_copy.h:324
virtual void * get_ptr()=0
void transfer_ownership(int access, int device=0)
Definition: ttg_data_copy.h:293
ttg_data_copy_t(ttg_data_copy_t &&c)
Definition: ttg_data_copy.h:154
int increment_readers()
Definition: ttg_data_copy.h:218
int m_num_dev_data
Definition: ttg_data_copy.h:439
ttg_data_copy_t & operator=(const ttg_data_copy_t &c)
Definition: ttg_data_copy.h:193
void inc_current_version()
Definition: ttg_data_copy.h:285
void foreach_parsec_data(Fn &&fn)
Definition: ttg_data_copy.h:361
std::vector< ttg::iovec > m_iovecs
Definition: ttg_data_copy.h:434
void iovec_add(const ttg::iovec &iov)
Definition: ttg_data_copy.h:413
virtual ~ttg_data_copy_t()=default
int decrement_readers()
Definition: ttg_data_copy.h:241
void add_device_data(ttg_parsec_data_wrapper_t *data)
Definition: ttg_data_copy.h:305
iovec_iterator iovec_begin()
Definition: ttg_data_copy.h:401
ttg_data_copy_t & operator=(ttg_data_copy_t &&c)
Definition: ttg_data_copy.h:172
std::atomic< int32_t > m_refs
Definition: ttg_data_copy.h:432
int num_readers() const
Definition: ttg_data_copy.h:253
typename std::vector< ttg::iovec >::iterator iovec_iterator
Definition: ttg_data_copy.h:399
void set_next_task(parsec_task_t *task)
Definition: ttg_data_copy.h:264
iovec_iterator iovec_end()
Definition: ttg_data_copy.h:405
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:464
virtual ~ttg_data_value_copy_t()=default
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:495
ttg_data_value_copy_t(T &&value)
Definition: ttg_data_copy.h:455
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:474
virtual void * get_ptr() override final
Definition: ttg_data_copy.h:513
ValueT value_type
Definition: ttg_data_copy.h:451
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:484
value_type & operator*()
Definition: ttg_data_copy.h:506
void remove_from_owner()
Definition: ttg_data_copy.h:523
static parsec_data_t * create_parsec_data(void *ptr, size_t size)
Definition: ttg_data_copy.h:40
static void delete_null_parsec_data(parsec_data_t *)
Definition: ttg_data_copy.h:77
void set_owner(ttg_data_copy_t &new_copy)
Definition: ttg_data_copy.h:102
static void delete_parsec_data(parsec_data_t *data)
Definition: ttg_data_copy.h:57
const parsec_data_t * parsec_data() const
Definition: ttg_data_copy.h:53
friend ttg_data_copy_t
Definition: ttg_data_copy.h:38
void reset_parsec_data(void *ptr, size_t size)
Definition: ttg_data_copy.h:531
virtual ~ttg_parsec_data_wrapper_t()
Definition: ttg_data_copy.h:588
ttg_parsec_data_wrapper_t()
Definition: ttg_data_copy.h:542
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:49
Definition: ptr.h:15