写入高速缓存后,刷新用于写入的高速缓存。如果
get_location()
返回 DEVICE_ONLY 或 HOST_VIRT,则无需操作。原型设计
void sync_for_write (uint64_t offset, size_t size) {};
参数
下表列出了sync_for_write
函数实参。
类型 | 名称 | 描述 |
---|---|---|
uint64_t | offset | 起始偏移地址 |
size_t | size | 数据大小 |
返回
无。
用法
for (auto& input : input_tensor_buffers) {
input->sync_for_write(0, input->get_tensor()->get_data_size() /
input->get_tensor()->get_shape()[0]);
}