MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / prepare_host_graph_plan

Function prepare_host_graph_plan

src/framework/core/backend.cpp:399–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397 std::vector<ggml_fp16_t> fp16_values(count);
398 ggml_fp32_to_fp16_row(values, fp16_values.data(), static_cast<int64_t>(count));
399 ggml_backend_tensor_set(tensor.tensor, fp16_values.data(), 0, count * sizeof(ggml_fp16_t));
400}
401
402void write_tensor_f16(const TensorValue & tensor, const std::vector<float> & values) {
403 write_tensor_f16(tensor, values.data(), values.size());
404}
405
406void write_tensor_bf16(const TensorValue & tensor, const float * values, size_t count) {
407 if (tensor.type != GGML_TYPE_BF16) {
408 throw std::runtime_error("write_tensor_bf16 requires GGML_TYPE_BF16 tensor");
409 }
410 if (tensor.shape.num_elements() != static_cast<int64_t>(count)) {

Calls 7

ggml_graph_planFunction · 0.85
maxFunction · 0.85
resetMethod · 0.45
uses_host_graph_planMethod · 0.45
resizeMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected