Skip to content

Commit aea150e

Browse files
committed
Updated CMakeLists for torchao
1 parent 9fd5bac commit aea150e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,27 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
717717
target_compile_options(executor_runner PUBLIC ${_common_compile_options})
718718
endif()
719719

720+
if(EXECUTORCH_BUILD_TORCHAO)
721+
# Currently only enable this on Arm-based Macs
722+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
723+
set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
724+
set(TORCHAO_BUILD_CPU_AARCH64 ON)
725+
add_subdirectory(
726+
${CMAKE_CURRENT_SOURCE_DIR}/third-party/ao/torchao/experimental
727+
${CMAKE_CURRENT_BINARY_DIR}/third-party/ao/torchao/experimental
728+
)
729+
target_link_options_shared_lib(torchao_ops_executorch)
730+
list(APPEND link_libraries torchao_ops_executorch)
731+
if(EXECUTORCH_BUILD_MPS)
732+
add_subdirectory(
733+
${CMAKE_CURRENT_SOURCE_DIR}/third-party/ao/torchao/experimental/ops/mps
734+
${CMAKE_CURRENT_BINARY_DIR}/third-party/ao/torchao/experimental/ops/mps)
735+
target_link_options_shared_lib(torchao_ops_mps_executorch)
736+
list(APPEND link_libraries torchao_ops_mps_executorch)
737+
endif()
738+
endif()
739+
endif()
740+
720741
if(EXECUTORCH_BUILD_VULKAN)
721742
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/vulkan)
722743
endif()

0 commit comments

Comments
 (0)