/* eg_cosine_batch_strategy_cpu.c — plain-C, zero-dependency universal * fallback strategy. Always returns false / unavailable. Direct descendant * of PR #114's eg_metal_cosine_stub.c, generalized from "the Metal stub" to * "the strategy vtable's universal fallback entry" now that multiple real * strategies can exist. * * Always compiled, on every platform. On Darwin builds it is the last-resort * strategy the factory falls back to when neither ggml nor the hand-rolled * Metal strategy is available at runtime (no device, compile failure, ...). * On non-Darwin builds it is the ONLY strategy compiled in at all — no * Objective-C, no Metal frameworks, no ggml/Metal backend plugin — so * eg_cosine_batch()/eg_cosine_batch_multi() always return false there and * every call site's existing CPU fallback runs unconditionally, exactly as * before this PR. */ #include "eg_cosine_batch_strategy.h" static bool cpu_available(void) { return false; } static bool cpu_batch(const float* query, int32_t qdim, const float* const* node_ptrs, const int32_t* node_dims, int32_t n, double* out_scores) { (void)query; (void)qdim; (void)node_ptrs; (void)node_dims; (void)n; (void)out_scores; return false; } static bool cpu_batch_multi(const float* queries, int32_t qdim, int32_t nq, const float* const* node_ptrs, const int32_t* node_dims, int32_t n, double* out_scores) { (void)queries; (void)qdim; (void)nq; (void)node_ptrs; (void)node_dims; (void)n; (void)out_scores; return false; } static const EgCosineBatchStrategy g_cpu_strategy = { .name = "cpu-fallback", .available = cpu_available, .batch = cpu_batch, .batch_multi = cpu_batch_multi, }; const EgCosineBatchStrategy* eg_cosine_batch_strategy_cpu(void) { return &g_cpu_strategy; }