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

#include <amprt.h>

Inheritance diagram for Concurrency::details::_Buffer:
Concurrency::details::_Reference_counter Concurrency::details::_Texture

Public Member Functions

_AMPIMP void _Map_buffer (_Access_mode _Map_type, bool _Wait)
 
_AMPIMP _Event _Map_buffer_async (_Access_mode _Map_type)
 
_AMPIMP void _Unmap_buffer ()
 
_AMPIMP _Event _Copy_to_async (_Out_ _Buffer *_Dest, size_t _Num_elems, size_t _Src_offset=0, size_t _Dest_offset=0)
 
_AMPIMP _Event _Copy_to_async (_Out_ _Buffer *_Dest, _View_shape_ptr _Src_shape, _View_shape_ptr _Dest_shape)
 
_AMPIMP accelerator_view _Get_accelerator_view () const
 
_AMPIMP accelerator_view _Get_access_on_accelerator_view () const
 
_AMPIMP void _Register_view (_In_ _View_key _Key)
 
_AMPIMP void _Unregister_view (_In_ _View_key _Key)
 
_Ret_ void_Get_data_ptr () const
 
_Ret_ void_Get_host_ptr () const
 
size_t _Get_elem_size () const
 
size_t _Get_num_elems () const
 
_Ret_ _Accelerator_view_impl * _Get_accelerator_view_impl () const
 
_Ret_ _Accelerator_view_impl * _Get_access_on_accelerator_view_impl () const
 
bool _Owns_data () const
 
_AMPIMP bool _Exclusively_owns_data ()
 
bool _Is_staging () const
 
_Access_mode _Get_allowed_host_access_mode () const
 
access_type _Get_allowed_host_access_type () const
 
bool _Is_host_accessible (_Access_mode _Requested_access_mode) const
 
_Access_mode _Get_current_host_access_mode () const
 
bool _Is_temp () const
 
bool _Is_adopted () const
 
bool _Is_buffer () const
 
_AMPIMP bool _Is_mappable () 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_ _Buffer *__cdecl _Create_buffer (accelerator_view _Accelerator_view, accelerator_view _Access_on_accelerator_view, size_t _Num_elems, size_t _Elem_size, bool _Is_temp=false, access_type _Cpu_access_type=access_type_auto)
 
static _AMPIMP _Ret_ _Buffer *__cdecl _Create_buffer (_In_ void *_Data_ptr, accelerator_view _Accelerator_view, size_t _Num_elems, size_t _Elem_size)
 
static _AMPIMP _Ret_ _Buffer *__cdecl _Create_stage_buffer (accelerator_view _Accelerator_view, accelerator_view _Access_on_accelerator_view, size_t _Num_elems, size_t _Elem_size, bool _Is_temp=false)
 
static _AMPIMP _Ret_ _Buffer *__cdecl _Get_temp_staging_buffer (accelerator_view _Av, size_t _Requested_num_elems, size_t _Elem_size)
 

Protected Member Functions

 _Buffer (_In_ _Accelerator_view_impl *_Av, _In_ void *_Buffer_data_ptr, _In_ void *_Host_ptr, _Access_mode _Allowed_host_access_mode, _Access_mode _Current_host_access_mode, size_t _Num_elems, size_t _Elem_size, bool _Owns_data, bool _Is_staging, bool _Is_temp, bool _Is_adopted)
 
virtual ~_Buffer ()
 
 _Buffer ()
 
 _Buffer (const _Buffer &rhs)
 
_Bufferoperator= (const _Buffer &rhs)
 
void _Set_host_ptr (_In_ void *_Host_ptr, _Access_mode _Host_access_mode=_No_access)
 
void _Set_data_ptr (_In_ IUnknown *_Data_ptr)
 

Protected Attributes

_Accelerator_view_impl_ptr _M_accelerator_view
 
_Accelerator_view_impl_ptr _M_access_on_accelerator_view
 
void_M_data_ptr
 
void_M_host_ptr
 
_Access_mode _M_allowed_host_access_mode
 
_Access_mode _M_current_host_access_mode
 
size_t _M_elem_size
 
size_t _M_num_elems
 
bool _M_owns_data
 
bool _M_is_staging
 
bool _M_is_temp
 
bool _M_is_adopted
 
bool _M_is_buffer
 

Private Attributes

std::unique_ptr< std::unordered_set< _View_key > > _M_view_keys
 
Concurrency::critical_section _M_critical_section
 

Friends

class _CPU_accelerator_view_impl
 
class _D3D_accelerator_view_impl
 
class _D3D_temp_staging_cache
 

Constructor & Destructor Documentation

