Skip to content

Commit 64bcf4c

Browse files
authored
Guard cpuinfo target (#1922)
init
1 parent ddb7f83 commit 64bcf4c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

torchao/experimental/ops/linear_8bit_act_xbit_weight/CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ cmake_minimum_required(VERSION 3.19)
88

99
include(${CMAKE_CURRENT_SOURCE_DIR}/../../Utils.cmake)
1010

11-
# For some reason cpuinfo package has unused functions/variables
12-
# TODO (T215533422): fix upstream
13-
add_compile_options(-Wno-unused-function -Wno-unused-variable)
14-
include(FetchContent)
15-
FetchContent_Declare(cpuinfo
16-
GIT_REPOSITORY https://github.com/pytorch/cpuinfo.git
17-
GIT_TAG aaac07ee499895770c89163ce0920ef8bb41ed23)
18-
FetchContent_MakeAvailable(
19-
cpuinfo)
20-
11+
if (NOT TARGET cpuinfo)
12+
# For some reason cpuinfo package has unused functions/variables
13+
# TODO (T215533422): fix upstream
14+
add_compile_options(-Wno-unused-function -Wno-unused-variable)
15+
include(FetchContent)
16+
FetchContent_Declare(cpuinfo
17+
GIT_REPOSITORY https://github.com/pytorch/cpuinfo.git
18+
GIT_TAG aaac07ee499895770c89163ce0920ef8bb41ed23)
19+
FetchContent_MakeAvailable(
20+
cpuinfo)
21+
endif()
2122

2223
find_package(Torch REQUIRED)
2324
add_library(torchao_ops_linear_8bit_act_xbit_weight_aten OBJECT

0 commit comments

Comments
 (0)