Skip to content

Commit 397cf06

Browse files
authored
ggml : detect SSSE3 (ggml-org#1211)
* ggml : add ggml_cpu_has_ssse3 * whisper : show SSSE3 in system info * make : detect SSSE3 via cpuinfo
1 parent 2c74dc8 commit 397cf06

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
104104
ifneq (,$(findstring sse3,$(SSE3_M)))
105105
CFLAGS += -msse3
106106
endif
107+
108+
SSSE3_M := $(shell $(CPUINFO_CMD) | grep -m 1 "ssse3 ")
109+
ifneq (,$(findstring ssse3,$(SSSE3_M)))
110+
CFLAGS += -mssse3
111+
endif
107112
endif
108113
endif
109114
ifeq ($(UNAME_M),amd64)

ggml.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18721,6 +18721,14 @@ int ggml_cpu_has_sse3(void) {
1872118721
#endif
1872218722
}
1872318723

18724+
int ggml_cpu_has_ssse3(void) {
18725+
#if defined(__SSSE3__)
18726+
return 1;
18727+
#else
18728+
return 0;
18729+
#endif
18730+
}
18731+
1872418732
int ggml_cpu_has_vsx(void) {
1872518733
#if defined(__POWER9_VECTOR__)
1872618734
return 1;

ggml.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,7 @@ extern "C" {
15081508
GGML_API int ggml_cpu_has_clblast (void);
15091509
GGML_API int ggml_cpu_has_gpublas (void);
15101510
GGML_API int ggml_cpu_has_sse3 (void);
1511+
GGML_API int ggml_cpu_has_ssse3 (void);
15111512
GGML_API int ggml_cpu_has_vsx (void);
15121513

15131514
//

whisper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,6 +3480,7 @@ const char * whisper_print_system_info(void) {
34803480
s += "WASM_SIMD = " + std::to_string(ggml_cpu_has_wasm_simd()) + " | ";
34813481
s += "BLAS = " + std::to_string(ggml_cpu_has_blas()) + " | ";
34823482
s += "SSE3 = " + std::to_string(ggml_cpu_has_sse3()) + " | ";
3483+
s += "SSSE3 = " + std::to_string(ggml_cpu_has_ssse3()) + " | ";
34833484
s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | ";
34843485
s += "COREML = " + std::to_string(whisper_has_coreml()) + " | ";
34853486
s += "OPENVINO = " + std::to_string(whisper_has_openvino()) + " | ";

0 commit comments

Comments
 (0)