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 ()
 
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
2111  {
2112  return _M_accelerator_view;
2113  }
_Accelerator_view_impl_ptr _M_accelerator_view
Definition: amprt.h:2205
_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
2116  {
2118  }
_Accelerator_view_impl_ptr _M_access_on_accelerator_view
Definition: amprt.h:2206
_Access_mode Concurrency::details::_Buffer::_Get_allowed_host_access_mode ( ) const
inline
2133  {
2135  }
_Access_mode _M_allowed_host_access_mode
Definition: amprt.h:2209
access_type Concurrency::details::_Buffer::_Get_allowed_host_access_type ( ) const
inline
2138  {
2140  }
access_type _Get_cpu_access_type(_Access_mode _Cpu_access_mode)
Definition: amprt.h:2021
_Access_mode _M_allowed_host_access_mode
Definition: amprt.h:2209
_Access_mode Concurrency::details::_Buffer::_Get_current_host_access_mode ( ) const
inline
2148  {
2150  }
_Access_mode _M_current_host_access_mode
Definition: amprt.h:2210
_Ret_ void* Concurrency::details::_Buffer::_Get_data_ptr ( ) const
inline
2089  {
2090  return _M_data_ptr;
2091  }
void * _M_data_ptr
Definition: amprt.h:2207
size_t Concurrency::details::_Buffer::_Get_elem_size ( ) const
inline
2101  {
2102  return _M_elem_size;
2103  }
size_t _M_elem_size
Definition: amprt.h:2211
_Ret_ void* Concurrency::details::_Buffer::_Get_host_ptr ( ) const
inline
2096  {
2097  return _M_host_ptr;
2098  }
void * _M_host_ptr
Definition: amprt.h:2208
size_t Concurrency::details::_Buffer::_Get_num_elems ( ) const
inline
2106  {
2107  return _M_num_elems;
2108  }
size_t _M_num_elems
Definition: amprt.h:2212
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
2158  {
2159  // Is it adopted from interop?
2160  return _M_is_adopted;
2161  }
bool _M_is_adopted
Definition: amprt.h:2219
bool Concurrency::details::_Buffer::_Is_buffer ( ) const
inline
2164  {
2165  return _M_is_buffer;
2166  }
bool _M_is_buffer
Definition: amprt.h:2220
bool Concurrency::details::_Buffer::_Is_host_accessible ( _Access_mode  _Requested_access_mode) const
inline
2143  {
2144  return ((_Get_allowed_host_access_mode() & _Requested_access_mode) == _Requested_access_mode);
2145  }
_Access_mode _Get_allowed_host_access_mode() const
Definition: amprt.h:2132
_AMPIMP bool Concurrency::details::_Buffer::_Is_mappable ( ) const
bool Concurrency::details::_Buffer::_Is_staging ( ) const
inline
2128  {
2129  return _M_is_staging;
2130  }
bool _M_is_staging
Definition: amprt.h:2214
bool Concurrency::details::_Buffer::_Is_temp ( ) const
inline
2153  {
2154  return _M_is_temp;
2155  }
bool _M_is_temp
Definition: amprt.h:2217
_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
2121  {
2122  return _M_owns_data;
2123  }
bool _M_owns_data
Definition: amprt.h:2213
_AMPIMP void Concurrency::details::_Buffer::_Register_view ( _In_ _View_key  _Key)
void Concurrency::details::_Buffer::_Set_data_ptr ( _In_ IUnknown *  _Data_ptr)
inlineprotected
2200  {
2201  _M_data_ptr = _Data_ptr;
2202  }
void * _M_data_ptr
Definition: amprt.h:2207
void Concurrency::details::_Buffer::_Set_host_ptr ( _In_ void _Host_ptr,
_Access_mode  _Host_access_mode = _No_access 
)
inlineprotected
2187  {
2188  _ASSERTE((_Host_ptr == NULL) || (_Host_access_mode != _No_access));
2189 
2190  _M_host_ptr = _Host_ptr;
2191  if (_Host_ptr == NULL) {
2193  }
2194  else {
2195  _M_current_host_access_mode = _Host_access_mode;
2196  }
2197  }
#define NULL
Definition: crtdbg.h:30
#define _ASSERTE(expr)
Definition: crtdbg.h:216
_Access_mode _M_current_host_access_mode
Definition: amprt.h:2210
Definition: amprt.h:84
void * _M_host_ptr
Definition: amprt.h:2208
_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: