STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
Concurrency::details::_Ubiquitous_buffer Class Reference

#include <amprt.h>

Inheritance diagram for Concurrency::details::_Ubiquitous_buffer:
Concurrency::details::_Reference_counter

Public Member Functions

_AMPIMP void _Register_view (_In_ _View_key _Key, accelerator_view _Cpu_av, _View_shape_ptr _Shape, _In_opt_ const _View_key _Source_view_key=nullptr)
 
_AMPIMP void _Register_view_copy (_In_ _View_key _New_view_key, _In_ _View_key _Existing_view_key)
 
_AMPIMP void _Unregister_view (_In_ _View_key _Key)
 
_AMPIMP _Event _Get_access_async (_In_ _View_key _Key, _Accelerator_view_impl_ptr _Av_view_impl_ptr, _Access_mode _Mode, _Buffer_ptr &_Buf_ptr, _Inout_opt_ ULONGLONG *_Sync_size=nullptr)
 
_AMPIMP void _Discard (_In_ _View_key _Key)
 
_AMPIMP _Buffer_ptr _Get_master_buffer () const
 
_AMPIMP accelerator_view _Get_master_accelerator_view () const
 
_AMPIMP _View_shape_ptr _Get_view_shape (_In_ _View_key _Key)
 
_Ret_ _Accelerator_view_impl * _Get_master_accelerator_view_impl () const
 
size_t _Get_master_buffer_elem_size () const
 
size_t _Get_master_buffer_num_elems () const
 
bool _Has_data_source () const
 
- Public Member Functions inherited from Concurrency::details::_Reference_counter
 _Reference_counter ()
 
virtual ~_Reference_counter () noexcept(false)
 
size_t _Add_reference ()
 
size_t _Remove_reference ()
 
_AMPIMP void _Release ()
 
size_t _Get_reference_count ()
 

Static Public Member Functions

static _AMPIMP _Ret_ _Ubiquitous_buffer *__cdecl _Create_ubiquitous_buffer (size_t _Num_elems, size_t _Elem_size)
 
static _AMPIMP _Ret_ _Ubiquitous_buffer *__cdecl _Create_ubiquitous_buffer (_Buffer_ptr _Master_buffer)
 

Private Member Functions

 _Ubiquitous_buffer (size_t _Num_elems, size_t _Elem_size)
 
 _Ubiquitous_buffer (_In_ _Buffer *_Master_buffer)
 
 ~_Ubiquitous_buffer ()
 
 _Ubiquitous_buffer ()
 
 _Ubiquitous_buffer (const _Ubiquitous_buffer &rhs)
 
_Ubiquitous_bufferoperator= (const _Ubiquitous_buffer &rhs)
 
_AMPIMP _Event _Get_access_async (_In_ _View_key _Key, accelerator_view _Av, _Access_mode _Mode, _Buffer_ptr &_Buf_ptr, _Inout_opt_ ULONGLONG *_Sync_size=NULL)
 
_Event _Commit_view_async (_In_ _View_info *_Info, _Inout_ ULONGLONG *_Sync_size=nullptr)
 
_Ret_ _Buffer_Get_buffer (_In_ _Accelerator_view_impl *_Av, bool _Create=true)
 
void _Set_new_access_mode (_Inout_ _View_info *_Info, _Access_mode _New_mode)
 
void _Unset_discard_flag (_Inout_ _View_info *_Info)
 
bool _Should_discard (const _View_info *_Info, _In_opt_ const _View_key _Source_view_key=nullptr) const
 
bool _Has_exclusive_data (const _View_info *_Info) const
 
bool _Requires_update_on_target_accelerator_view (const _View_info *_Info, _Access_mode _Requested_mode, _In_ _Accelerator_view_impl *_Target_acclerator_view) const
 
_Accelerator_view_unordered_set _Get_caching_info (_In_ _View_key _Key, _Out_opt_ bool *_Can_access_anywhere=NULL)
 
_Accelerator_view_unordered_set _Get_caching_info_impl (_In_ _View_key _Key, _Out_opt_ bool *_Can_access_anywhere)
 
_Ret_ _Accelerator_view_impl * _Determine_alternate_target_accelerator_view (_In_ _View_key _Key, _In_ _Accelerator_view_impl *_Original_av, _Access_mode _Mode)
 
const _View_info * _Get_view_info_ptr (_In_ const _View_key key) const
 

Static Private Member Functions

static void _Flag_redundant_commits (std::vector< std::pair< _View_info *, bool >> &_Commit_list)
 

Private Attributes

_Accelerator_view_impl_ptr _M_master_av
 
_Buffer_M_master_buffer
 
size_t _M_master_buffer_elem_size
 
size_t _M_master_buffer_num_elems
 
