未验证 提交 962711dc 编写于 作者: G gongweibao 提交者: GitHub

Add some paddleenforce. (#11516)

上级 e6654c1c
...@@ -43,14 +43,16 @@ void* CPUAllocator::Alloc(size_t* index, size_t size) { ...@@ -43,14 +43,16 @@ void* CPUAllocator::Alloc(size_t* index, size_t size) {
*index = 0; // unlock memory *index = 0; // unlock memory
void* p; void* p = nullptr;
#ifdef PADDLE_WITH_MKLDNN #ifdef PADDLE_WITH_MKLDNN
// refer to https://github.com/01org/mkl-dnn/blob/master/include/mkldnn.hpp // refer to https://github.com/01org/mkl-dnn/blob/master/include/mkldnn.hpp
// memory alignment // memory alignment
PADDLE_ENFORCE_EQ(posix_memalign(&p, 4096ul, size), 0); PADDLE_ENFORCE_EQ(posix_memalign(&p, 4096ul, size), 0, "Alloc %ld error!",
size);
#else #else
PADDLE_ENFORCE_EQ(posix_memalign(&p, 32ul, size), 0); PADDLE_ENFORCE_EQ(posix_memalign(&p, 32ul, size), 0, "Alloc %ld error!",
size);
#endif #endif
PADDLE_ENFORCE(p, "Fail to allocate CPU memory: size = %d .", size); PADDLE_ENFORCE(p, "Fail to allocate CPU memory: size = %d .", size);
......
...@@ -245,7 +245,7 @@ void GRPCClient::Proceed() { ...@@ -245,7 +245,7 @@ void GRPCClient::Proceed() {
if (c->status_.ok()) { if (c->status_.ok()) {
c->Process(); c->Process();
} else { } else {
LOG(ERROR) << "var: " << c->var_h_.String() LOG(FATAL) << "var: " << c->var_h_.String()
<< " grpc error:" << c->status_.error_message(); << " grpc error:" << c->status_.error_message();
} }
delete c; delete c;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册