Copy data to the destination
buffer.
Prototype
void copy_to_host(size_t batch_idx, void* buf, size_t size, size_t offset);
Parameters
The following table lists thecopy_to_host
function arguments.
Type | Name | Description |
---|---|---|
size_t | batch_idx | The batch index |
void* | buf | Destination buffer start address |
size_t | size | Data size to be copied |
size_t | offset | The start offset to be copied |
Returns
None.
Usage
vart::TensorBuffer* tb_from;
vart::TensorBuffer* tb_to;
for (auto batch = 0u; batch < batch_size; ++batch) {
std::tie(data, tensor_size) = tb_to->data({(int)batch, 0, 0, 0});
tb_from->copy_to_host(batch, reinterpret_cast<void*>(data),
tensor_size, 0u);
}