diff --git a/ggml/include/ggml.h b/ggml/include/ggml.h
index 6f2f00a1..1e6b7bff 100644
--- a/ggml/include/ggml.h
+++ b/ggml/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/ggml/src/ggml.c b/ggml/src/ggml.c
index 8c37e20d..510f08fd 100644
--- a/ggml/src/ggml.c
+++ b/ggml/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;