Add torch.backends.mkldnn.is_acl_available() method (#165678)

That tells whether or not PyTorch was compiled with Arm Compute Library
Pull Request resolved: https://github.com/pytorch/pytorch/pull/165678
Approved by: https://github.com/Skylion007, https://github.com/atalman, https://github.com/albanD
ghstack dependencies: #165583, #165584, #165676
This commit is contained in:
Nikita Shulga
2025-10-16 13:14:17 -07:00
committed by PyTorch MergeBot
parent 4d833f859b
commit ce109b3f79
3 changed files with 8 additions and 0 deletions

View File

@ -1442,6 +1442,7 @@ _has_cuda: _bool
_has_magma: _bool _has_magma: _bool
_has_xpu: _bool _has_xpu: _bool
_has_mkldnn: _bool _has_mkldnn: _bool
_has_mkldnn_acl: _bool
_has_cudnn: _bool _has_cudnn: _bool
_has_cusparselt: _bool _has_cusparselt: _bool
has_spectral: _bool has_spectral: _bool

View File

@ -19,6 +19,11 @@ def is_available():
return torch._C._has_mkldnn return torch._C._has_mkldnn
def is_acl_available():
r"""Return whether PyTorch is built with MKL-DNN + ACL support."""
return torch._C._has_mkldnn_acl
VERBOSE_OFF = 0 VERBOSE_OFF = 0
VERBOSE_ON = 1 VERBOSE_ON = 1
VERBOSE_ON_CREATION = 2 VERBOSE_ON_CREATION = 2

View File

@ -2701,6 +2701,8 @@ Call this whenever a new thread is created in order to propagate values from
ASSERT_TRUE(set_module_attr("_has_xpu", has_xpu)); ASSERT_TRUE(set_module_attr("_has_xpu", has_xpu));
ASSERT_TRUE( ASSERT_TRUE(
set_module_attr("_has_mkldnn", at::hasMKLDNN() ? Py_True : Py_False)); set_module_attr("_has_mkldnn", at::hasMKLDNN() ? Py_True : Py_False));
ASSERT_TRUE(set_module_attr(
"_has_mkldnn_acl", AT_MKLDNN_ACL_ENABLED() ? Py_True : Py_False));
ASSERT_TRUE(set_module_attr("_GLIBCXX_USE_CXX11_ABI", Py_True)); ASSERT_TRUE(set_module_attr("_GLIBCXX_USE_CXX11_ABI", Py_True));