OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CudaMgrNoCuda.cpp
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 #include "CudaMgr.h"
18 #include "Logger/Logger.h"
19 
20 namespace CudaMgr_Namespace {
21 
22 CudaMgr::CudaMgr(const int, const int) : device_count_(-1), start_gpu_(-1) {
23  CHECK(false);
24 }
25 
27 
28 size_t CudaMgr::computePaddedBufferSize(size_t buf_size, size_t granularity) const {
29  CHECK(false);
30  return 0;
31 }
32 
33 size_t CudaMgr::getGranularity(const int device_num) const {
34  CHECK(false);
35  return 0;
36 }
37 
38 void CudaMgr::synchronizeDevices() const {
39  CHECK(false);
40 }
41 
42 void CudaMgr::copyHostToDevice(int8_t* device_ptr,
43  const int8_t* host_ptr,
44  const size_t num_bytes,
45  const int device_num,
46  CUstream cuda_stream) {
47  CHECK(false);
48 }
49 void CudaMgr::copyDeviceToHost(int8_t* host_ptr,
50  const int8_t* device_ptr,
51  const size_t num_bytes,
52  CUstream cuda_stream) {
53  CHECK(false);
54 }
55 void CudaMgr::copyDeviceToDevice(int8_t* dest_ptr,
56  int8_t* src_ptr,
57  const size_t num_bytes,
58  const int dest_device_num,
59  const int src_device_num,
60  CUstream cuda_stream) {
61  CHECK(false);
62 }
63 
64 int8_t* CudaMgr::allocatePinnedHostMem(const size_t num_bytes) {
65  CHECK(false);
66  return nullptr;
67 }
68 int8_t* CudaMgr::allocateDeviceMem(const size_t num_bytes,
69  const int device_num,
70  const bool is_slab) {
71  CHECK(false);
72  return nullptr;
73 }
74 void CudaMgr::freePinnedHostMem(int8_t* host_ptr) {
75  CHECK(false);
76 }
77 void CudaMgr::freeDeviceMem(int8_t* device_ptr) {
78  CHECK(false);
79 }
80 void CudaMgr::zeroDeviceMem(int8_t* device_ptr,
81  const size_t num_bytes,
82  const int device_num,
83  CUstream cuda_stream) {
84  CHECK(false);
85 }
86 void CudaMgr::setDeviceMem(int8_t* device_ptr,
87  const unsigned char uc,
88  const size_t num_bytes,
89  const int device_num,
90  CUstream cuda_stream) {
91  CHECK(false);
92 }
93 
95  CHECK(false);
96  return false;
97 }
99  CHECK(false);
100  return false;
101 }
102 
103 void CudaMgr::setContext(const int) const {
104  CHECK(false);
105 }
106 
107 int CudaMgr::getContext() const {
108  CHECK(false);
109  return 0;
110 }
111 
112 } // namespace CudaMgr_Namespace
void copyHostToDevice(int8_t *device_ptr, const int8_t *host_ptr, const size_t num_bytes, const int device_num, CUstream cuda_stream=0)
Definition: CudaMgr.cpp:127
size_t getGranularity(const int device_num) const
Definition: CudaMgr.cpp:109
void * CUstream
Definition: nocuda.h:23
void setDeviceMem(int8_t *device_ptr, const unsigned char uc, const size_t num_bytes, const int device_num, CUstream cuda_stream=0)
Definition: CudaMgr.cpp:418
int8_t * allocatePinnedHostMem(const size_t num_bytes)
Definition: CudaMgr.cpp:326
void setContext(const int device_num) const
Definition: CudaMgr.cpp:511
void freeDeviceMem(int8_t *device_ptr)
Definition: CudaMgr.cpp:392
void copyDeviceToDevice(int8_t *dest_ptr, int8_t *src_ptr, const size_t num_bytes, const int dest_device_num, const int src_device_num, CUstream cuda_stream=0)
Definition: CudaMgr.cpp:164
size_t computePaddedBufferSize(size_t buf_size, size_t granularity) const
Definition: CudaMgr.cpp:105
bool isArchMaxwellOrLaterForAll() const
Definition: CudaMgr.cpp:437
void copyDeviceToHost(int8_t *host_ptr, const int8_t *device_ptr, const size_t num_bytes, CUstream cuda_stream=0)
Definition: CudaMgr.cpp:143
void freePinnedHostMem(int8_t *host_ptr)
virtual int8_t * allocateDeviceMem(const size_t num_bytes, const int device_num, const bool is_slab=false)
Definition: CudaMgr.cpp:333
#define CHECK(condition)
Definition: Logger.h:291
void synchronizeDevices() const
Definition: CudaMgr.cpp:120
void zeroDeviceMem(int8_t *device_ptr, const size_t num_bytes, const int device_num, CUstream cuda_stream=0)
Definition: CudaMgr.cpp:411
device_count_(device_count)
CudaMgr(const int num_gpus, const int start_gpu=0)
Definition: CudaMgr.cpp:48
bool isArchVoltaOrGreaterForAll() const
Definition: CudaMgr.cpp:450