Concurrency::details::_Buffer::_Buffer ( _In_ _Accelerator_view_impl *  _Av,
_In_ void _Buffer_data_ptr,
_In_ void _Host_ptr,
_Access_mode  _Allowed_host_access_mode,
_Access_mode  _Current_host_access_mode,
size_t  _Num_elems,
size_t  _Elem_size,
bool  _Owns_data,
bool  _Is_staging,
bool  _Is_temp,
bool  _Is_adopted 
)
protected
virtual Concurrency::details::_Buffer::~_Buffer ( )
protectedvirtual
Concurrency::details::_Buffer::_Buffer ( )
protected
Concurrency::details::_Buffer::_Buffer ( const _Buffer rhs)
protected

Member Function Documentation

_AMPIMP _Event Concurrency::details::_Buffer::_Copy_to_async ( _Out_ _Buffer _Dest,
size_t  _Num_elems,
size_t  _Src_offset = 0,
size_t  _Dest_offset = 0 
)
_AMPIMP _Event Concurrency::details::_Buffer::_Copy_to_async ( _Out_ _Buffer _Dest,
_View_shape_ptr  _Src_shape,
_View_shape_ptr  _Dest_shape 
)
static _AMPIMP _Ret_ _Buffer* __cdecl Concurrency::details::_Buffer::_Create_buffer ( accelerator_view  _Accelerator_view,
accelerator_view  _Access_on_accelerator_view,
size_t  _Num_elems,
size_t  _Elem_size,
bool  _Is_temp = false,
access_type  _Cpu_access_type = access_type_auto 
)
static
static _AMPIMP _Ret_ _Buffer* __cdecl Concurrency::details::_Buffer::_Create_buffer ( _In_ void _Data_ptr,
accelerator_view  _Accelerator_view,
size_t  _Num_elems,
size_t  _Elem_size 
)
static
static _AMPIMP _Ret_ _Buffer* __cdecl Concurrency::details::_Buffer::_Create_stage_buffer ( accelerator_view  _Accelerator_view,
accelerator_view  _Access_on_accelerator_view,
size_t  _Num_elems,
size_t  _Elem_size,
bool  _Is_temp = false 
)
static
_AMPIMP bool Concurrency::details::_Buffer::_Exclusively_owns_data ( )
_AMPIMP accelerator_view Concurrency::details::_Buffer::_Get_accelerator_view ( ) const
_Ret_ _Accelerator_view_impl* Concurrency::details::_Buffer::_Get_accelerator_view_impl ( ) const
inline
2035  {
2036  return _M_accelerator_view;
2037  }
_Accelerator_view_impl_ptr _M_accelerator_view
Definition: amprt.h:2129
_AMPIMP accelerator_view Concurrency::details::_Buffer::_Get_access_on_accelerator_view ( ) const
_Ret_ _Accelerator_view_impl* Concurrency::details::_Buffer::_Get_access_on_accelerator_view_impl ( ) const
inline
2040  {
2042  }
_Accelerator_view_impl_ptr _M_access_on_accelerator_view
Definition: amprt.h:2130
_Access_mode Concurrency::details::_Buffer::_Get_allowed_host_access_mode ( ) const
inline
2057  {
2059  }
_Access_mode _M_allowed_host_access_mode
Definition: amprt.h:2133
access_type Concurrency::details::_Buffer::_Get_allowed_host_access_type ( ) const
inline
2062  {
2064  }
access_type _Get_cpu_access_type(_Access_mode _Cpu_access_mode)
Definition: amprt.h:1945
_Access_mode _M_allowed_host_access_mode
Definition: amprt.h:2133
_Access_mode Concurrency::details::_Buffer::_Get_current_host_access_mode ( ) const
inline
2072  {
2074  }
_Access_mode _M_current_host_access_mode
Definition: amprt.h:2134
_Ret_ void* Concurrency::details::_Buffer::_Get_data_ptr ( ) const
inline
2013  {
2014  return _M_data_ptr;
2015  }
void * _M_data_ptr
Definition: amprt.h:2131
size_t Concurrency::details::_Buffer::_Get_elem_size ( ) const
inline
2025  {
2026  return _M_elem_size;
2027  }
size_t _M_elem_size
Definition: amprt.h:2135
_Ret_ void* Concurrency::details::_Buffer::_Get_host_ptr ( ) const
inline
2020  {
2021  return _M_host_ptr;
2022  }
void * _M_host_ptr
Definition: amprt.h:2132
size_t Concurrency::details::_Buffer::_Get_num_elems ( ) const
inline
2030  {
2031  return _M_num_elems;
2032  }
size_t _M_num_elems
Definition: amprt.h:2136
static _AMPIMP _Ret_ _Buffer* __cdecl Concurrency::details::_Buffer::_Get_temp_staging_buffer ( accelerator_view  _Av,
size_t  _Requested_num_elems,
size_t  _Elem_size 
)
static
bool Concurrency::details::_Buffer::_Is_adopted ( ) const
inline
2082  {
2083  // Is it adopted from interop?
2084  return _M_is_adopted;
2085  }
bool _M_is_adopted
Definition: amprt.h:2143
bool Concurrency::details::_Buffer::_Is_buffer ( ) const
inline
2088  {
2089  return _M_is_buffer;
2090  }
bool _M_is_buffer
Definition: amprt.h:2144
bool Concurrency::details::_Buffer::_Is_host_accessible ( _Access_mode  _Requested_access_mode) const
inline
2067  {
2068  return ((_Get_allowed_host_access_mode() & _Requested_access_mode) == _Requested_access_mode);
2069  }
_Access_mode _Get_allowed_host_access_mode() const
Definition: amprt.h:2056
_AMPIMP bool Concurrency::details::_Buffer::_Is_mappable ( ) const
bool Concurrency::details::_Buffer::_Is_staging ( ) const
inline
2052  {
2053  return _M_is_staging;
2054  }
bool _M_is_staging
Definition: amprt.h:2138
bool Concurrency::details::_Buffer::_Is_temp ( ) const
inline
2077  {
2078  return _M_is_temp;
2079  }
bool _M_is_temp
Definition: amprt.h:2141
_AMPIMP void Concurrency::details::_Buffer::_Map_buffer ( _Access_mode  _Map_type,
bool  _Wait 
)
_AMPIMP _Event Concurrency::details::_Buffer::_Map_buffer_async ( _Access_mode  _Map_type)
bool Concurrency::details::_Buffer::_Owns_data ( ) const
inline
2045  {
2046  return _M_owns_data;
2047  }
bool _M_owns_data
Definition: amprt.h:2137
_AMPIMP void Concurrency::details::_Buffer::_Register_view ( _In_ _View_key  _Key)
void Concurrency::details::_Buffer::_Set_data_ptr ( _In_ IUnknown *  _Data_ptr)
inlineprotected
2124  {
2125  _M_data_ptr = _Data_ptr;
2126  }
void * _M_data_ptr
Definition: amprt.h:2131
void Concurrency::details::_Buffer::_Set_host_ptr ( _In_ void _Host_ptr,
_Access_mode  _Host_access_mode = _No_access 
)
inlineprotected
2111  {
2112  _ASSERTE((_Host_ptr == NULL) || (_Host_access_mode != _No_access));
2113 
2114  _M_host_ptr = _Host_ptr;
2115  if (_Host_ptr == NULL) {
2117  }
2118  else {
2119  _M_current_host_access_mode = _Host_access_mode;
2120  }
2121  }
#define NULL
Definition: vcruntime.h:236
_Access_mode _M_current_host_access_mode
Definition: amprt.h:2134
Definition: amprt.h:90
void * _M_host_ptr
Definition: amprt.h:2132
_AMPIMP void Concurrency::details::_Buffer::_Unmap_buffer ( )
_AMPIMP void Concurrency::details::_Buffer::_Unregister_view ( _In_ _View_key  _Key)
_Buffer& Concurrency::details::_Buffer::operator= ( const _Buffer rhs)
protected

