1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// transcribe-backend.h - internal backend selection types.
//
// INTERNAL. C++17. Consumed only from other .cpp files inside src/.
// Not part of the public include/transcribe.h ABI.
//
// Rationale
// ---------
// The public API exposes a small `transcribe_backend_request` enum
// (auto|cpu|cpu_accel|metal|vulkan|cuda). Internally the library needs two related
// things that don't belong in the public header:
//
// 1. A typed classification of whatever ggml backend we actually
// landed on — `BackendKind`. This replaces string-matching on
// `ggml_backend_name()` scattered across model code (flash-attn
// policy, primary-backend-is-CPU policy, etc).
//
// 2. A small "backend plan" struct — `BackendPlan` — that holds the
// original request, the primary backend handle, its classified
// kind, and the full scheduler list in priority order. Every
// per-family load() resolves one of these, stores it on the
// model, and hands it to helpers that need to key off the
// primary backend (F16→F32 conv pointwise promotion, flash-attn
// default decisions).
//
// Keeping these out of transcribe-load-common.h means
// transcribe-flash-policy can include this header without dragging
// in the whole load scaffolding, and future consumers can ask
// "which backend is this?" without going through the loader.
;
typedef struct ggml_backend * ggml_backend_t;
;
typedef struct ggml_backend_device * ggml_backend_dev_t;
namespace transcribe // namespace transcribe