Skip to content

Commit 898d97d

Browse files
committed
refactor(logging): replace LOG(WARNING) with VLOG(3) in cpu_guard_impl.cc
1 parent bdec219 commit 898d97d

1 file changed

Lines changed: 33 additions & 33 deletions

File tree

infini_train/src/core/runtime/cpu/cpu_guard_impl.cc

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,101 +20,101 @@ Device::DeviceType CpuGuardImpl::Type() const { return Device::DeviceType::kCPU;
2020
void CpuGuardImpl::SetDevice(Device device) const {
2121
// No-op for CPU
2222
CHECK(device.type() == Device::DeviceType::kCPU);
23-
LOG(WARNING) << "CpuGuardImpl::SetDevice is not supported. "
24-
"The call is ignored.";
23+
VLOG(3) << "CpuGuardImpl::SetDevice is not supported. "
24+
"The call is ignored.";
2525
}
2626

2727
int CpuGuardImpl::DeviceCount() const { return 1; }
2828

2929
Stream *CpuGuardImpl::GetStream(Device device) const {
3030
CHECK(device.type() == Device::DeviceType::kCPU);
31-
LOG(WARNING) << "CpuGuardImpl::GetStream is not supported. "
32-
"Return nullptr.";
31+
VLOG(3) << "CpuGuardImpl::GetStream is not supported. "
32+
"Return nullptr.";
3333
return nullptr;
3434
}
3535

3636
Stream *CpuGuardImpl::CreateStream(Device device) const {
3737
CHECK(device.type() == Device::DeviceType::kCPU);
38-
LOG(WARNING) << "CpuGuardImpl::CreateStream is not supported. "
39-
"Return nullptr.";
38+
VLOG(3) << "CpuGuardImpl::CreateStream is not supported. "
39+
"Return nullptr.";
4040
return nullptr;
4141
}
4242

4343
Stream *CpuGuardImpl::CreateStreamWithPriority(Device device, int priority) const {
4444
CHECK(device.type() == Device::DeviceType::kCPU);
45-
LOG(WARNING) << "CpuGuardImpl::CreateStreamWithPriority is not supported. "
46-
"Return nullptr.";
45+
VLOG(3) << "CpuGuardImpl::CreateStreamWithPriority is not supported. "
46+
"Return nullptr.";
4747
return nullptr;
4848
}
4949

5050
void CpuGuardImpl::DestroyStream(Stream *stream) const {
51-
LOG(WARNING) << "CpuGuardImpl::DestroyStream is not supported. "
52-
"The call is ignored.";
51+
VLOG(3) << "CpuGuardImpl::DestroyStream is not supported. "
52+
"The call is ignored.";
5353
}
5454

5555
void CpuGuardImpl::GetStreamPriorityRange(int *low, int *high) const {
5656
*low = 0;
5757
*high = 0;
58-
LOG(WARNING) << "CpuGuardImpl::GetStreamPriorityRange is not supported. "
59-
"Return range [0, 0].";
58+
VLOG(3) << "CpuGuardImpl::GetStreamPriorityRange is not supported. "
59+
"Return range [0, 0].";
6060
}
6161

6262
void CpuGuardImpl::EventCreate(Event **event) const {
6363
CHECK_NOTNULL(event);
64-
LOG(WARNING) << "CpuGuardImpl::EventCreate is not supported. Returning nullptr event.";
64+
VLOG(3) << "CpuGuardImpl::EventCreate is not supported. Returning nullptr event.";
6565
*event = nullptr;
6666
}
6767

6868
void CpuGuardImpl::EventCreateWithFlags(Event **event, EventFlag flags) const {
6969
CHECK_NOTNULL(event);
70-
LOG(WARNING) << "CpuGuardImpl::EventCreateWithFlags is not supported. Returning nullptr event.";
70+
VLOG(3) << "CpuGuardImpl::EventCreateWithFlags is not supported. Returning nullptr event.";
7171
*event = nullptr;
7272
}
7373

7474
void CpuGuardImpl::EventDestroy(Event *event) const {
75-
LOG(WARNING) << "CpuGuardImpl::EventDestroy is not supported. The call is ignored.";
75+
VLOG(3) << "CpuGuardImpl::EventDestroy is not supported. The call is ignored.";
7676
}
7777

7878
void CpuGuardImpl::EventRecord(Event *event, Stream *stream) const {
79-
LOG(WARNING) << "CpuGuardImpl::EventRecord is not supported. The call is ignored.";
79+
VLOG(3) << "CpuGuardImpl::EventRecord is not supported. The call is ignored.";
8080
}
8181

8282
void CpuGuardImpl::StreamWaitEvent(Stream *stream, Event *event, uint32_t flags) const {
83-
LOG(WARNING) << "CpuGuardImpl::StreamWaitEvent is not supported. The call is ignored.";
83+
VLOG(3) << "CpuGuardImpl::StreamWaitEvent is not supported. The call is ignored.";
8484
}
8585

8686
RuntimeStatus CpuGuardImpl::EventSynchronize(Event *event) const {
87-
LOG(WARNING) << "CpuGuardImpl::EventSynchronize is not supported. Returning kError.";
87+
VLOG(3) << "CpuGuardImpl::EventSynchronize is not supported. Returning kError.";
8888
return RuntimeStatus::kError;
8989
}
9090

9191
RuntimeStatus CpuGuardImpl::EventQuery(Event *event) const {
92-
LOG(WARNING) << "CpuGuardImpl::EventQuery is not supported. Returning kError.";
92+
VLOG(3) << "CpuGuardImpl::EventQuery is not supported. Returning kError.";
9393
return RuntimeStatus::kError;
9494
}
9595

9696
float CpuGuardImpl::EventElapsedTime(Event *start_event, Event *stop_event) const {
97-
LOG(WARNING) << "CpuGuardImpl::EventElapsedTime is not supported. Returning 0.";
97+
VLOG(3) << "CpuGuardImpl::EventElapsedTime is not supported. Returning 0.";
9898
return 0.0f;
9999
}
100100

101101
void CpuGuardImpl::SynchronizeDevice(Device device) const {
102102
// No-op for CPU
103103
CHECK(device.type() == Device::DeviceType::kCPU);
104-
LOG(WARNING) << "CpuGuardImpl::SynchronizeDevice is not supported. "
105-
"The call is ignored.";
104+
VLOG(3) << "CpuGuardImpl::SynchronizeDevice is not supported. "
105+
"The call is ignored.";
106106
}
107107

108108
void CpuGuardImpl::SynchronizeStream(Stream *) const {
109109
// No-op for CPU
110-
LOG(WARNING) << "CpuGuardImpl::SynchronizeStream is not supported. "
111-
"The call is ignored.";
110+
VLOG(3) << "CpuGuardImpl::SynchronizeStream is not supported. "
111+
"The call is ignored.";
112112
}
113113

114114
BlasHandle *CpuGuardImpl::GetBlasHandle(Device device) const {
115115
CHECK(device.type() == Device::DeviceType::kCPU);
116-
LOG(WARNING) << "CpuGuardImpl::GetBlasHandle is not supported. "
117-
"Return nullptr.";
116+
VLOG(3) << "CpuGuardImpl::GetBlasHandle is not supported. "
117+
"Return nullptr.";
118118
return nullptr;
119119
}
120120

@@ -123,12 +123,12 @@ void CpuGuardImpl::Malloc(void **dev_ptr, size_t size) { *dev_ptr = std::malloc(
123123
void CpuGuardImpl::Free(void *dev_ptr) { std::free(dev_ptr); }
124124

125125
void CpuGuardImpl::MallocAsync(void **dev_ptr, size_t size, Stream *stream) {
126-
LOG(WARNING) << "CpuGuardImpl::MallocAsync is not supported. Falling back to blocking Malloc()";
126+
VLOG(3) << "CpuGuardImpl::MallocAsync is not supported. Falling back to blocking Malloc()";
127127
Malloc(dev_ptr, size);
128128
}
129129

130130
void CpuGuardImpl::FreeAsync(void *dev_ptr, Stream *stream) {
131-
LOG(WARNING) << "CpuGuardImpl::FreeAsync is not supported. Falling back to blocking Free()";
131+
VLOG(3) << "CpuGuardImpl::FreeAsync is not supported. Falling back to blocking Free()";
132132
Free(dev_ptr);
133133
}
134134

@@ -140,21 +140,21 @@ void CpuGuardImpl::Memcpy(void *dst, const void *src, size_t count, MemcpyKind k
140140
}
141141

142142
void CpuGuardImpl::MemcpyAsync(void *dst, const void *src, size_t count, MemcpyKind kind, Stream *stream) {
143-
LOG(WARNING) << "CpuGuardImpl::MemcpyAsync is not supported. Falling back to blocking Memcpy()";
143+
VLOG(3) << "CpuGuardImpl::MemcpyAsync is not supported. Falling back to blocking Memcpy()";
144144
Memcpy(dst, src, count, kind);
145145
}
146146

147147
void CpuGuardImpl::ResetMemPoolHighWatermarks(Device device) const {
148148
// No-op for CPU
149149
CHECK(device.type() == Device::DeviceType::kCPU);
150-
LOG(WARNING) << "CpuGuardImpl::ResetMemPoolHighWatermarks is not supported. "
151-
"The call is ignored.";
150+
VLOG(3) << "CpuGuardImpl::ResetMemPoolHighWatermarks is not supported. "
151+
"The call is ignored.";
152152
}
153153

154154
std::pair<size_t, size_t> CpuGuardImpl::GetMemPoolPeakMB(Device device) const {
155155
CHECK(device.type() == Device::DeviceType::kCPU);
156-
LOG(WARNING) << "CpuGuardImpl::GetMemPoolPeakMB is not supported. "
157-
"Return {0, 0}.";
156+
VLOG(3) << "CpuGuardImpl::GetMemPoolPeakMB is not supported. "
157+
"Return {0, 0}.";
158158
return {0, 0};
159159
}
160160

0 commit comments

Comments
 (0)