char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
0d8831543
char/aliceai-t5-moe
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 ) { 13for (auto extra :ggml_backend_cpu_get_extra_buffer_types ()) { 14if (extra && extra -> context ) { 15auto buf_extra = (ggml::cpu::extra_buffer_type * )extra -> context ; 16auto tensor_traits = buf_extra -> get_tensor_traits (op ); 17if (tensor_traits && tensor_traits -> compute_forward (params ,op )) { 18return true; 19 } 20 } 21 } 22return false; 23} 24 25bool ggml_cpu_extra_work_size (int n_threads ,const struct ggml_tensor * op ,size_t * size ) { 26for (auto extra :ggml_backend_cpu_get_extra_buffer_types ()) { 27if (extra && extra -> context ) { 28auto buf_extra = (ggml::cpu::extra_buffer_type * )extra -> context ; 29auto tensor_traits = buf_extra -> get_tensor_traits (op ); 30if (tensor_traits && tensor_traits -> work_size (n_threads ,op ,* size )) { 31return true; 32 } 33 } 34 } 35return false; 36}