|
|
|
@ -17,12 +17,11 @@ limitations under the License. */
|
|
|
|
|
namespace paddle {
|
|
|
|
|
namespace framework {
|
|
|
|
|
|
|
|
|
|
static OpInfoMap* g_op_info_map = nullptr;
|
|
|
|
|
|
|
|
|
|
// C++11 removes the need for manual locking. Concurrent execution shall wait if
|
|
|
|
|
// a static local variable is already being initialized.
|
|
|
|
|
// https://stackoverflow.com/questions/11711920/how-to-implement-multithread-safe-singleton-in-c11-without-using-mutex
|
|
|
|
|
OpInfoMap& OpInfoMap::Instance() {
|
|
|
|
|
if (g_op_info_map == nullptr) {
|
|
|
|
|
g_op_info_map = new OpInfoMap();
|
|
|
|
|
}
|
|
|
|
|
static OpInfoMap* g_op_info_map = new OpInfoMap();
|
|
|
|
|
return *g_op_info_map;
|
|
|
|
|
}
|
|
|
|
|
} // namespace framework
|
|
|
|
|