Files
pytorch/cmake/Modules/FindACL.cmake
Fadi Arafeh d1f21d8ec3 Enable Direct Use of Arm Compute Library (ACL) in ATen (#148584)
ACL is already built with PyTorch as a shared library when USE_MKLDNN_ACL is set.
Currently, it is only used indirectly in ATen via oneDNN for AArch64 targets. However there are cases where it makes sense to utilize ACL directly without  oneDNN as an intermediary - e.g. quantization. See #145942, #147337, #146620.
This patch enables such use cases by exposing ACL to ATen

Pull Request resolved: https://github.com/pytorch/pytorch/pull/148584
Approved by: https://github.com/malfet
2025-03-10 18:29:51 +00:00

63 lines
1.4 KiB
CMake

# Copied from: https://github.com/oneapi-src/oneDNN/blob/main/cmake/FindACL.cmake
# ----------
# FindACL
# ----------
#
# Finds the Arm Compute Library
# https://arm-software.github.io/ComputeLibrary/latest/
#
# This module defines the following variables:
#
# ACL_FOUND - True if ACL was found
# ACL_INCLUDE_DIRS - include directories for ACL
# ACL_LIBRARIES - link against this library to use ACL
#
# The module will also define two cache variables:
#
# ACL_INCLUDE_DIR - the ACL include directory
# ACL_LIBRARY - the path to the ACL library
#
# Use ACL_ROOT_DIR environment variable to find the library and headers
find_path(ACL_INCLUDE_DIR
NAMES arm_compute/graph.h
PATHS ENV ACL_ROOT_DIR
)
find_library(ACL_LIBRARY
NAMES arm_compute
PATHS ENV ACL_ROOT_DIR
PATH_SUFFIXES lib build
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ACL DEFAULT_MSG
ACL_INCLUDE_DIR
ACL_LIBRARY
)
mark_as_advanced(
ACL_LIBRARY
ACL_INCLUDE_DIR
)
# Find the extra libraries and include dirs
if(ACL_FOUND)
find_path(ACL_EXTRA_INCLUDE_DIR
NAMES half/half.hpp
PATHS ENV ACL_ROOT_DIR
PATH_SUFFIXES include
)
find_library(ACL_GRAPH_LIBRARY
NAMES arm_compute_graph
PATHS ENV ACL_ROOT_DIR
PATH_SUFFIXES lib build
)
list(APPEND ACL_INCLUDE_DIRS
${ACL_INCLUDE_DIR} ${ACL_EXTRA_INCLUDE_DIR})
list(APPEND ACL_LIBRARIES
${ACL_LIBRARY} ${ACL_GRAPH_LIBRARY})
endif()