File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -281,19 +281,15 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
281
281
endif ()
282
282
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64" )
283
283
message (STATUS "PowerPC detected" )
284
- execute_process (COMMAND bash -c "grep POWER10 /proc/cpuinfo | head -n 1" OUTPUT_VARIABLE POWER10_M )
285
- string (FIND "${POWER10_M} " "POWER10" substring_index )
286
- if (NOT DEFINED substring_index OR "${substring_index} " STREQUAL "" )
287
- set (substring_index -1 )
288
- endif ()
289
-
290
- if (${substring_index} GREATER_EQUAL 0 )
291
- list (APPEND ARCH_FLAGS -mcpu=power10 )
284
+ execute_process (COMMAND bash -c "grep POWER /proc/cpuinfo | head -n 1" OUTPUT_VARIABLE POWER_M )
285
+ if (${POWER_M} MATCHES "POWER10" )
286
+ list (APPEND ARCH_FLAGS -mcpu=power10 )
287
+ elseif (${POWER_M} MATCHES "POWER9" )
288
+ list (APPEND ARCH_FLAGS -mcpu=power9 )
292
289
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le" )
293
- list (APPEND ARCH_FLAGS -mcpu=powerpc64le )
290
+ list (APPEND ARCH_FLAGS -mcpu=powerpc64le -mtune=native )
294
291
else ()
295
- list (APPEND ARCH_FLAGS -mcpu=native -mtune=native )
296
- # TODO: Add targets for Power8/Power9 (Altivec/VSX) and Power10(MMA) and query for big endian systems (ppc64/le/be)
292
+ list (APPEND ARCH_FLAGS -mcpu=powerpc64 -mtune=native )
297
293
endif ()
298
294
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64" )
299
295
message (STATUS "loongarch64 detected" )
You can’t perform that action at this time.
0 commit comments