bool _M_has_data_source
 
std::map< _Accelerator_view_impl_ptr, _Buffer_ptr_M_buffer_map
 
std::unordered_map< _View_key, _View_info * > _M_view_map
 
std::unordered_set< _View_info * > _M_view_info_set
 
Concurrency::critical_section _M_critical_section
 

Friends

struct _DPC_call_handle
 
_Event _Get_access_async (const _View_key _Key, accelerator_view _Av, _Access_mode _Mode, _Buffer_ptr &_Buf_ptr)
 
_AMPIMP accelerator_view __cdecl _Select_copy_src_accelerator_view (_In_ _View_key _Src_view_key, const accelerator_view &_Dest_accelerator_view)
 

Constructor & Destructor Documentation

Concurrency::details::_Ubiquitous_buffer::_Ubiquitous_buffer ( size_t  _Num_elems,
size_t  _Elem_size 
)
private
Concurrency::details::_Ubiquitous_buffer::_Ubiquitous_buffer ( _In_ _Buffer _Master_buffer)
private
Concurrency::details::_Ubiquitous_buffer::~_Ubiquitous_buffer ( )
private
Concurrency::details::_Ubiquitous_buffer::_Ubiquitous_buffer ( )
private
Concurrency::details::_Ubiquitous_buffer::_Ubiquitous_buffer ( const _Ubiquitous_buffer rhs)
private

Member Function Documentation

_Event Concurrency::details::_Ubiquitous_buffer::_Commit_view_async ( _In_ _View_info *  _Info,
_Inout_ ULONGLONG *  _Sync_size = nullptr 
)
private
static _AMPIMP _Ret_ _Ubiquitous_buffer* __cdecl Concurrency::details::_Ubiquitous_buffer::_Create_ubiquitous_buffer ( size_t  _Num_elems,
size_t  _Elem_size 
)
static
static _AMPIMP _Ret_ _Ubiquitous_buffer* __cdecl Concurrency::details::_Ubiquitous_buffer::_Create_ubiquitous_buffer ( _Buffer_ptr  _Master_buffer)
static
_Ret_ _Accelerator_view_impl* Concurrency::details::_Ubiquitous_buffer::_Determine_alternate_target_accelerator_view ( _In_ _View_key  _Key,
_In_ _Accelerator_view_impl *  _Original_av,
_Access_mode  _Mode 
)
private
_AMPIMP void Concurrency::details::_Ubiquitous_buffer::_Discard ( _In_ _View_key  _Key)
static void Concurrency::details::_Ubiquitous_buffer::_Flag_redundant_commits ( std::vector< std::pair< _View_info *, bool >> &  _Commit_list)
staticprivate
_AMPIMP _Event Concurrency::details::_Ubiquitous_buffer::_Get_access_async ( _In_ _View_key  _Key,
_Accelerator_view_impl_ptr  _Av_view_impl_ptr,
_Access_mode  _Mode,
_Buffer_ptr _Buf_ptr,
_Inout_opt_ ULONGLONG *  _Sync_size = nullptr 
)
_AMPIMP _Event Concurrency::details::_Ubiquitous_buffer::_Get_access_async ( _In_ _View_key  _Key,
accelerator_view  _Av,
_Access_mode  _Mode,
_Buffer_ptr _Buf_ptr,
_Inout_opt_ ULONGLONG *  _Sync_size = NULL 
)
private
_Ret_ _Buffer* Concurrency::details::_Ubiquitous_buffer::_Get_buffer ( _In_ _Accelerator_view_impl *  _Av,
bool  _Create = true 
)
private
_Accelerator_view_unordered_set Concurrency::details::_Ubiquitous_buffer::_Get_caching_info ( _In_ _View_key  _Key,
_Out_opt_ bool _Can_access_anywhere = NULL 
)
private
_Accelerator_view_unordered_set Concurrency::details::_Ubiquitous_buffer::_Get_caching_info_impl ( _In_ _View_key  _Key,
_Out_opt_ bool _Can_access_anywhere 
)
private
_AMPIMP accelerator_view Concurrency::details::_Ubiquitous_buffer::_Get_master_accelerator_view ( ) const
_Ret_ _Accelerator_view_impl* Concurrency::details::_Ubiquitous_buffer::_Get_master_accelerator_view_impl ( ) const
inline
3232  {
3233  return _M_master_av;
3234  }
_Accelerator_view_impl_ptr _M_master_av
Definition: amprt.h:3340
_AMPIMP _Buffer_ptr Concurrency::details::_Ubiquitous_buffer::_Get_master_buffer ( ) const
size_t Concurrency::details::_Ubiquitous_buffer::_Get_master_buffer_elem_size ( ) const
inline
3237  {
3239  }
size_t _M_master_buffer_elem_size
Definition: amprt.h:3347
size_t Concurrency::details::_Ubiquitous_buffer::_Get_master_buffer_num_elems ( ) const
inline
3242  {
3244  }
size_t _M_master_buffer_num_elems
Definition: amprt.h:3350
const _View_info* Concurrency::details::_Ubiquitous_buffer::_Get_view_info_ptr ( _In_ const _View_key  key) const
inlineprivate
3329  {
3330  auto const iterator = _M_view_map.find(key);
3331  return _M_view_map.end() == iterator ? nullptr : iterator->second;
3332  }
std::unordered_map< _View_key, _View_info * > _M_view_map
Definition: amprt.h:3362
_AMPIMP _View_shape_ptr Concurrency::details::_Ubiquitous_buffer::_Get_view_shape ( _In_ _View_key  _Key)
bool Concurrency::details::_Ubiquitous_buffer::_Has_data_source ( ) const
inline
3247  {
3248  return _M_has_data_source;
3249  }
bool _M_has_data_source
Definition: amprt.h:3353
bool Concurrency::details::_Ubiquitous_buffer::_Has_exclusive_data ( const _View_info *  _Info) const
private
_AMPIMP void Concurrency::details::_Ubiquitous_buffer::_Register_view ( _In_ _View_key  _Key,
accelerator_view  _Cpu_av,
_View_shape_ptr  _Shape,
_In_opt_ const _View_key  _Source_view_key = nullptr 
)
_AMPIMP void Concurrency::details::_Ubiquitous_buffer::_Register_view_copy ( _In_ _View_key  _New_view_key,
_In_ _View_key  _Existing_view_key 
)
bool Concurrency::details::_Ubiquitous_buffer::_Requires_update_on_target_accelerator_view ( const _View_info *  _Info,
_Access_mode  _Requested_mode,
_In_ _Accelerator_view_impl *  _Target_acclerator_view 
) const
private
void Concurrency::details::_Ubiquitous_buffer::_Set_new_access_mode ( _Inout_ _View_info *  _Info,
_Access_mode  _New_mode 
)
private
bool Concurrency::details::_Ubiquitous_buffer::_Should_discard ( const _View_info *  _Info,
_In_opt_ const _View_key  _Source_view_key = nullptr 
) const
private
_AMPIMP void Concurrency::details::_Ubiquitous_buffer::_Unregister_view ( _In_ _View_key  _Key)
void Concurrency::details::_Ubiquitous_buffer::_Unset_discard_flag ( _Inout_ _View_info *  _Info)
private
_Ubiquitous_buffer& Concurrency::details::_Ubiquitous_buffer::operator= ( const _Ubiquitous_buffer rhs)
private

