ggml: code cleanup

Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
This commit is contained in:
Aaron Teo
2025-10-26 13:37:26 +08:00
parent decb5cc06e
commit c376979647
2 changed files with 4 additions and 7 deletions

View File

@@ -510,7 +510,7 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
list(APPEND ARCH_DEFINITIONS GGML_VXE)
endif()
ggml_add_cpu_backend_features(${GGML_CPU_NAME} s390 ${ARCH_DEFINITIONS})
ggml_add_cpu_backend_features(${GGML_CPU_NAME} s390x ${ARCH_DEFINITIONS})
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "wasm")
message(STATUS "Wasm detected")
list (APPEND GGML_CPU_SOURCES ggml-cpu/arch/wasm/quants.c)

View File

@@ -1,4 +1,3 @@
#include "ggml-impl.h"
#include "ggml-backend-impl.h"
#if defined(__s390x__)
@@ -23,15 +22,13 @@ struct s390x_features {
bool has_nnpa = false;
s390x_features() {
uint32_t hwcap = getauxval(AT_HWCAP);
uint32_t hwcap2 = getauxval(AT_HWCAP2);
uint32_t hwcap = getauxval(AT_HWCAP);
// NOTE: use hwcap2 with DFLT for z17 and later
// uint32_t hwcap2 = getauxval(AT_HWCAP2);
has_vxe = !!(hwcap & HWCAP_VXRS_EXT);
has_vxe2 = !!(hwcap & HWCAP_VXRS_EXT2);
has_nnpa = !!(hwcap & HWCAP_NNPA);
GGML_LOG_INFO("s390x features detected: VXE=%d, VXE2=%d, NNPA=%d",
has_vxe, has_vxe2, has_nnpa);
}
};