未验证 提交 1d31764e 编写于 作者: J jakpiase 提交者: GitHub

Fix for MKLDNNDeviceContext error in matmul_v2_transpose_reshape fuse pass when GLOG_v set (#38554)

* glog fix

* changed approach
上级 730ccd9e
...@@ -409,7 +409,10 @@ void AnalysisPredictor::MkldnnPreSet( ...@@ -409,7 +409,10 @@ void AnalysisPredictor::MkldnnPreSet(
void AnalysisPredictor::MkldnnPostReset() { void AnalysisPredictor::MkldnnPostReset() {
#ifdef PADDLE_WITH_MKLDNN #ifdef PADDLE_WITH_MKLDNN
// In cache clearing mode. // In cache clearing mode.
if (config_.mkldnn_cache_capacity_ > 0) { if (config_.mkldnn_cache_capacity_ > 0 &&
static_cast<platform::MKLDNNDeviceContext *>(
(&platform::DeviceContextPool::Instance())->Get(platform::CPUPlace()))
->GetCachedObjectsNumber() > 0) {
if (VLOG_IS_ON(2)) { if (VLOG_IS_ON(2)) {
auto shape_blob_size = static_cast<platform::MKLDNNDeviceContext *>( auto shape_blob_size = static_cast<platform::MKLDNNDeviceContext *>(
(&platform::DeviceContextPool::Instance()) (&platform::DeviceContextPool::Instance())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册