| 233 | std::once_flag kernel_sig_map_init_flag; |
| 234 | |
| 235 | void InitDefaultKernelSignatureMap() { |
| 236 | std::call_once(kernel_sig_map_init_flag, [] { |
| 237 | for (const auto& pair : paddle::framework::OpInfoMap::Instance().map()) { |
| 238 | const auto& op_type = pair.first; |
| 239 | const auto* op_proto = pair.second.proto_; |
| 240 | if (phi::KernelFactory::Instance().HasCompatiblePhiKernel(op_type) && |
| 241 | op_proto) { |
| 242 | paddle::framework::KernelArgsNameMakerByOpProto maker(op_proto); |
| 243 | VLOG(10) << "Register `" << op_type << "` kernel signature:"; |
| 244 | phi::DefaultKernelSignatureMap::Instance().Insert( |
| 245 | op_type, maker.GetKernelSignature()); |
| 246 | } |
| 247 | } |
| 248 | }); |
| 249 | } |
| 250 | |
| 251 | static void SetAllocationForUninitializedDenseTensor( |
| 252 | phi::DenseTensor* dense_tensor, const phi::Place& place) { |