Skip to content

Commit

Permalink
fix device context init error (PaddlePaddle#43910)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenwhql committed Aug 8, 2022
1 parent 9336dd3 commit 72a48da
Show file tree
Hide file tree
Showing 3 changed files with 228 additions and 95 deletions.
4 changes: 3 additions & 1 deletion paddle/fluid/platform/device_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ limitations under the License. */
#endif

#ifdef PADDLE_WITH_MKLDNN
#include "dnnl.hpp"
#include "dnnl.hpp" // NOLINT
#include "paddle/fluid/framework/data_layout.h"
#endif

Expand Down Expand Up @@ -902,6 +902,8 @@ class DeviceContextPool {
return *pool;
}

static bool IsInitialized() { return pool != nullptr; }

static void SetPool(DeviceContextPool* dev_pool) { pool = dev_pool; }

/*! \brief Return handle of single device context. */
Expand Down
Loading

0 comments on commit 72a48da

Please sign in to comment.