12#if defined(PARSEC_HAVE_DEV_CUDA_SUPPORT)
13#include <cuda_runtime.h>
28 struct ttg_data_copy_t;
31 template<
typename T = ttg_data_copy_t>
49 PARSEC_OBJ_CONSTRUCT(&
super, parsec_list_item_t);
62 static constexpr int mutable_tag = std::numeric_limits<int>::min();
88 c.m_next_task =
nullptr;
91 m_refs.store(c.m_refs.load(std::memory_order_relaxed), std::memory_order_relaxed);
92 c.m_refs.store(0, std::memory_order_relaxed);
120 template<
bool Atomic = true>
122 if constexpr(Atomic) {
123 return parsec_atomic_fetch_inc_int32(&
m_readers);
143 template<
bool Atomic = true>
145 if constexpr(Atomic) {
146 return parsec_atomic_fetch_dec_int32(&
m_readers);
172 return m_refs.fetch_add(1, std::memory_order_relaxed);
176 return m_refs.fetch_sub(1, std::memory_order_relaxed);
180 return (
m_refs.load(std::memory_order_relaxed) != 0);
184 return m_refs.load(std::memory_order_relaxed);
187#if defined(PARSEC_PROF_TRACE) && defined(PARSEC_TTG_PROFILE_BACKEND)
203 template<
typename ValueT>
210 requires(std::constructible_from<ValueT, T>)
214 ,
m_value(std::forward<T>(value))
221 noexcept(std::is_nothrow_move_constructible_v<value_type>)
231 noexcept(std::is_nothrow_copy_constructible_v<value_type>)
241 noexcept(std::is_nothrow_move_assignable_v<value_type>)
246 m_value = std::move(c.m_value);
252 noexcept(std::is_nothrow_copy_assignable_v<value_type>)
ttg_data_copy_t *& ttg_data_copy_container()
this contains PaRSEC-based TTG functionality
ttg_data_copy_container_setter(T *ptr)
ttg_data_copy_self_t(ttg_data_copy_t *dc)
parsec_task_t * m_next_task
static constexpr int mutable_tag
ttg_data_copy_t(const ttg_data_copy_t &c)
ttg_data_copy_t(ttg_data_copy_t &&c)
parsec_task_t * get_next_task() const
virtual void * get_ptr()=0
virtual ~ttg_data_copy_t()=default
ttg_data_copy_t & operator=(ttg_data_copy_t &&c)
std::atomic< int32_t > m_refs
void set_next_task(parsec_task_t *task)
ttg_data_copy_t & operator=(const ttg_data_copy_t &c)
ttg_data_value_copy_t(ttg_data_value_copy_t &&c) noexcept(std::is_nothrow_move_constructible_v< value_type >)
ttg_data_value_copy_t & operator=(ttg_data_value_copy_t &&c) noexcept(std::is_nothrow_move_assignable_v< value_type >)
ttg_data_value_copy_t & operator=(const ttg_data_value_copy_t &c) noexcept(std::is_nothrow_copy_assignable_v< value_type >)
virtual ~ttg_data_value_copy_t()=default
virtual void * get_ptr() override final
ttg_data_value_copy_t(T &&value)
ttg_data_value_copy_t(const ttg_data_value_copy_t &c) noexcept(std::is_nothrow_copy_constructible_v< value_type >)