xref: /aosp_15_r20/external/pytorch/aten/src/ATen/native/verbose_wrapper.cpp (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #include <ATen/Config.h>
2 
3 #if AT_MKL_ENABLED()
4 #include <mkl.h>
5 #endif
6 
7 #if AT_MKLDNN_ENABLED()
8 #include <ATen/native/mkldnn/MKLDNNCommon.h>
9 #endif
10 #include <ATen/native/verbose_wrapper.h>
11 
12 namespace torch::verbose {
13 
_mkl_set_verbose(int enable)14 int _mkl_set_verbose(int enable [[maybe_unused]]) {
15 #if AT_MKL_ENABLED()
16   int ret = mkl_verbose(enable);
17 
18   // Return 0 when the mkl_verbose function fails to set verbose level.
19   // Return 1 on success.
20   return ret != -1;
21 #else
22   // Return 0 since oneMKL is not enabled.
23   return 0;
24 #endif
25 }
26 
_mkldnn_set_verbose(int level)27 int _mkldnn_set_verbose(int level [[maybe_unused]]) {
28 #if AT_MKLDNN_ENABLED()
29   return at::native::set_verbose(level);
30 #else
31   return 0;
32 #endif
33 }
34 
35 } // namespace torch::verbose
36