OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CpuBufferMgr.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, 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 CpuBufferMgr : public BufferMgr {
28  public:
29  CpuBufferMgr(const int device_id,
30  const size_t max_buffer_size,
32  const size_t buffer_alloc_increment = 2147483648,
33  const size_t page_size = 512,
34  AbstractBufferMgr* parent_mgr = 0);
35  inline MgrType getMgrType() override { return CPU_MGR; }
36  inline std::string getStringMgrType() override { return ToString(CPU_MGR); }
37  ~CpuBufferMgr() override;
38 
39  private:
40  void addSlab(const size_t slab_size) override;
41  void freeAllMem() override;
42  void allocateBuffer(BufferList::iterator segment_iter,
43  const size_t page_size,
44  const size_t initial_size) override;
45 
47 };
48 
49 } // namespace Buffer_Namespace
void addSlab(const size_t slab_size) override
void allocateBuffer(BufferList::iterator segment_iter, const size_t page_size, const size_t initial_size) override
MgrType getMgrType() override
Definition: CpuBufferMgr.h:35
CudaMgr_Namespace::CudaMgr * cuda_mgr_
Definition: CpuBufferMgr.h:46
Note(s): Forbid Copying Idiom 4.1.
Definition: BufferMgr.h:97
CpuBufferMgr(const int device_id, const size_t max_buffer_size, CudaMgr_Namespace::CudaMgr *cuda_mgr, const size_t buffer_alloc_increment=2147483648, const size_t page_size=512, AbstractBufferMgr *parent_mgr=0)
std::string getStringMgrType() override
Definition: CpuBufferMgr.h:36