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

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

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

Public Types

template<typename T >
using EnableIfNotConstIterator = enable_if_t<!iterator_to_const_type_t< T >::value, T >
 
template<typename T >
using EnableIfConstIterator = enable_if_t< iterator_to_const_type_t< T >::value, T >
 
- Public Types inherited from cl::sycl::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)
 
template<typename T >
 buffer_impl (const std::shared_ptr< T > &HostData, const size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
template<class InputIterator >
 buffer_impl (EnableIfNotConstIterator< InputIterator > First, InputIterator Last, const size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
template<class InputIterator >
 buffer_impl (EnableIfConstIterator< InputIterator > First, InputIterator Last, const size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< SYCLMemObjAllocator > Allocator)
 
 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, RT::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 constructorNotification (const detail::code_location &CodeLoc, void *UserObj)
 
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 cl::sycl::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 (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
 

Additional Inherited Members

- Static Public Member Functions inherited from cl::sycl::detail::SYCLMemObjT
static size_t getBufSizeForContext (const ContextImplPtr &Context, cl_mem MemObject)
 
static size_t getBufSizeForContext (const ContextImplPtr &Context, pi_native_handle MemObject)
 
- Protected Member Functions inherited from cl::sycl::detail::SYCLMemObjT
void updateHostMemory (void *const Ptr)
 
void updateHostMemory ()
 
void determineHostPtr (const ContextImplPtr &Context, bool InitFromUserData, void *&HostPtr, bool &HostPtrReadOnly)
 
- Protected Attributes inherited from cl::sycl::detail::SYCLMemObjT
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
 

Detailed Description

Definition at line 43 of file buffer_impl.hpp.

Member Typedef Documentation

◆ EnableIfConstIterator

Definition at line 123 of file buffer_impl.hpp.

◆ EnableIfNotConstIterator

Definition at line 103 of file buffer_impl.hpp.

Constructor & Destructor Documentation

◆ buffer_impl() [1/10]

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

◆ buffer_impl() [2/10]

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

◆ buffer_impl() [3/10]

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

◆ buffer_impl() [4/10]

template<typename T >
cl::sycl::detail::buffer_impl::buffer_impl ( const std::shared_ptr< T > &  HostData,
const size_t  SizeInBytes,
size_t  RequiredAlign,
const property_list Props,
std::unique_ptr< SYCLMemObjAllocator Allocator 
)
inline

◆ buffer_impl() [5/10]

template<class InputIterator >
cl::sycl::detail::buffer_impl::buffer_impl ( EnableIfNotConstIterator< InputIterator >  First,
InputIterator  Last,
const size_t  SizeInBytes,
size_t  RequiredAlign,
const property_list Props,
std::unique_ptr< SYCLMemObjAllocator Allocator 
)
inline

◆ buffer_impl() [6/10]

template<class InputIterator >
cl::sycl::detail::buffer_impl::buffer_impl ( EnableIfConstIterator< InputIterator >  First,
InputIterator  Last,
const size_t  SizeInBytes,
size_t  RequiredAlign,
const property_list Props,
std::unique_ptr< SYCLMemObjAllocator Allocator 
)
inline

◆ buffer_impl() [7/10]

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

Definition at line 141 of file buffer_impl.hpp.

◆ buffer_impl() [8/10]

cl::sycl::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 148 of file buffer_impl.hpp.

◆ buffer_impl() [9/10]

cl::sycl::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 155 of file buffer_impl.hpp.

◆ buffer_impl() [10/10]

cl::sycl::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 163 of file buffer_impl.hpp.

◆ ~buffer_impl()

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

Definition at line 183 of file buffer_impl.hpp.

Member Function Documentation

◆ addInteropObject()

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

◆ allocateMem()

void * cl::sycl::detail::buffer_impl::allocateMem ( ContextImplPtr  Context,
bool  InitFromUserData,
void *  HostPtr,
RT::PiEvent OutEventToWait 
)
overridevirtual

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

Definition at line 22 of file buffer_impl.cpp.

◆ constructorNotification() [1/2]

void cl::sycl::detail::buffer_impl::constructorNotification ( const detail::code_location CodeLoc,
void *  UserObj 
)

Definition at line 42 of file buffer_impl.cpp.

References cl::sycl::detail::constructorNotification(), and cl::sycl::r.

◆ constructorNotification() [2/2]

void cl::sycl::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] 
)

Definition at line 34 of file buffer_impl.cpp.

◆ destructorNotification()

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

Definition at line 48 of file buffer_impl.cpp.

◆ getNativeVector()

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

Definition at line 67 of file buffer_impl.cpp.

References piextMemGetNativeHandle(), and piMemRetain().

◆ getType()

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

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

Definition at line 181 of file buffer_impl.hpp.

◆ resize()

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

Definition at line 191 of file buffer_impl.hpp.

Referenced by cl::sycl::detail::AccessorImplHost::resize().


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