okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-own-1a (451f3e8a6): own-stack phase 1A and cleanup 5.4; the ggml/MMQ sources the engines build are vendored in third_party/strata-ggml (frozen at the pin, manifest and check), default engine builds need no llama.cpp download, the TQ overlay is plain files, CMakeLists.txt is split into cmake/backends/*; every engine unchanged (CUDA/HIP gfx1201/gfx1151/SYCL device code identical, SYCL 22/22 checksums, Metal 104/105 objects with only __TIME__ differing, CUDA tokens 26/26); release scripts still pass -DSTRATA_GGML_DIR (owner go 11-08)508e6999a

main
1.2 KiB36 linesraw
1#include "traits.h"
2
3#include "ggml-backend-impl.h"
4#include "ggml-backend.h"
5
6namespace ggml::cpu {
7tensor_traits::~tensor_traits() {}
8
9extra_buffer_type::~extra_buffer_type() {}
10}  // namespace ggml::cpu
11
12bool ggml_cpu_extra_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * op) {
13    for (auto extra : ggml_backend_cpu_get_extra_buffer_types()) {
14        if (extra && extra->context) {
15            auto buf_extra     = (ggml::cpu::extra_buffer_type *) extra->context;
16            auto tensor_traits = buf_extra->get_tensor_traits(op);
17            if (tensor_traits && tensor_traits->compute_forward(params, op)) {
18                return true;
19            }
20        }
21    }
22    return false;
23}
24
25bool ggml_cpu_extra_work_size(int n_threads, const struct ggml_tensor * op, size_t * size) {
26    for (auto extra : ggml_backend_cpu_get_extra_buffer_types()) {
27        if (extra && extra->context) {
28            auto buf_extra     = (ggml::cpu::extra_buffer_type *) extra->context;
29            auto tensor_traits = buf_extra->get_tensor_traits(op);
30            if (tensor_traits && tensor_traits->work_size(n_threads, op, *size)) {
31                return true;
32            }
33        }
34    }
35    return false;
36}