From: Ahmad Tameem Date: Thu, 12 Sep 2024 11:24:31 +0000 (+0500) Subject: riscv : modify Makefile and add a RISCV_VECT to print log info (llama/9442) X-Git-Tag: upstream/0.0.1642~373 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=8b12d8bc98fb9b11b478900a7084901d098559ea;p=pkg%2Fggml%2Fsources%2Fggml riscv : modify Makefile and add a RISCV_VECT to print log info (llama/9442) - Added ggml_cpu_has_riscv_v() in GGML to print system info in log - Modified Makefile to only use flag when cross compiling for RISC-V --- diff --git a/include/ggml.h b/include/ggml.h index 6f2f00a1..1e6b7bff 100644 --- a/include/ggml.h +++ b/include/ggml.h @@ -2533,6 +2533,7 @@ extern "C" { 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_riscv_v (void); GGML_API int ggml_cpu_has_sycl (void); GGML_API int ggml_cpu_has_rpc (void); GGML_API int ggml_cpu_has_vsx (void); diff --git a/src/ggml.c b/src/ggml.c index 8c37e20d..510f08fd 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -23494,6 +23494,14 @@ int ggml_cpu_has_arm_fma(void) { #endif } +int ggml_cpu_has_riscv_v(void) { +#if defined(__riscv_v_intrinsic) + return 1; +#else + return 0; +#endif +} + int ggml_cpu_has_metal(void) { #if defined(GGML_USE_METAL) return 1;