Friends And Related Function Documentation

friend class _CPU_accelerator_view_impl
friend
friend class _D3D_accelerator_view_impl
friend
friend class _D3D_temp_staging_cache
friend

Member Data Documentation

_Accelerator_view_impl_ptr Concurrency::details::_Buffer::_M_accelerator_view
protected
_Accelerator_view_impl_ptr Concurrency::details::_Buffer::_M_access_on_accelerator_view
protected
_Access_mode Concurrency::details::_Buffer::_M_allowed_host_access_mode
protected
Concurrency::critical_section Concurrency::details::_Buffer::_M_critical_section
private
_Access_mode Concurrency::details::_Buffer::_M_current_host_access_mode
protected
void* Concurrency::details::_Buffer::_M_data_ptr
protected
size_t Concurrency::details::_Buffer::_M_elem_size
protected
void* Concurrency::details::_Buffer::_M_host_ptr
protected
bool Concurrency::details::_Buffer::_M_is_adopted
protected
bool Concurrency::details::_Buffer::_M_is_buffer
protected
bool Concurrency::details::_Buffer::_M_is_staging
protected
bool Concurrency::details::_Buffer::_M_is_temp
protected
size_t Concurrency::details::_Buffer::_M_num_elems
protected
bool Concurrency::details::_Buffer::_M_owns_data
protected
std::unique_ptr<std::unordered_set<_View_key> > Concurrency::details::_Buffer::_M_view_keys
private

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