Download ggml/src/ggml-cpu/arch/riscv/cpu-feats.cpp from Brunobkr/llama.cpp_AlgMor24_github: direct link, hf CLI and curl.
- Browser
- Download file 807 Bytes
-
https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github/resolve/main/ggml/src/ggml-cpu/arch/riscv/cpu-feats.cpp
- Command line
-
hf download hf://datasets/Brunobkr/llama.cpp_AlgMor24_github/ggml/src/ggml-cpu/arch/riscv/cpu-feats.cpp
-
curl -L -o cpu-feats.cpp https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github/resolve/main/ggml/src/ggml-cpu/arch/riscv/cpu-feats.cpp
807 Bytes
| struct riscv64_features { | |
| bool has_rvv = false; | |
| riscv64_features() { | |
| struct riscv_hwprobe probe; | |
| probe.key = RISCV_HWPROBE_KEY_IMA_EXT_0; | |
| probe.value = 0; | |
| int ret = syscall(__NR_riscv_hwprobe, &probe, 1, 0, NULL, 0); | |
| if (0 == ret) { | |
| has_rvv = !!(probe.value & RISCV_HWPROBE_IMA_V); | |
| } | |
| } | |
| }; | |
| static int ggml_backend_cpu_riscv64_score() { | |
| int score = 1; | |
| riscv64_features rf; | |
| if (!rf.has_rvv) { return 0; } | |
| score += 1 << 1; | |
| return score; | |
| } | |
| GGML_BACKEND_DL_SCORE_IMPL(ggml_backend_cpu_riscv64_score) | |