Friends And Related Function Documentation

friend struct _DPC_call_handle
friend
_Event _Get_access_async ( const _View_key  _Key,
accelerator_view  _Av,
_Access_mode  _Mode,
_Buffer_ptr _Buf_ptr 
)
friend
3390  {
3391  return _Key->_Get_buffer_ptr()->_Get_access_async(_Key->_Get_view_key(), _Av, _Mode, _Buf_ptr);
3392  }
_Ret_ _View_key _Get_view_key()
Definition: amprt.h:537
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:503
friend _Event _Get_access_async(const _View_key _Key, accelerator_view _Av, _Access_mode _Mode, _Buffer_ptr &_Buf_ptr)
Definition: amprt.h:3389
_AMPIMP accelerator_view __cdecl _Select_copy_src_accelerator_view ( _In_ _View_key  _Src_view_key,
const accelerator_view _Dest_accelerator_view 
)
friend

Member Data Documentation

std::map<_Accelerator_view_impl_ptr, _Buffer_ptr> Concurrency::details::_Ubiquitous_buffer::_M_buffer_map
private
Concurrency::critical_section Concurrency::details::_Ubiquitous_buffer::_M_critical_section
private
bool Concurrency::details::_Ubiquitous_buffer::_M_has_data_source
private
_Accelerator_view_impl_ptr Concurrency::details::_Ubiquitous_buffer::_M_master_av
private
_Buffer* Concurrency::details::_Ubiquitous_buffer::_M_master_buffer
private
size_t Concurrency::details::_Ubiquitous_buffer::_M_master_buffer_elem_size
private
size_t Concurrency::details::_Ubiquitous_buffer::_M_master_buffer_num_elems
private
std::unordered_set<_View_info*> Concurrency::details::_Ubiquitous_buffer::_M_view_info_set
private
std::unordered_map<_View_key, _View_info*> Concurrency::details::_Ubiquitous_buffer::_M_view_map
private

The documentation for this class was generated from the following file: