目录

Zero Memory Copy

Overview

Zero memory copy is applicable when GPU texture data or model input data already exists in the ION memory. It allows the ION memory where data is stored to be encapsulated into input and output tensors for direct inference, without data copy from the input and output tensors. This helps save the memory and make inference more efficient.

How to Use

In zero copy scenarios, after the model is loaded, use OH_NNTensor_CreateWithFd to encapsulate the ION memory into input_tensor and output_tensor for inference.

If size is the model output size, you are advised to allocate the ION memory of .