From 73609099289cfb2baed7cefdfe6f06990ba815de Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Sun, 27 Aug 2023 02:25:13 +0200 Subject: [PATCH 1/3] ggml : add ggml_cpu_has_ssse3 --- ggml.c | 8 ++++++++ ggml.h | 1 + 2 files changed, 9 insertions(+) diff --git a/ggml.c b/ggml.c index 5149a157235..70bbbad4d0d 100644 --- a/ggml.c +++ b/ggml.c @@ -18721,6 +18721,14 @@ int ggml_cpu_has_sse3(void) { #endif } +int ggml_cpu_has_ssse3(void) { +#if defined(__SSSE3__) + return 1; +#else + return 0; +#endif +} + int ggml_cpu_has_vsx(void) { #if defined(__POWER9_VECTOR__) return 1; diff --git a/ggml.h b/ggml.h index 0af96c76b6d..29884166edc 100644 --- a/ggml.h +++ b/ggml.h @@ -1508,6 +1508,7 @@ extern "C" { GGML_API int ggml_cpu_has_clblast (void); GGML_API int ggml_cpu_has_gpublas (void); GGML_API int ggml_cpu_has_sse3 (void); + GGML_API int ggml_cpu_has_ssse3 (void); GGML_API int ggml_cpu_has_vsx (void); // From 6ad6f6bce8412f743cf0efde45428bf69af0f8c4 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Sun, 27 Aug 2023 02:26:32 +0200 Subject: [PATCH 2/3] whisper : show SSSE3 in system info --- whisper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/whisper.cpp b/whisper.cpp index eb8dff195d7..93a5215081f 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -3450,6 +3450,7 @@ const char * whisper_print_system_info(void) { s += "WASM_SIMD = " + std::to_string(ggml_cpu_has_wasm_simd()) + " | "; s += "BLAS = " + std::to_string(ggml_cpu_has_blas()) + " | "; s += "SSE3 = " + std::to_string(ggml_cpu_has_sse3()) + " | "; + s += "SSSE3 = " + std::to_string(ggml_cpu_has_ssse3()) + " | "; s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | "; s += "COREML = " + std::to_string(whisper_has_coreml()) + " | "; s += "OPENVINO = " + std::to_string(whisper_has_openvino()) + " | "; From c97f42d3a4cb249b71b19429dad67435aa5af5d5 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Sun, 27 Aug 2023 02:27:43 +0200 Subject: [PATCH 3/3] make : detect SSSE3 via cpuinfo --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 49530031ddb..4dea7d324ef 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,11 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686)) ifneq (,$(findstring sse3,$(SSE3_M))) CFLAGS += -msse3 endif + + SSSE3_M := $(shell $(CPUINFO_CMD) | grep -m 1 "ssse3 ") + ifneq (,$(findstring ssse3,$(SSSE3_M))) + CFLAGS += -mssse3 + endif endif endif ifeq ($(UNAME_M),amd64)