Skip to content

Commit f2ceec4

Browse files
committed
1 parent 774f778 commit f2ceec4

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/ggml-cpu/CMakeLists.txt

+12-8
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,19 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
289289
endif()
290290
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64")
291291
message(STATUS "PowerPC detected")
292-
execute_process(COMMAND bash -c "grep POWER /proc/cpuinfo | head -n 1" OUTPUT_VARIABLE POWER_M)
293-
if (${POWER_M} MATCHES "POWER10")
294-
list(APPEND ARCH_FLAGS -mcpu=power10)
295-
elseif (${POWER_M} MATCHES "POWER9")
296-
list(APPEND ARCH_FLAGS -mcpu=power9)
297-
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le")
298-
list(APPEND ARCH_FLAGS -mcpu=powerpc64le -mtune=native)
292+
if (GGML_POWERPC_CPUTYPE)
293+
list(APPEND ARCH_FLAGS -mcpu=${GGML_POWERPC_CPUTYPE})
299294
else()
300-
list(APPEND ARCH_FLAGS -mcpu=powerpc64 -mtune=native)
295+
execute_process(COMMAND bash -c "grep POWER /proc/cpuinfo | head -n 1" OUTPUT_VARIABLE POWER_M)
296+
if (${POWER_M} MATCHES "POWER10")
297+
list(APPEND ARCH_FLAGS -mcpu=power10)
298+
elseif (${POWER_M} MATCHES "POWER9")
299+
list(APPEND ARCH_FLAGS -mcpu=power9)
300+
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le")
301+
list(APPEND ARCH_FLAGS -mcpu=powerpc64le -mtune=native)
302+
else()
303+
list(APPEND ARCH_FLAGS -mcpu=powerpc64 -mtune=native)
304+
endif()
301305
endif()
302306
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64")
303307
message(STATUS "loongarch64 detected")

0 commit comments

Comments
 (0)