Programming Interface - 1.1 English

Vitis AI User Guide (UG1414)

Document ID
Release Date
1.1 English

Vitis AI advanced C++/Python APIs are introduced to smoothen the deep learning application development for edge DPU. For detailed description of each API, refer to Advanced Programming Interface.

Python programming APIs are available to facilitate the quick network model development by reusing the pre-processing and post-processing Python code developed during the model training phase. Refer to Advanced Programming Interface for more information. Exchange of data between CPU and the DPU when programming with Vitis AI for DPU is common. For example, data pre-processed by CPU is fed to DPU for process, and the output produced by DPU might need to be accessed by CPU for further post-processing. To handle this type of operation, Vitis AI provides a set of APIs to make it easy for data exchange between CPU and DPU. Some of them are shown below. The usage of these APIs are identical to deploy network models for Caffe and TensorFlow.

Vitis AI offers the following APIs to set input tensor for the computation layer or node:

  • dpuSetInputTensor()
  • dpuSetInputTensorInCHWInt8()
  • dpuSetInputTensorInCHWFP32()
  • dpuSetInputTensorInHWCInt8()
  • dpuSetInputTensorInHWCFP32()

Vitis AI offers the following APIs to get output tensor from the computation layer or node:

  • dpuGetOutputTensor()
  • dpuGetOutputTensorInCHWInt8()
  • dpuGetOutputTensorInCHWFP32()
  • dpuGetOutputTensorInHWCInt8()
  • dpuGetOutputTensorInHWCFP32()

Vitis AI provides the following APIs to get the starting address, size, quantization factor, and shape info for DPU input tensor and output tensor. With such information, the users can freely implement pre-processing source code to feed signed 8-bit integer data into DPU or implement post-processing source code to get DPU output data.

  • dpuGetTensorAddress()
  • dpuGetTensorSize()
  • dpuGetTensorScale()
  • dpuGetTensorHeight()
  • dpuGetTensorWidth()
  • dpuGetTensorChannel()