OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GpuCudaBufferMgr.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 
25 namespace Buffer_Namespace {
26 
27 class GpuCudaBufferMgr : public BufferMgr {
28  public:
29  GpuCudaBufferMgr(const int device_id,
30  const size_t max_buffer_pool_size,
32  const size_t min_slab_size,
33  const size_t max_slab_size,
34  const size_t default_slab_size,
35  const size_t page_size,
36  AbstractBufferMgr* parent_mgr = 0);
37  inline MgrType getMgrType() override { return GPU_MGR; }
38  inline std::string getStringMgrType() override { return ToString(GPU_MGR); }
39  ~GpuCudaBufferMgr() override;
40 
41  private:
42  void addSlab(const size_t slab_size) override;
43  void freeAllMem() override;
44  void allocateBuffer(BufferList::iterator seg_it,
45  const size_t page_size,
46  const size_t initial_size) override;
48 };
49 
50 } // namespace Buffer_Namespace
GpuCudaBufferMgr(const int device_id, const size_t max_buffer_pool_size, CudaMgr_Namespace::CudaMgr *cuda_mgr, const size_t min_slab_size, const size_t max_slab_size, const size_t default_slab_size, const size_t page_size, AbstractBufferMgr *parent_mgr=0)
Note(s): Forbid Copying Idiom 4.1.
Definition: BufferMgr.h:96
void addSlab(const size_t slab_size) override
std::string getStringMgrType() override
void allocateBuffer(BufferList::iterator seg_it, const size_t page_size, const size_t initial_size) override
This file includes the class specification for the buffer manager (BufferMgr), and related data struc...
CudaMgr_Namespace::CudaMgr * cuda_mgr_