OmniSciDB  c1a53651b2
 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 void CudaMgr::synchronizeDevices() const {
29  CHECK(false);
30 }
31 
32 void CudaMgr::copyHostToDevice(int8_t* device_ptr,
33  const int8_t* host_ptr,
34  const size_t num_bytes,
35  const int device_num,
36  CUstream cuda_stream) {
37  CHECK(false);
38 }
39 void CudaMgr::copyDeviceToHost(int8_t* host_ptr,
40  const int8_t* device_ptr,
41  const size_t num_bytes,
42  const int device_num,
43  CUstream cuda_stream) {
44  CHECK(false);
45 }
46 void CudaMgr::copyDeviceToDevice(int8_t* dest_ptr,
47  int8_t* src_ptr,
48  const size_t num_bytes,
49  const int dest_device_num,
50  const int src_device_num,
51  CUstream cuda_stream) {
52  CHECK(false);
53 }
54 
55 int8_t* CudaMgr::allocatePinnedHostMem(const size_t num_bytes) {
56  CHECK(false);
57  return nullptr;
58 }
59 int8_t* CudaMgr::allocateDeviceMem(const size_t num_bytes, const int device_num) {
60  CHECK(false);
61  return nullptr;
62 }
63 void CudaMgr::freePinnedHostMem(int8_t* host_ptr) {
64  CHECK(false);
65 }
66 void CudaMgr::freeDeviceMem(int8_t* device_ptr) {
67  CHECK(false);
68 }
69 void CudaMgr::zeroDeviceMem(int8_t* device_ptr,
70  const size_t num_bytes,
71  const int device_num,
72  CUstream cuda_stream) {
73  CHECK(false);
74 }
75 void CudaMgr::setDeviceMem(int8_t* device_ptr,
76  const unsigned char uc,
77  const size_t num_bytes,
78  const int device_num,
79  CUstream cuda_stream) {
80  CHECK(false);
81 }
82 
84  CHECK(false);
85  return false;
86 }
88  CHECK(false);
89  return false;
90 }
91 
92 void CudaMgr::setContext(const int) const {
93  CHECK(false);
94 }
95 
96 int CudaMgr::getContext() const {
97  CHECK(false);
98  return 0;
99 }
100 
101 } // 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: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:312
int8_t * allocatePinnedHostMem(const size_t num_bytes)
Definition: CudaMgr.cpp:281
void setContext(const int device_num) const
Definition: CudaMgr.cpp:405
void copyDeviceToHost(int8_t *host_ptr, const int8_t *device_ptr, const size_t num_bytes, const int device_num, CUstream cuda_stream=0)
Definition: CudaMgr.cpp:125
void freeDeviceMem(int8_t *device_ptr)
Definition: CudaMgr.cpp:299
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:143
bool isArchMaxwellOrLaterForAll() const
Definition: CudaMgr.cpp:331
void freePinnedHostMem(int8_t *host_ptr)
Definition: CudaMgr.cpp:295
#define CHECK(condition)
Definition: Logger.h:291
void synchronizeDevices() const
Definition: CudaMgr.cpp:102
void zeroDeviceMem(int8_t *device_ptr, const size_t num_bytes, const int device_num, CUstream cuda_stream=0)
Definition: CudaMgr.cpp:305
device_count_(device_count)
CudaMgr(const int num_gpus, const int start_gpu=0)
Definition: CudaMgr.cpp:49
bool isArchVoltaOrGreaterForAll() const
Definition: CudaMgr.cpp:344
int8_t * allocateDeviceMem(const size_t num_bytes, const int device_num)
Definition: CudaMgr.cpp:288