DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::detail::buffer_impl Class Referencefinal

#include <detail/buffer_impl.hpp>

Inheritance diagram for sycl::_V1::detail::buffer_impl:
Collaboration diagram for sycl::_V1::detail::buffer_impl:

Public Types

template<typename T >
using EnableIfNotConstIterator = std::enable_if_t<!iterator_to_const_type_t< T >::value, T >
 
- Public Types inherited from sycl::_V1::detail::SYCLMemObjI
enum  MemObjType { Buffer = 0 , Image = 1 , Undefined = 2 }
 

Public Member Functions

 buffer_impl (size_t SizeInBytes, size_t, const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 buffer_impl (void *HostData, size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 buffer_impl (const void *HostData, size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 buffer_impl (const std::shared_ptr< const void > &HostData, const size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator, bool IsConstPtr)
 
 buffer_impl (const std::function< void(void *)> &CopyFromInput, const size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator, bool IsConstPtr)
 
 buffer_impl (cl_mem MemObject, const context &SyclContext, std::unique_ptr< SYCLMemObjAllocator > Allocator, event AvailableEvent)
 
 buffer_impl (pi_native_handle MemObject, const context &SyclContext, std::unique_ptr< SYCLMemObjAllocator > Allocator, bool OwnNativeHandle, event AvailableEvent)
 
 buffer_impl (cl_mem MemObject, const context &SyclContext, const size_t SizeInBytes, std::unique_ptr< SYCLMemObjAllocator > Allocator, event AvailableEvent)
 
 buffer_impl (pi_native_handle MemObject, const context &SyclContext, const size_t SizeInBytes, std::unique_ptr< SYCLMemObjAllocator > Allocator, event AvailableEvent)
 
void * allocateMem (ContextImplPtr Context, bool InitFromUserData, void *HostPtr, sycl::detail::pi::PiEvent &OutEventToWait) override
 
void constructorNotification (const detail::code_location &CodeLoc, void *UserObj, const void *HostObj, const void *Type, uint32_t Dim, uint32_t ElemType, size_t Range[3])
 
void destructorNotification (void *UserObj)
 
MemObjType getType () const override
 
 ~buffer_impl ()
 
void resize (size_t size)
 
void addInteropObject (std::vector< pi_native_handle > &Handles) const
 
std::vector< pi_native_handlegetNativeVector (backend BackendName) const
 
- Public Member Functions inherited from sycl::_V1::detail::SYCLMemObjT
 SYCLMemObjT (const size_t SizeInBytes, const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 SYCLMemObjT (const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 SYCLMemObjT (pi_native_handle MemObject, const context &SyclContext, const size_t SizeInBytes, event AvailableEvent, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 SYCLMemObjT (cl_mem MemObject, const context &SyclContext, event AvailableEvent, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 SYCLMemObjT (pi_native_handle MemObject, const context &SyclContext, bool OwnNativeHandle, event AvailableEvent, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 SYCLMemObjT (pi_native_handle MemObject, const context &SyclContext, bool OwnNativeHandle, event AvailableEvent, std::unique_ptr< SYCLMemObjAllocator > Allocator, sycl::detail::pi::PiMemImageChannelOrder Order, sycl::detail::pi::PiMemImageChannelType Type, range< 3 > Range3WithOnes, unsigned Dimensions, size_t ElementSize)
 
virtual ~SYCLMemObjT ()=default
 
const PluginPtrgetPlugin () const
 
size_t getSizeInBytes () const noexcept override
 
 __SYCL2020_DEPRECATED ("get_count() is deprecated, please use size() instead") size_t get_count() const
 
size_t size () const noexcept
 
template<typename propertyT >
bool has_property () const noexcept
 
template<typename propertyT >
propertyT get_property () const
 
void addOrReplaceAccessorProperties (const property_list &PropertyList)
 
void deleteAccessorProperty (const PropWithDataKind &Kind)
 
const std::unique_ptr< SYCLMemObjAllocator > & get_allocator_internal () const
 
void * allocateHostMem () override
 
void releaseHostMem (void *Ptr) override
 
void releaseMem (ContextImplPtr Context, void *MemAllocation) override
 
void * getUserPtr () const
 
void set_write_back (bool NeedWriteBack)
 
void set_final_data (std::nullptr_t)
 
void set_final_data_from_storage ()
 
void set_final_data (const std::function< void(const std::function< void(void *const Ptr)> &)> &FinalDataFunc)
 
bool useHostPtr ()
 
bool canReadHostPtr (void *HostPtr, const size_t RequiredAlign)
 
bool canReuseHostPtr (void *HostPtr, const size_t RequiredAlign)
 
void handleHostData (void *HostPtr, const size_t RequiredAlign)
 
void handleHostData (const void *HostPtr, const size_t RequiredAlign)
 
void handleHostData (const std::shared_ptr< void > &HostPtr, const size_t RequiredAlign, bool IsConstPtr)
 
void handleHostData (const std::function< void(void *)> &CopyFromInput, const size_t RequiredAlign, bool IsConstPtr)
 
void setAlign (size_t RequiredAlign)
 
void handleWriteAccessorCreation ()
 
void * allocateMem (ContextImplPtr Context, bool InitFromUserData, void *HostPtr, sycl::detail::pi::PiEvent &InteropEvent) override
 
MemObjType getType () const override
 
ContextImplPtr getInteropContext () const override
 
bool isInterop () const override
 
bool hasUserDataPtr () const override
 
bool isHostPointerReadOnly () const override
 
bool usesPinnedHostMemory () const override
 
void detachMemoryObject (const std::shared_ptr< SYCLMemObjT > &Self) const
 
void markAsInternal ()
 
bool needsWriteBack () const
 Returns true if this memory object requires a write_back on destruction. More...
 
void markBeingUsedInGraph ()
 Increment an internal counter for how many graphs are currently using this memory object. More...
 
void markNoLongerBeingUsedInGraph ()
 Decrement an internal counter for how many graphs are currently using this memory object. More...
 
bool isUsedInGraph () const
 Returns true if any graphs are currently using this memory object. More...
 
- Public Member Functions inherited from sycl::_V1::detail::SYCLMemObjI
virtual ~SYCLMemObjI ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from sycl::_V1::detail::SYCLMemObjT
static size_t getBufSizeForContext (const ContextImplPtr &Context, pi_native_handle MemObject)
 
- Protected Member Functions inherited from sycl::_V1::detail::SYCLMemObjT
void updateHostMemory (void *const Ptr)
 
void updateHostMemory ()
 
void determineHostPtr (const ContextImplPtr &Context, bool InitFromUserData, void *&HostPtr, bool &HostPtrReadOnly)
 
- Protected Attributes inherited from sycl::_V1::detail::SYCLMemObjT
std::unique_ptr< SYCLMemObjAllocatorMAllocator
 
property_list MProps
 
EventImplPtr MInteropEvent
 
ContextImplPtr MInteropContext
 
sycl::detail::pi::PiMem MInteropMemObject
 
bool MOpenCLInterop
 
bool MHostPtrReadOnly
 
bool MNeedWriteBack
 
size_t MSizeInBytes
 
void * MUserPtr
 
void * MShadowCopy
 
std::function< void(void)> MUploadDataFunctor
 
std::shared_ptr< const void > MSharedPtrStorage
 
bool MHostPtrProvided
 
bool MIsInternal = false
 
std::atomic< size_t > MGraphUseCount = 0
 
std::function< void(void)> MCreateShadowCopy = []() -> void {}
 
bool MOwnNativeHandle = true
 
- Protected Attributes inherited from sycl::_V1::detail::SYCLMemObjI
std::shared_ptr< MemObjRecordMRecord
 

Detailed Description

Definition at line 41 of file buffer_impl.hpp.

Member Typedef Documentation

◆ EnableIfNotConstIterator

template<typename T >
using sycl::_V1::detail::buffer_impl::EnableIfNotConstIterator = std::enable_if_t<!iterator_to_const_type_t<T>::value, T>

Definition at line 116 of file buffer_impl.hpp.

Constructor & Destructor Documentation

◆ buffer_impl() [1/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( size_t  SizeInBytes,
size_t  ,
const property_list Props,
std::unique_ptr< SYCLMemObjAllocator Allocator 
)
inline

Definition at line 46 of file buffer_impl.hpp.

References sycl::_V1::property_list::has_property().

◆ buffer_impl() [2/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( void *  HostData,
size_t  SizeInBytes,
size_t  RequiredAlign,
const property_list Props,
std::unique_ptr< SYCLMemObjAllocator Allocator 
)
inline

Definition at line 56 of file buffer_impl.hpp.

References sycl::_V1::property_list::has_property().

◆ buffer_impl() [3/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( const void *  HostData,
size_t  SizeInBytes,
size_t  RequiredAlign,
const property_list Props,
std::unique_ptr< SYCLMemObjAllocator Allocator 
)
inline

Definition at line 70 of file buffer_impl.hpp.

References sycl::_V1::property_list::has_property().

◆ buffer_impl() [4/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( const std::shared_ptr< const void > &  HostData,
const size_t  SizeInBytes,
size_t  RequiredAlign,
const property_list Props,
std::unique_ptr< SYCLMemObjAllocator Allocator,
bool  IsConstPtr 
)
inline

Definition at line 84 of file buffer_impl.hpp.

References sycl::_V1::property_list::has_property().

◆ buffer_impl() [5/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( const std::function< void(void *)> &  CopyFromInput,
const size_t  SizeInBytes,
size_t  RequiredAlign,
const property_list Props,
std::unique_ptr< detail::SYCLMemObjAllocator Allocator,
bool  IsConstPtr 
)
inline

Definition at line 100 of file buffer_impl.hpp.

References sycl::_V1::property_list::has_property().

◆ buffer_impl() [6/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( cl_mem  MemObject,
const context SyclContext,
std::unique_ptr< SYCLMemObjAllocator Allocator,
event  AvailableEvent 
)
inline

Definition at line 119 of file buffer_impl.hpp.

◆ buffer_impl() [7/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( pi_native_handle  MemObject,
const context SyclContext,
std::unique_ptr< SYCLMemObjAllocator Allocator,
bool  OwnNativeHandle,
event  AvailableEvent 
)
inline

Definition at line 126 of file buffer_impl.hpp.

◆ buffer_impl() [8/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( cl_mem  MemObject,
const context SyclContext,
const size_t  SizeInBytes,
std::unique_ptr< SYCLMemObjAllocator Allocator,
event  AvailableEvent 
)
inline

Definition at line 133 of file buffer_impl.hpp.

◆ buffer_impl() [9/9]

sycl::_V1::detail::buffer_impl::buffer_impl ( pi_native_handle  MemObject,
const context SyclContext,
const size_t  SizeInBytes,
std::unique_ptr< SYCLMemObjAllocator Allocator,
event  AvailableEvent 
)
inline

Definition at line 141 of file buffer_impl.hpp.

◆ ~buffer_impl()

sycl::_V1::detail::buffer_impl::~buffer_impl ( )
inline

Definition at line 159 of file buffer_impl.hpp.

Member Function Documentation

◆ addInteropObject()

void sycl::_V1::detail::buffer_impl::addInteropObject ( std::vector< pi_native_handle > &  Handles) const

◆ allocateMem()

◆ constructorNotification()

void sycl::_V1::detail::buffer_impl::constructorNotification ( const detail::code_location CodeLoc,
void *  UserObj,
const void *  HostObj,
const void *  Type,
uint32_t  Dim,
uint32_t  ElemType,
size_t  Range[3] 
)

◆ destructorNotification()

void sycl::_V1::detail::buffer_impl::destructorNotification ( void *  UserObj)

◆ getNativeVector()

std::vector< pi_native_handle > sycl::_V1::detail::buffer_impl::getNativeVector ( backend  BackendName) const

◆ getType()

MemObjType sycl::_V1::detail::buffer_impl::getType ( ) const
inlineoverridevirtual

Implements sycl::_V1::detail::SYCLMemObjI.

Definition at line 157 of file buffer_impl.hpp.

◆ resize()

void sycl::_V1::detail::buffer_impl::resize ( size_t  size)
inline

Definition at line 167 of file buffer_impl.hpp.


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