• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifdef USE_PYTORCH_QNNPACK
2 
3 #include <ATen/native/quantized/cpu/init_qnnpack.h>
4 #include <c10/util/Exception.h>
5 #include <pytorch_qnnpack.h>
6 
7 #include <c10/util/CallOnce.h>
8 
9 namespace at {
10 namespace native {
11 
initQNNPACK()12 void initQNNPACK() {
13   static c10::once_flag once;
14   static enum pytorch_qnnp_status qnnpackStatus =
15       pytorch_qnnp_status_uninitialized;
16   c10::call_once(once, []() { qnnpackStatus = pytorch_qnnp_initialize(); });
17   TORCH_CHECK(
18       qnnpackStatus == pytorch_qnnp_status_success,
19       "failed to initialize QNNPACK");
20 }
21 
22 } // namespace native
23 } // namespace at
24 
25 #endif
26