DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::sycl::detail::SYCLMemObjT Class Reference

#include <CL/sycl/detail/sycl_mem_obj_t.hpp>

Inheritance diagram for cl::sycl::detail::SYCLMemObjT:
Collaboration diagram for cl::sycl::detail::SYCLMemObjT:

Public Member Functions

 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 (cl_mem MemObject, const context &SyclContext, const size_t SizeInBytes, event AvailableEvent, 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 OwmNativeHandle, event AvailableEvent, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
virtual ~SYCLMemObjT ()=default
 
const plugingetPlugin () const
 
__SYCL_DLL_LOCAL size_t getSize () const override
 
 __SYCL2020_DEPRECATED ("get_count() is deprecated, please use size() instead") __SYCL_DLL_LOCAL size_t get_count() const
 
__SYCL_DLL_LOCAL size_t size () const noexcept
 
template<typename propertyT >
__SYCL_DLL_LOCAL bool has_property () const
 
template<typename propertyT >
__SYCL_DLL_LOCAL propertyT get_property () const
 
__SYCL_DLL_LOCAL void addOrReplaceAccessorProperties (const property_list &PropertyList)
 
__SYCL_DLL_LOCAL void deleteAccessorProperty (const PropWithDataKind &Kind)
 
template<typename AllocatorT >
__SYCL_DLL_LOCAL AllocatorT get_allocator () const
 
__SYCL_DLL_LOCAL void * allocateHostMem () override
 
__SYCL_DLL_LOCAL void releaseHostMem (void *Ptr) override
 
void releaseMem (ContextImplPtr Context, void *MemAllocation) override
 
__SYCL_DLL_LOCAL void * getUserPtr () const
 
__SYCL_DLL_LOCAL void set_write_back (bool NeedWriteBack)
 
__SYCL_DLL_LOCAL void set_final_data (std::nullptr_t)
 
template<template< typename T > class PtrT, typename T >
__SYCL_DLL_LOCAL enable_if_t< std::is_convertible< PtrT< T >, std::weak_ptr< T > >::value > set_final_data (PtrT< T > FinalData)
 
template<typename T >
__SYCL_DLL_LOCAL void set_final_data (std::weak_ptr< T > FinalData)
 
__SYCL_DLL_LOCAL void set_final_data_from_storage ()
 
template<typename Destination >
__SYCL_DLL_LOCAL EnableIfOutputPointerT< Destination > set_final_data (Destination FinalData)
 
template<typename Destination >
__SYCL_DLL_LOCAL EnableIfOutputIteratorT< Destination > set_final_data (Destination FinalData)
 
__SYCL_DLL_LOCAL bool useHostPtr ()
 
__SYCL_DLL_LOCAL bool canReuseHostPtr (void *HostPtr, const size_t RequiredAlign)
 
__SYCL_DLL_LOCAL void handleHostData (void *HostPtr, const size_t RequiredAlign)
 
__SYCL_DLL_LOCAL void handleHostData (const void *HostPtr, const size_t RequiredAlign)
 
template<typename T >
__SYCL_DLL_LOCAL void handleHostData (const std::shared_ptr< T > &HostPtr, const size_t RequiredAlign)
 
template<class InputIterator >
__SYCL_DLL_LOCAL void handleHostData (InputIterator First, InputIterator Last, const size_t RequiredAlign)
 
__SYCL_DLL_LOCAL void setAlign (size_t RequiredAlign)
 
__SYCL_DLL_LOCAL void * allocateMem (ContextImplPtr Context, bool InitFromUserData, void *HostPtr, RT::PiEvent &InteropEvent) override
 
__SYCL_DLL_LOCAL MemObjType getType () const override
 
ContextImplPtr getInteropContext () const override
 
bool hasUserDataPtr () const
 
bool isInterop () const
 
- Public Member Functions inherited from cl::sycl::detail::SYCLMemObjI
virtual ~SYCLMemObjI ()=default
 

Static Public Member Functions

static size_t getBufSizeForContext (const ContextImplPtr &Context, cl_mem MemObject)
 
static size_t getBufSizeForContext (const ContextImplPtr &Context, pi_native_handle MemObject)
 

Protected Member Functions

void updateHostMemory (void *const Ptr)
 
void updateHostMemory ()
 
void determineHostPtr (const ContextImplPtr &Context, bool InitFromUserData, void *&HostPtr, bool &HostPtrReadOnly)
 

Protected Attributes

std::unique_ptr< SYCLMemObjAllocatorMAllocator
 
property_list MProps
 
EventImplPtr MInteropEvent
 
ContextImplPtr MInteropContext
 
RT::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
 
- Protected Attributes inherited from cl::sycl::detail::SYCLMemObjI
std::shared_ptr< MemObjRecordMRecord
 

Additional Inherited Members

- Public Types inherited from cl::sycl::detail::SYCLMemObjI
enum  MemObjType { Buffer = 0, Image = 1, Undefined = 2 }
 

Detailed Description

Definition at line 43 of file sycl_mem_obj_t.hpp.

Constructor & Destructor Documentation

◆ SYCLMemObjT() [1/6]

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

Definition at line 66 of file sycl_mem_obj_t.hpp.

◆ SYCLMemObjT() [2/6]

cl::sycl::detail::SYCLMemObjT::SYCLMemObjT ( const property_list Props,
std::unique_ptr< SYCLMemObjAllocator Allocator 
)
inline

Definition at line 74 of file sycl_mem_obj_t.hpp.

◆ SYCLMemObjT() [3/6]

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

Definition at line 19 of file sycl_mem_obj_t.cpp.

◆ SYCLMemObjT() [4/6]

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

Definition at line 25 of file sycl_mem_obj_t.cpp.

◆ SYCLMemObjT() [5/6]

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

Definition at line 87 of file sycl_mem_obj_t.hpp.

◆ SYCLMemObjT() [6/6]

cl::sycl::detail::SYCLMemObjT::SYCLMemObjT ( pi_native_handle  MemObject,
const context SyclContext,
bool  OwmNativeHandle,
event  AvailableEvent,
std::unique_ptr< SYCLMemObjAllocator Allocator 
)

◆ ~SYCLMemObjT()

virtual cl::sycl::detail::SYCLMemObjT::~SYCLMemObjT ( )
virtualdefault

Member Function Documentation

◆ __SYCL2020_DEPRECATED()

cl::sycl::detail::SYCLMemObjT::__SYCL2020_DEPRECATED ( "get_count() is  deprecated,
please use size() instead  
) const
inline

Definition at line 102 of file sycl_mem_obj_t.hpp.

◆ addOrReplaceAccessorProperties()

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::addOrReplaceAccessorProperties ( const property_list PropertyList)
inline

Definition at line 119 of file sycl_mem_obj_t.hpp.

◆ allocateHostMem()

__SYCL_DLL_LOCAL void* cl::sycl::detail::SYCLMemObjT::allocateHostMem ( )
inlineoverridevirtual

Implements cl::sycl::detail::SYCLMemObjI.

Definition at line 132 of file sycl_mem_obj_t.hpp.

◆ allocateMem()

__SYCL_DLL_LOCAL void* cl::sycl::detail::SYCLMemObjT::allocateMem ( ContextImplPtr  Context,
bool  InitFromUserData,
void *  HostPtr,
RT::PiEvent InteropEvent 
)
inlineoverridevirtual

Implements cl::sycl::detail::SYCLMemObjI.

Definition at line 309 of file sycl_mem_obj_t.hpp.

References PI_INVALID_OPERATION.

◆ canReuseHostPtr()

__SYCL_DLL_LOCAL bool cl::sycl::detail::SYCLMemObjT::canReuseHostPtr ( void *  HostPtr,
const size_t  RequiredAlign 
)
inline

Definition at line 225 of file sycl_mem_obj_t.hpp.

◆ deleteAccessorProperty()

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::deleteAccessorProperty ( const PropWithDataKind Kind)
inline

Definition at line 123 of file sycl_mem_obj_t.hpp.

◆ determineHostPtr()

void cl::sycl::detail::SYCLMemObjT::determineHostPtr ( const ContextImplPtr Context,
bool  InitFromUserData,
void *&  HostPtr,
bool &  HostPtrReadOnly 
)
protected

Definition at line 131 of file sycl_mem_obj_t.cpp.

References getUserPtr(), MHostPtrReadOnly, and MOpenCLInterop.

◆ get_allocator()

template<typename AllocatorT >
__SYCL_DLL_LOCAL AllocatorT cl::sycl::detail::SYCLMemObjT::get_allocator ( ) const
inline

Definition at line 128 of file sycl_mem_obj_t.hpp.

◆ get_property()

template<typename propertyT >
__SYCL_DLL_LOCAL propertyT cl::sycl::detail::SYCLMemObjT::get_property ( ) const
inline

Definition at line 114 of file sycl_mem_obj_t.hpp.

◆ getBufSizeForContext() [1/2]

size_t cl::sycl::detail::SYCLMemObjT::getBufSizeForContext ( const ContextImplPtr Context,
cl_mem  MemObject 
)
static

Definition at line 114 of file sycl_mem_obj_t.cpp.

◆ getBufSizeForContext() [2/2]

size_t cl::sycl::detail::SYCLMemObjT::getBufSizeForContext ( const ContextImplPtr Context,
pi_native_handle  MemObject 
)
static

Definition at line 118 of file sycl_mem_obj_t.cpp.

References cl::sycl::detail::plugin::call(), PI_MEM_SIZE, and piMemGetInfo().

◆ getInteropContext()

ContextImplPtr cl::sycl::detail::SYCLMemObjT::getInteropContext ( ) const
inlineoverridevirtual

Implements cl::sycl::detail::SYCLMemObjI.

Definition at line 323 of file sycl_mem_obj_t.hpp.

◆ getPlugin()

const plugin & cl::sycl::detail::SYCLMemObjT::getPlugin ( ) const

Definition at line 108 of file sycl_mem_obj_t.cpp.

References MInteropContext.

Referenced by SYCLMemObjT(), and updateHostMemory().

◆ getSize()

__SYCL_DLL_LOCAL size_t cl::sycl::detail::SYCLMemObjT::getSize ( ) const
inlineoverridevirtual

Implements cl::sycl::detail::SYCLMemObjI.

Definition at line 101 of file sycl_mem_obj_t.hpp.

◆ getType()

__SYCL_DLL_LOCAL MemObjType cl::sycl::detail::SYCLMemObjT::getType ( ) const
inlineoverridevirtual

Implements cl::sycl::detail::SYCLMemObjI.

Definition at line 319 of file sycl_mem_obj_t.hpp.

◆ getUserPtr()

__SYCL_DLL_LOCAL void* cl::sycl::detail::SYCLMemObjT::getUserPtr ( ) const
inline

Definition at line 143 of file sycl_mem_obj_t.hpp.

Referenced by determineHostPtr(), and releaseMem().

◆ handleHostData() [1/4]

template<typename T >
__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::handleHostData ( const std::shared_ptr< T > &  HostPtr,
const size_t  RequiredAlign 
)
inline

Definition at line 254 of file sycl_mem_obj_t.hpp.

References cl::sycl::detail::memcpy().

◆ handleHostData() [2/4]

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::handleHostData ( const void *  HostPtr,
const size_t  RequiredAlign 
)
inline

Definition at line 247 of file sycl_mem_obj_t.hpp.

◆ handleHostData() [3/4]

template<class InputIterator >
__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::handleHostData ( InputIterator  First,
InputIterator  Last,
const size_t  RequiredAlign 
)
inline

Definition at line 274 of file sycl_mem_obj_t.hpp.

References PI_INVALID_OPERATION.

◆ handleHostData() [4/4]

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::handleHostData ( void *  HostPtr,
const size_t  RequiredAlign 
)
inline

Definition at line 232 of file sycl_mem_obj_t.hpp.

References cl::sycl::detail::memcpy().

◆ has_property()

template<typename propertyT >
__SYCL_DLL_LOCAL bool cl::sycl::detail::SYCLMemObjT::has_property ( ) const
inline

Definition at line 109 of file sycl_mem_obj_t.hpp.

◆ hasUserDataPtr()

bool cl::sycl::detail::SYCLMemObjT::hasUserDataPtr ( ) const
inline

Definition at line 325 of file sycl_mem_obj_t.hpp.

◆ isInterop()

bool cl::sycl::detail::SYCLMemObjT::isInterop ( ) const

Definition at line 129 of file sycl_mem_obj_t.cpp.

References MOpenCLInterop.

◆ releaseHostMem()

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::releaseHostMem ( void *  Ptr)
inlineoverridevirtual

Implements cl::sycl::detail::SYCLMemObjI.

Definition at line 136 of file sycl_mem_obj_t.hpp.

Referenced by updateHostMemory().

◆ releaseMem()

void cl::sycl::detail::SYCLMemObjT::releaseMem ( ContextImplPtr  Context,
void *  MemAllocation 
)
overridevirtual

◆ set_final_data() [1/5]

template<typename Destination >
__SYCL_DLL_LOCAL EnableIfOutputPointerT<Destination> cl::sycl::detail::SYCLMemObjT::set_final_data ( Destination  FinalData)
inline

Definition at line 183 of file sycl_mem_obj_t.hpp.

◆ set_final_data() [2/5]

template<typename Destination >
__SYCL_DLL_LOCAL EnableIfOutputIteratorT<Destination> cl::sycl::detail::SYCLMemObjT::set_final_data ( Destination  FinalData)
inline

Definition at line 194 of file sycl_mem_obj_t.hpp.

◆ set_final_data() [3/5]

template<template< typename T > class PtrT, typename T >
__SYCL_DLL_LOCAL enable_if_t<std::is_convertible<PtrT<T>, std::weak_ptr<T> >::value> cl::sycl::detail::SYCLMemObjT::set_final_data ( PtrT< T FinalData)
inline

Definition at line 158 of file sycl_mem_obj_t.hpp.

◆ set_final_data() [4/5]

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::set_final_data ( std::nullptr_t  )
inline

Definition at line 151 of file sycl_mem_obj_t.hpp.

◆ set_final_data() [5/5]

template<typename T >
__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::set_final_data ( std::weak_ptr< T FinalData)
inline

Definition at line 164 of file sycl_mem_obj_t.hpp.

◆ set_final_data_from_storage()

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::set_final_data_from_storage ( )
inline

Definition at line 172 of file sycl_mem_obj_t.hpp.

◆ set_write_back()

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::set_write_back ( bool  NeedWriteBack)
inline

Definition at line 147 of file sycl_mem_obj_t.hpp.

◆ setAlign()

__SYCL_DLL_LOCAL void cl::sycl::detail::SYCLMemObjT::setAlign ( size_t  RequiredAlign)
inline

Definition at line 298 of file sycl_mem_obj_t.hpp.

◆ size()

__SYCL_DLL_LOCAL size_t cl::sycl::detail::SYCLMemObjT::size ( ) const
inlinenoexcept

Definition at line 104 of file sycl_mem_obj_t.hpp.

◆ updateHostMemory() [1/2]

◆ updateHostMemory() [2/2]

void cl::sycl::detail::SYCLMemObjT::updateHostMemory ( void *const  Ptr)
protected

◆ useHostPtr()

__SYCL_DLL_LOCAL bool cl::sycl::detail::SYCLMemObjT::useHostPtr ( )
inline

Definition at line 220 of file sycl_mem_obj_t.hpp.

Member Data Documentation

◆ MAllocator

std::unique_ptr<SYCLMemObjAllocator> cl::sycl::detail::SYCLMemObjT::MAllocator
protected

Definition at line 335 of file sycl_mem_obj_t.hpp.

◆ MHostPtrReadOnly

bool cl::sycl::detail::SYCLMemObjT::MHostPtrReadOnly
protected

Definition at line 350 of file sycl_mem_obj_t.hpp.

Referenced by determineHostPtr().

◆ MInteropContext

ContextImplPtr cl::sycl::detail::SYCLMemObjT::MInteropContext
protected

Definition at line 342 of file sycl_mem_obj_t.hpp.

Referenced by getPlugin(), and SYCLMemObjT().

◆ MInteropEvent

EventImplPtr cl::sycl::detail::SYCLMemObjT::MInteropEvent
protected

Definition at line 340 of file sycl_mem_obj_t.hpp.

◆ MInteropMemObject

RT::PiMem cl::sycl::detail::SYCLMemObjT::MInteropMemObject
protected

◆ MNeedWriteBack

bool cl::sycl::detail::SYCLMemObjT::MNeedWriteBack
protected

Definition at line 352 of file sycl_mem_obj_t.hpp.

Referenced by updateHostMemory().

◆ MOpenCLInterop

bool cl::sycl::detail::SYCLMemObjT::MOpenCLInterop
protected

Definition at line 348 of file sycl_mem_obj_t.hpp.

Referenced by determineHostPtr(), isInterop(), and updateHostMemory().

◆ MProps

property_list cl::sycl::detail::SYCLMemObjT::MProps
protected

Definition at line 337 of file sycl_mem_obj_t.hpp.

◆ MShadowCopy

void* cl::sycl::detail::SYCLMemObjT::MShadowCopy
protected

Definition at line 358 of file sycl_mem_obj_t.hpp.

Referenced by updateHostMemory().

◆ MSharedPtrStorage

std::shared_ptr<const void> cl::sycl::detail::SYCLMemObjT::MSharedPtrStorage
protected

Definition at line 363 of file sycl_mem_obj_t.hpp.

◆ MSizeInBytes

size_t cl::sycl::detail::SYCLMemObjT::MSizeInBytes
protected

◆ MUploadDataFunctor

std::function<void(void)> cl::sycl::detail::SYCLMemObjT::MUploadDataFunctor
protected

Definition at line 360 of file sycl_mem_obj_t.hpp.

Referenced by updateHostMemory().

◆ MUserPtr

void* cl::sycl::detail::SYCLMemObjT::MUserPtr
protected

Definition at line 356 of file sycl_mem_obj_t.hpp.


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