File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
paddle/fluid/inference/api Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -409,13 +409,15 @@ void AnalysisPredictor::MkldnnPreSet(
409409void AnalysisPredictor::MkldnnPostReset () {
410410#ifdef PADDLE_WITH_MKLDNN
411411 // In cache clearing mode.
412- auto dev_ctx = static_cast <platform::MKLDNNDeviceContext *>(
413- (&platform::DeviceContextPool::Instance ())->Get (platform::CPUPlace ()));
414-
415412 if (config_.mkldnn_cache_capacity_ > 0 &&
416- dev_ctx->GetCachedObjectsNumber () > 0 ) {
413+ static_cast <platform::MKLDNNDeviceContext *>(
414+ (&platform::DeviceContextPool::Instance ())->Get (platform::CPUPlace ()))
415+ ->GetCachedObjectsNumber () > 0 ) {
417416 if (VLOG_IS_ON (2 )) {
418- auto shape_blob_size = dev_ctx->GetShapeBlobSize ();
417+ auto shape_blob_size = static_cast <platform::MKLDNNDeviceContext *>(
418+ (&platform::DeviceContextPool::Instance ())
419+ ->Get (platform::CPUPlace ()))
420+ ->GetShapeBlobSize ();
419421 CHECK_LE (shape_blob_size,
420422 static_cast <size_t >(config_.mkldnn_cache_capacity_ ));
421423 }
You can’t perform that action at this time.
0 commit comments