DPC++ Runtime
Runtime libraries for oneAPI DPC++
_pi_buffer Struct Referencefinal

#include <esimd_emulator/pi_esimd_emulator.hpp>

Inheritance diagram for _pi_buffer:
Collaboration diagram for _pi_buffer:

Classes

struct  allocation_t
 
struct  Mapping
 

Public Member Functions

 _pi_buffer (pi_context ctxt, char *HostPtr, cm_surface_ptr_t SurfacePtrArg, unsigned int SurfaceIdxArg, size_t SizeArg)
 
 _pi_buffer (pi_context Context, size_t Size, char *HostPtr, bool ImportedHostPtr=false)
 
 _pi_buffer (pi_buffer Parent, size_t Origin, size_t Size)
 
 _pi_buffer (pi_context Context, size_t Size, pi_device Device, char *ZeMemHandle, bool OwnZeMemHandle)
 
virtual pi_result getZeHandle (char *&ZeHandle, access_mode_t, pi_device Device=nullptr) override
 
virtual pi_result getZeHandlePtr (char **&ZeHandlePtr, access_mode_t, pi_device Device=nullptr) override
 
bool isImage () const override
 
bool isSubBuffer () const
 
pi_result free ()
 
size_t getAlignment () const
 
- Public Member Functions inherited from _pi_mem
 _pi_mem (pi_context ctxt, pi_mem parent, mem_::buffer_mem_::alloc_mode mode, CUdeviceptr ptr, void *host_ptr, size_t size)
 Constructs the PI MEM handler for a non-typed allocation ("buffer") More...
 
 _pi_mem (pi_context ctxt, CUarray array, CUsurfObject surf, pi_mem_type image_type, void *host_ptr)
 Constructs the PI allocation for an Image object (surface in CUDA) More...
 
 ~_pi_mem ()
 
bool is_buffer () const noexcept
 
bool is_sub_buffer () const noexcept
 
bool is_image () const noexcept
 
pi_context get_context () const noexcept
 
pi_uint32 increment_reference_count () noexcept
 
pi_uint32 decrement_reference_count () noexcept
 
pi_uint32 get_reference_count () const noexcept
 
 ~_pi_mem ()
 
 _pi_mem (pi_context ctxt, pi_mem parent, mem_::buffer_mem_::alloc_mode mode, hipDeviceptr_t ptr, void *host_ptr, size_t size)
 Constructs the PI MEM handler for a non-typed allocation ("buffer") More...
 
 _pi_mem (pi_context ctxt, hipArray *array, hipSurfaceObject_t surf, pi_mem_type image_type, void *host_ptr)
 Constructs the PI allocation for an Image object. More...
 
 ~_pi_mem ()
 
bool is_buffer () const noexcept
 
bool is_sub_buffer () const noexcept
 
bool is_image () const noexcept
 
pi_context get_context () const noexcept
 
pi_uint32 increment_reference_count () noexcept
 
pi_uint32 decrement_reference_count () noexcept
 
pi_uint32 get_reference_count () const noexcept
 
virtual ~_pi_mem ()=default
 
- Public Member Functions inherited from _pi_object
 _pi_object ()
 
virtual ~_pi_object ()=default
 
 _pi_object ()
 

Public Attributes

size_t Size
 
std::unordered_map< pi_device, allocation_tAllocations
 
pi_device LastDeviceWithValidAllocation {nullptr}
 
bool OnHost {false}
 
char * MapHostPtr {nullptr}
 
std::unordered_map< void *, MappingMappings
 
struct {
   _pi_mem *   Parent
 
