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