openvino/docs/install_guides/movidius-programming-guide.md

2.5 KiB

Intel® Movidius™ VPUs Programming Guide for Use with Intel® Distribution of OpenVINO™ toolkit

See Also

The following section provides information on how to distribute a model across all 8 VPUs to maximize performance.

Programming a C++ Application for the Accelerator

Declare a Structure to Track Requests

The structure should hold:

  1. A pointer to an inference request.
  2. An ID to keep track of the request.

@snippet snippets/movidius-programming-guide.cpp part0

Declare a Vector of Requests

@snippet snippets/movidius-programming-guide.cpp part1

Declare and initialize 2 mutex variables:

  1. For each request
  2. For when all 8 requests are done

Declare a Conditional Variable

Conditional variable indicates when at most 8 requests are done at a time.

For inference requests, use the asynchronous IE API calls:

@snippet snippets/movidius-programming-guide.cpp part2

@snippet snippets/movidius-programming-guide.cpp part3

Create a Lambda Function

Lambda Function enables the parsing and display of results.

Inside the Lambda body use the completion callback function:

@snippet snippets/movidius-programming-guide.cpp part4

Additional Resources