   size_t   Origin
 
SubBuffer
 
- Public Attributes inherited from _pi_mem
pi_context context_
 
std::atomic_uint32_t refCount_
 Reference counting of the handler. More...
 
enum _pi_mem::mem_type mem_type_
 
union _pi_mem::mem_ mem_
 
pi_context Context
 
char * MapHostPtr = nullptr
 
std::mutex SurfaceLock
 
unsigned int SurfaceIndex
 
std::unordered_map< void *, MappingMappings
 
std::mutex MappingsMutex
 
cm_surface_ptr_t SurfacePtr
 
- Public Attributes inherited from _pi_object
std::atomic< pi_uint32RefCount
 
ReferenceCounter RefCount
 
pi_shared_mutex Mutex
 

Additional Inherited Members

- Public Types inherited from _pi_mem
enum class  mem_type { buffer , surface , buffer , surface }
 
enum class  mem_type { buffer , surface , buffer , surface }
 
enum  access_mode_t { unknown , read_write , read_only , write_only }
 
using pi_context = _pi_context *
 
using pi_context = _pi_context *
 
- Protected Member Functions inherited from _pi_mem
 _pi_mem (pi_context ctxt, char *HostPtr, cm_surface_ptr_t SurfacePtrArg, unsigned int SurfaceIdxArg)
 
 _pi_mem (pi_context Ctx)
 

Detailed Description

Definition at line 179 of file pi_esimd_emulator.hpp.

Constructor & Destructor Documentation

◆ _pi_buffer() [1/4]

_pi_buffer::_pi_buffer ( pi_context  ctxt,
char *  HostPtr,
cm_surface_ptr_t  SurfacePtrArg,
unsigned int  SurfaceIdxArg,
size_t  SizeArg 
)
inline

Definition at line 181 of file pi_esimd_emulator.hpp.

◆ _pi_buffer() [2/4]

_pi_buffer::_pi_buffer ( pi_context  Context,
size_t  Size,
char *  HostPtr,
bool  ImportedHostPtr = false 
)
inline

◆ _pi_buffer() [3/4]

_pi_buffer::_pi_buffer ( pi_buffer  Parent,
size_t  Origin,
size_t  Size 
)
inline

Definition at line 1049 of file pi_level_zero.hpp.

◆ _pi_buffer() [4/4]

_pi_buffer::_pi_buffer ( pi_context  Context,
size_t  Size,
pi_device  Device,
char *  ZeMemHandle,
bool  OwnZeMemHandle 
)
inline

Member Function Documentation

◆ free()

◆ getAlignment()

size_t _pi_buffer::getAlignment ( ) const

Definition at line 8876 of file pi_level_zero.cpp.

◆ getZeHandle()

◆ getZeHandlePtr()

pi_result _pi_buffer::getZeHandlePtr ( char **&  ZeHandlePtr,
access_mode_t  AccessMode,
pi_device  Device = nullptr 
)
overridevirtual

Implements _pi_mem.

Definition at line 8867 of file pi_level_zero.cpp.

References sycl::_V1::AccessMode, _pi_queue::Device, and PI_CALL.

◆ isImage()

bool _pi_buffer::isImage ( ) const
inlineoverridevirtual

Implements _pi_mem.

Definition at line 1088 of file pi_level_zero.hpp.

◆ isSubBuffer()

bool _pi_buffer::isSubBuffer ( ) const
inline

Definition at line 1090 of file pi_level_zero.hpp.

Member Data Documentation

◆ Allocations

std::unordered_map<pi_device, allocation_t> _pi_buffer::Allocations

Definition at line 1115 of file pi_level_zero.hpp.

◆ LastDeviceWithValidAllocation

pi_device _pi_buffer::LastDeviceWithValidAllocation {nullptr}

Definition at line 1116 of file pi_level_zero.hpp.

◆ MapHostPtr

char* _pi_buffer::MapHostPtr {nullptr}

Definition at line 1123 of file pi_level_zero.hpp.

Referenced by piEnqueueMemBufferRead(), and sycl_get_cm_buffer_params().

◆ Mappings

std::unordered_map<void *, Mapping> _pi_buffer::Mappings

Definition at line 1136 of file pi_level_zero.hpp.

◆ OnHost

bool _pi_buffer::OnHost {false}

Definition at line 1120 of file pi_level_zero.hpp.

Referenced by piMemBufferCreate().

◆ Origin

size_t _pi_buffer::Origin

Definition at line 1144 of file pi_level_zero.hpp.

◆ Parent

_pi_mem* _pi_buffer::Parent

Definition at line 1143 of file pi_level_zero.hpp.

◆ Size

size_t _pi_buffer::Size

Definition at line 185 of file pi_esimd_emulator.hpp.

Referenced by sycl_get_cm_buffer_params().

◆ 

struct { ... } _pi_buffer::SubBuffer

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