Spaces:
Running
Running
Przemysław Pawełczyk
commited on
ggml : detect SSSE3 (#1211)
Browse files* ggml : add ggml_cpu_has_ssse3
* whisper : show SSSE3 in system info
* make : detect SSSE3 via cpuinfo
Makefile
CHANGED
|
@@ -104,6 +104,11 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
|
|
| 104 |
ifneq (,$(findstring sse3,$(SSE3_M)))
|
| 105 |
CFLAGS += -msse3
|
| 106 |
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
endif
|
| 108 |
endif
|
| 109 |
ifeq ($(UNAME_M),amd64)
|
|
|
|
| 104 |
ifneq (,$(findstring sse3,$(SSE3_M)))
|
| 105 |
CFLAGS += -msse3
|
| 106 |
endif
|
| 107 |
+
|
| 108 |
+
SSSE3_M := $(shell $(CPUINFO_CMD) | grep -m 1 "ssse3 ")
|
| 109 |
+
ifneq (,$(findstring ssse3,$(SSSE3_M)))
|
| 110 |
+
CFLAGS += -mssse3
|
| 111 |
+
endif
|
| 112 |
endif
|
| 113 |
endif
|
| 114 |
ifeq ($(UNAME_M),amd64)
|
ggml.c
CHANGED
|
@@ -18721,6 +18721,14 @@ int ggml_cpu_has_sse3(void) {
|
|
| 18721 |
#endif
|
| 18722 |
}
|
| 18723 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18724 |
int ggml_cpu_has_vsx(void) {
|
| 18725 |
#if defined(__POWER9_VECTOR__)
|
| 18726 |
return 1;
|
|
|
|
| 18721 |
#endif
|
| 18722 |
}
|
| 18723 |
|
| 18724 |
+
int ggml_cpu_has_ssse3(void) {
|
| 18725 |
+
#if defined(__SSSE3__)
|
| 18726 |
+
return 1;
|
| 18727 |
+
#else
|
| 18728 |
+
return 0;
|
| 18729 |
+
#endif
|
| 18730 |
+
}
|
| 18731 |
+
|
| 18732 |
int ggml_cpu_has_vsx(void) {
|
| 18733 |
#if defined(__POWER9_VECTOR__)
|
| 18734 |
return 1;
|
ggml.h
CHANGED
|
@@ -1508,6 +1508,7 @@ extern "C" {
|
|
| 1508 |
GGML_API int ggml_cpu_has_clblast (void);
|
| 1509 |
GGML_API int ggml_cpu_has_gpublas (void);
|
| 1510 |
GGML_API int ggml_cpu_has_sse3 (void);
|
|
|
|
| 1511 |
GGML_API int ggml_cpu_has_vsx (void);
|
| 1512 |
|
| 1513 |
//
|
|
|
|
| 1508 |
GGML_API int ggml_cpu_has_clblast (void);
|
| 1509 |
GGML_API int ggml_cpu_has_gpublas (void);
|
| 1510 |
GGML_API int ggml_cpu_has_sse3 (void);
|
| 1511 |
+
GGML_API int ggml_cpu_has_ssse3 (void);
|
| 1512 |
GGML_API int ggml_cpu_has_vsx (void);
|
| 1513 |
|
| 1514 |
//
|
whisper.cpp
CHANGED
|
@@ -3480,6 +3480,7 @@ const char * whisper_print_system_info(void) {
|
|
| 3480 |
s += "WASM_SIMD = " + std::to_string(ggml_cpu_has_wasm_simd()) + " | ";
|
| 3481 |
s += "BLAS = " + std::to_string(ggml_cpu_has_blas()) + " | ";
|
| 3482 |
s += "SSE3 = " + std::to_string(ggml_cpu_has_sse3()) + " | ";
|
|
|
|
| 3483 |
s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | ";
|
| 3484 |
s += "COREML = " + std::to_string(whisper_has_coreml()) + " | ";
|
| 3485 |
s += "OPENVINO = " + std::to_string(whisper_has_openvino()) + " | ";
|
|
|
|
| 3480 |
s += "WASM_SIMD = " + std::to_string(ggml_cpu_has_wasm_simd()) + " | ";
|
| 3481 |
s += "BLAS = " + std::to_string(ggml_cpu_has_blas()) + " | ";
|
| 3482 |
s += "SSE3 = " + std::to_string(ggml_cpu_has_sse3()) + " | ";
|
| 3483 |
+
s += "SSSE3 = " + std::to_string(ggml_cpu_has_ssse3()) + " | ";
|
| 3484 |
s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | ";
|
| 3485 |
s += "COREML = " + std::to_string(whisper_has_coreml()) + " | ";
|
| 3486 |
s += "OPENVINO = " + std::to_string(whisper_has_openvino()) + " | ";
|