Skip to content

Commit 962711d

Browse files
authored
Add some paddleenforce. (#11516)
1 parent e6654c1 commit 962711d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

paddle/fluid/memory/detail/system_allocator.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,16 @@ void* CPUAllocator::Alloc(size_t* index, size_t size) {
4343

4444
*index = 0; // unlock memory
4545

46-
void* p;
46+
void* p = nullptr;
4747

4848
#ifdef PADDLE_WITH_MKLDNN
4949
// refer to https://github.com/01org/mkl-dnn/blob/master/include/mkldnn.hpp
5050
// memory alignment
51-
PADDLE_ENFORCE_EQ(posix_memalign(&p, 4096ul, size), 0);
51+
PADDLE_ENFORCE_EQ(posix_memalign(&p, 4096ul, size), 0, "Alloc %ld error!",
52+
size);
5253
#else
53-
PADDLE_ENFORCE_EQ(posix_memalign(&p, 32ul, size), 0);
54+
PADDLE_ENFORCE_EQ(posix_memalign(&p, 32ul, size), 0, "Alloc %ld error!",
55+
size);
5456
#endif
5557
PADDLE_ENFORCE(p, "Fail to allocate CPU memory: size = %d .", size);
5658

paddle/fluid/operators/detail/grpc_client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void GRPCClient::Proceed() {
245245
if (c->status_.ok()) {
246246
c->Process();
247247
} else {
248-
LOG(ERROR) << "var: " << c->var_h_.String()
248+
LOG(FATAL) << "var: " << c->var_h_.String()
249249
<< " grpc error:" << c->status_.error_message();
250250
}
251251
delete c;

0 commit comments

Comments
 (0)