• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <ATen/detail/IPUHooksInterface.h>
2 
3 #include <c10/util/CallOnce.h>
4 
5 namespace at {
6 namespace detail {
7 
getIPUHooks()8 const IPUHooksInterface& getIPUHooks() {
9   static std::unique_ptr<IPUHooksInterface> hooks;
10   static c10::once_flag once;
11   c10::call_once(once, [] {
12     hooks = IPUHooksRegistry()->Create("IPUHooks", IPUHooksArgs{});
13     if (!hooks) {
14       hooks = std::make_unique<IPUHooksInterface>();
15     }
16   });
17   return *hooks;
18 }
19 
20 } // namespace detail
21 
22 C10_DEFINE_REGISTRY(IPUHooksRegistry, IPUHooksInterface, IPUHooksArgs)
23 
24 } // namespace at
25