MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / copy_tensor_async_ints

Function copy_tensor_async_ints

src/llama-context.cpp:1445–1468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1443}
1444
1445static void copy_tensor_async_ints(
1446 const std::map<llama_seq_id, ggml_tensor*> & tensor_map,
1447 const buffer_view<llama_token> & sampled,
1448 const std::map<llama_seq_id, uint32_t> & seq_to_row,
1449 ggml_backend_sched_t sched) {
1450 if (!sampled.has_data()) {
1451 return;
1452 }
1453
1454 for (const auto & [seq_id, tensor] : tensor_map) {
1455 auto it = seq_to_row.find(seq_id);
1456 if (it == seq_to_row.end()) {
1457 continue;
1458 }
1459
1460 const uint32_t row = it->second;
1461 GGML_ASSERT(row < sampled.size);
1462
1463 GGML_ASSERT(ggml_is_contiguous(tensor) && "sampled tokens tensor must be contiguous for async copy");
1464
1465 ggml_backend_t backend = ggml_backend_sched_get_tensor_backend(sched, tensor);
1466 ggml_backend_tensor_get_async(backend, tensor, sampled.data + row, 0, sizeof(sampled.data[row]));
1467 }
1468}
1469
1470static void copy_tensor_async_floats(
1471 const std::map<llama_seq_id, ggml_tensor*> & tensor_map,

Callers 1

decodeMethod · 0.85

Calls 6

ggml_is_contiguousFunction · 0.85
has_dataMethod · 0.80
findMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected