OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GpuCudaBuffer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
20 
21 namespace CudaMgr_Namespace {
22 class CudaMgr;
23 }
24 namespace Buffer_Namespace {
25 
26 class GpuCudaBuffer : public Buffer {
27  public:
29  BufferList::iterator seg_it,
30  const int device_id,
32  const size_t page_size = 512,
33  const size_t num_bytes = 0);
34  inline Data_Namespace::MemoryLevel getType() const override { return GPU_LEVEL; }
35 
36  private:
37  void readData(int8_t* const dst,
38  const size_t num_bytes,
39  const size_t offset = 0,
40  const MemoryLevel dst_buffer_type = CPU_LEVEL,
41  const int dst_devic_id = -1) override;
42  void writeData(int8_t* const src,
43  const size_t num_bytes,
44  const size_t offset = 0,
45  const MemoryLevel src_buffer_type = CPU_LEVEL,
46  const int src_device_id = -1) override;
47 
49 };
50 } // namespace Buffer_Namespace
Note(s): Forbid Copying Idiom 4.1.
Definition: BufferMgr.h:96
void readData(int8_t *const dst, const size_t num_bytes, const size_t offset=0, const MemoryLevel dst_buffer_type=CPU_LEVEL, const int dst_devic_id=-1) override
Data_Namespace::MemoryLevel getType() const override
Definition: GpuCudaBuffer.h:34
void writeData(int8_t *const src, const size_t num_bytes, const size_t offset=0, const MemoryLevel src_buffer_type=CPU_LEVEL, const int src_device_id=-1) override
CudaMgr_Namespace::CudaMgr * cuda_mgr_
Definition: GpuCudaBuffer.h:48
GpuCudaBuffer(BufferMgr *bm, BufferList::iterator seg_it, const int device_id, CudaMgr_Namespace::CudaMgr *cuda_mgr, const size_t page_size=512, const size_t num_bytes=0)
Note(s): Forbid Copying Idiom 4.1.
Definition: Buffer.h:42