OmniSciDB  04ee39c94c
GpuCudaBufferMgr.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 #ifndef GPUCUDABUFFERMGR_H
18 #define GPUCUDABUFFERMGR_H
19 
20 #include "../BufferMgr.h"
21 
22 namespace CudaMgr_Namespace {
23 class CudaMgr;
24 }
25 
26 namespace Buffer_Namespace {
27 
28 class GpuCudaBufferMgr : public BufferMgr {
29  public:
30  GpuCudaBufferMgr(const int deviceId,
31  const size_t maxBufferSize,
33  const size_t bufferAllocIncrement = 1073741824,
34  const size_t pageSize = 512,
35  AbstractBufferMgr* parentMgr = 0);
36  inline MgrType getMgrType() override { return GPU_MGR; }
37  inline std::string getStringMgrType() override { return ToString(GPU_MGR); }
38  ~GpuCudaBufferMgr() override;
39 
40  private:
41  void addSlab(const size_t slabSize) override;
42  void freeAllMem() override;
43  void allocateBuffer(BufferList::iterator segIt,
44  const size_t pageSize,
45  const size_t initialSize) override;
47 };
48 
49 } // namespace Buffer_Namespace
50 
51 #endif // CPUBUFFERMGR_H
Note(s): Forbid Copying Idiom 4.1.
Definition: BufferMgr.h:96
std::string getStringMgrType() override
CudaMgr_Namespace::CudaMgr * cudaMgr_