OmniSciDB  5ade3759e0
GpuCudaBuffer.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 GPUCUDABUFFER_H
18 #define GPUCUDABUFFER_H
19 
20 #include "../Buffer.h"
21 
22 namespace CudaMgr_Namespace {
23 class CudaMgr;
24 }
25 namespace Buffer_Namespace {
26 
27 class GpuCudaBuffer : public Buffer {
28  public:
30  BufferList::iterator segIt,
31  const int deviceId,
33  const size_t pageSize = 512,
34  const size_t numBytes = 0);
35  inline Data_Namespace::MemoryLevel getType() const override { return GPU_LEVEL; }
36  // virtual inline int getDeviceId() const { return gpuNum_; }
37 
38  private:
39  void readData(int8_t* const dst,
40  const size_t numBytes,
41  const size_t offset = 0,
42  const MemoryLevel dstBufferType = CPU_LEVEL,
43  const int dstDeviceId = -1) override;
44  void writeData(int8_t* const src,
45  const size_t numBytes,
46  const size_t offset = 0,
47  const MemoryLevel srcBufferType = CPU_LEVEL,
48  const int srcDeviceId = -1) override;
49  // int gpuNum_;
51 };
52 } // namespace Buffer_Namespace
53 
54 #endif // GPUCUDABUFFER_H
int64_t * src
Note(s): Forbid Copying Idiom 4.1.
Definition: BufferMgr.h:96
Data_Namespace::MemoryLevel getType() const override
Definition: GpuCudaBuffer.h:35
CudaMgr_Namespace::CudaMgr * cudaMgr_
Definition: GpuCudaBuffer.h:50
Note(s): Forbid Copying Idiom 4.1.
Definition: Buffer.h:45