OmniSciDB
a5dc49c757
|
#include <CpuBuffer.h>
Public Member Functions | |
CpuBuffer (BufferMgr *bm, BufferList::iterator segment_iter, const int device_id, CudaMgr_Namespace::CudaMgr *cuda_mgr, const size_t page_size=512, const size_t num_bytes=0) | |
Data_Namespace::MemoryLevel | getType () const override |
Public Member Functions inherited from Buffer_Namespace::Buffer | |
Buffer (BufferMgr *bm, BufferList::iterator seg_it, const int device_id, const size_t page_size=512, const size_t num_bytes=0) | |
Constructs a Buffer object. The constructor requires a memory address (provided by BufferMgr), number of pages, and the size in bytes of each page. Additionally, the Buffer can be initialized with an epoch. More... | |
~Buffer () override | |
Destructor. More... | |
void | read (int8_t *const dst, const size_t num_bytes, const size_t offset=0, const MemoryLevel dst_buffer_type=CPU_LEVEL, const int device_id=-1) override |
Reads (copies) data from the buffer to the destination (dst) memory location. Reads (copies) nbytes of data from the buffer, beginning at the specified byte offset, into the destination (dst) memory location. More... | |
void | reserve (const size_t num_bytes) override |
void | write (int8_t *src, const size_t num_bytes, const size_t offset=0, const MemoryLevel src_buffer_type=CPU_LEVEL, const int device_id=-1) override |
Writes (copies) data from src into the buffer. Writes (copies) nbytes of data into the buffer at the specified byte offset, from the source (src) memory location. More... | |
void | append (int8_t *src, const size_t num_bytes, const MemoryLevel src_buffer_type=CPU_LEVEL, const int deviceId=-1) override |
int8_t * | getMemoryPtr () override |
Returns a raw, constant (read-only) pointer to the underlying buffer. More... | |
void | setMemoryPtr (int8_t *new_ptr) override |
size_t | reservedSize () const override |
Returns the total number of bytes allocated for the buffer. More... | |
size_t | pageCount () const override |
Returns the number of pages in the buffer. More... | |
size_t | pageSize () const override |
Returns the size in bytes of each page in the buffer. More... | |
int | pin () override |
int | unPin () override |
int | getPinCount () override |
int32_t | getSlabNum () const |
Public Member Functions inherited from Data_Namespace::AbstractBuffer | |
AbstractBuffer (const int device_id) | |
AbstractBuffer (const int device_id, const SQLTypeInfo sql_type) | |
virtual | ~AbstractBuffer () |
size_t | size () const |
int | getDeviceId () const |
bool | isDirty () const |
bool | isAppended () const |
bool | isUpdated () const |
bool | hasEncoder () const |
SQLTypeInfo | getSqlType () const |
void | setSqlType (const SQLTypeInfo &sql_type) |
Encoder * | getEncoder () const |
void | setDirty () |
void | setUpdated () |
void | setAppended () |
void | setSize (const size_t size) |
void | clearDirtyBits () |
void | initEncoder (const SQLTypeInfo &tmp_sql_type) |
void | syncEncoder (const AbstractBuffer *src_buffer) |
void | copyTo (AbstractBuffer *destination_buffer, const size_t num_bytes=0) |
void | resetToEmpty () |
Private Member Functions | |
void | readData (int8_t *const dst, const size_t num_bytes, const size_t offset=0, const MemoryLevel dst_memory_level=CPU_LEVEL, const int dst_device_id=-1) override |
void | writeData (int8_t *const src, const size_t num_bytes, const size_t offset=0, const MemoryLevel src_memory_level=CPU_LEVEL, const int src_device_id=-1) override |
Private Attributes | |
CudaMgr_Namespace::CudaMgr * | cuda_mgr_ |
Additional Inherited Members | |
Protected Attributes inherited from Buffer_Namespace::Buffer | |
int8_t * | mem_ |
Protected Attributes inherited from Data_Namespace::AbstractBuffer | |
std::unique_ptr< Encoder > | encoder_ |
SQLTypeInfo | sql_type_ |
size_t | size_ |
int | device_id_ |
Definition at line 26 of file CpuBuffer.h.
Buffer_Namespace::CpuBuffer::CpuBuffer | ( | BufferMgr * | bm, |
BufferList::iterator | segment_iter, | ||
const int | device_id, | ||
CudaMgr_Namespace::CudaMgr * | cuda_mgr, | ||
const size_t | page_size = 512 , |
||
const size_t | num_bytes = 0 |
||
) |
Definition at line 27 of file CpuBuffer.cpp.
|
inlineoverridevirtual |
Implements Data_Namespace::AbstractBuffer.
Definition at line 35 of file CpuBuffer.h.
References Data_Namespace::CPU_LEVEL.
|
overrideprivatevirtual |
Implements Buffer_Namespace::Buffer.
Definition at line 35 of file CpuBuffer.cpp.
References CHECK_GE, CudaMgr_Namespace::CudaMgr::copyHostToDevice(), Data_Namespace::CPU_LEVEL, cuda_mgr_, logger::FATAL, Data_Namespace::GPU_LEVEL, LOG, and Buffer_Namespace::Buffer::mem_.
|
overrideprivatevirtual |
Implements Buffer_Namespace::Buffer.
Definition at line 50 of file CpuBuffer.cpp.
References CHECK_GE, CudaMgr_Namespace::CudaMgr::copyDeviceToHost(), Data_Namespace::CPU_LEVEL, cuda_mgr_, logger::FATAL, Data_Namespace::GPU_LEVEL, LOG, and Buffer_Namespace::Buffer::mem_.
|
private |
Definition at line 49 of file CpuBuffer.h.
Referenced by readData(), and writeData().