@@ -16,6 +16,7 @@ if (NOT CMAKE_BUILD_TYPE)
1616endif ()
1717
1818# Platform options
19+ option (TORCHAO_BUILD_ATEN_OPS "Building torchao ops for ATen." ON )
1920option (TORCHAO_BUILD_EXECUTORCH_OPS "Building torchao ops for ExecuTorch." OFF )
2021option (TORCHAO_BUILD_MPS_OPS "Building torchao MPS ops" OFF )
2122option (TORCHAO_BUILD_CPU_AARCH64 "Build torchao's CPU aarch64 kernels" OFF )
@@ -32,7 +33,7 @@ if(NOT DEFINED TORCHAO_PARALLEL_BACKEND)
3233endif ()
3334
3435# Set default compiler options
35- add_compile_options ("-Wall" "-Werror" "-Wno-deprecated" )
36+ add_compile_options ("-Wall" "-Werror" "-Wno-deprecated" "-Wno-shorten-64-to-32" )
3637
3738include (CMakePrintHelpers)
3839message ("TORCHAO_INCLUDE_DIRS: ${TORCHAO_INCLUDE_DIRS} " )
@@ -68,6 +69,7 @@ if(TORCHAO_BUILD_CPU_AARCH64)
6869 if (TORCHAO_ENABLE_ARM_NEON_DOT)
6970 message (STATUS "Building with ARM NEON dot product support" )
7071 add_compile_definitions (TORCHAO_ENABLE_ARM_NEON_DOT)
72+ add_compile_options ("-march=armv8.4-a+dotprod" )
7173 endif ()
7274
7375 if (TORCHAO_ENABLE_ARM_I8MM)
@@ -89,26 +91,28 @@ add_subdirectory(ops/linear_8bit_act_xbit_weight)
8991add_subdirectory (ops/embedding_xbit)
9092
9193# ATen ops lib
92- add_library (torchao_ops_aten SHARED)
93- target_link_libraries (
94- torchao_ops_aten PRIVATE
95- torchao_ops_linear_8bit_act_xbit_weight_aten
96- torchao_ops_embedding_xbit_aten
97- )
98-
99- # Add MPS support if enabled
100- if (TORCHAO_BUILD_MPS_OPS)
101- message (STATUS "Building with MPS support" )
102- add_subdirectory (ops/mps)
103- target_link_libraries (torchao_ops_aten PRIVATE torchao_ops_mps_aten)
104- endif ()
94+ if (TORCHAO_BUILD_ATEN_OPS)
95+ add_library (torchao_ops_aten SHARED)
96+ target_link_libraries (
97+ torchao_ops_aten PRIVATE
98+ torchao_ops_linear_8bit_act_xbit_weight_aten
99+ torchao_ops_embedding_xbit_aten
100+ )
105101
106- # Install ATen targets
107- install (
108- TARGETS torchao_ops_aten
109- EXPORT _targets
110- DESTINATION lib
111- )
102+ # Add MPS support if enabled
103+ if (TORCHAO_BUILD_MPS_OPS)
104+ message (STATUS "Building with MPS support" )
105+ add_subdirectory (ops/mps)
106+ target_link_libraries (torchao_ops_aten PRIVATE torchao_ops_mps_aten)
107+ endif ()
108+
109+ # Install ATen targets
110+ install (
111+ TARGETS torchao_ops_aten
112+ EXPORT _targets
113+ DESTINATION lib
114+ )
115+ endif ()
112116
113117# Build executorch lib if enabled
114118if (TORCHAO_BUILD_EXECUTORCH_OPS)
0 commit comments