mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-23 23:18:13 +02:00
Rebaptise AJEAN en Loki (fork, lignée conservée)
- module github.com/R0m1k3/Loki, cmd/loki, internal/loki (package loki) - LOKI_HOME, LOKI_MODEL_DIRS, LOKI_SERVICE, LOKI_DL_CONNS ; /etc/loki ; units loki-engine / loki-ui ; binaire et aide CLI - updateRepo pointe sur R0m1k3/Loki (l'auto-update ne tirera plus les binaires AJEAN amont) Conservé à l'identique : le domaine ajean.link (service de tunnel amont), les littéraux de migration 0.7.x (migrate_07.go), RELEASE_NOTES.md et LICENSE (historique et licence de l'amont). go build/vet/test : verts.
This commit is contained in:
157 files changed
+928
-928
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package loki
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Le seul cas où compiler vaut mieux que télécharger : Linux + CUDA. llama.cpp
|
||||
// ne publie pas de binaire CUDA pour Linux (seul Windows a bin-win-cuda-*), donc
|
||||
// le précompilé y retombe sur Vulkan. Ailleurs, l'asset officiel exploite bien
|
||||
// la machine (CUDA sous Windows, Metal sous macOS, ROCm sous Linux).
|
||||
func TestRecommendedMode(t *testing.T) {
|
||||
cases := []struct {
|
||||
backend string
|
||||
wantMode string
|
||||
wantWhy bool
|
||||
}{
|
||||
{"cuda", "opt", true}, // le cas qui motive toute la fonction
|
||||
{"rocm", "fast", false},
|
||||
{"vulkan", "fast", false},
|
||||
{"cpu", "fast", false},
|
||||
{"metal", "fast", false},
|
||||
}
|
||||
for _, c := range cases {
|
||||
got := recommendedMode(c.backend)
|
||||
wantMode, wantWhy := c.wantMode, c.wantWhy
|
||||
// La règle ne vise que Linux : sur les autres OS le précompilé reste
|
||||
// conseillé même avec CUDA détecté.
|
||||
if runtime.GOOS != "linux" {
|
||||
wantMode, wantWhy = "fast", false
|
||||
}
|
||||
if got["mode"] != wantMode {
|
||||
t.Errorf("backend %q sur %s : mode = %v, attendu %q", c.backend, runtime.GOOS, got["mode"], wantMode)
|
||||
}
|
||||
if hasWhy := got["why"] != ""; hasWhy != wantWhy {
|
||||
t.Errorf("backend %q sur %s : why non vide = %v, attendu %v", c.backend, runtime.GOOS, hasWhy, wantWhy)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user