Class Definition - 2024.1 English

Vitis Libraries

Release Date
2024-08-06
Version
2024.1 English
template <DataMoverKind KIND,
          typename DATA_TYPE,
          int TILE_HEIGHT_MAX,
          int TILE_WIDTH_MAX,
          int AIE_VECTORIZATION_FACTOR,
          int CORES = 1,
          int PL_AXI_BITWIDTH = 32,
          bool USE_GMIO = false>
class xfcvDataMovers {
    //Tiler  constructor
    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    xfcvDataMovers(uint16_t overlapH, uint16_t overlapV);

    //Stitcher constructor
    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    xfcvDataMovers();

    //Meta data computation
    void compute_metadata(const cv::Size& img_size);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    std::array<uint16_t, 2> host2aie_nb(cv::Mat& img, xrtBufferHandle imgHndl = nullptr);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    std::array<uint16_t, 2> host2aie_nb(xrtBufferHandle imgHndl, const cv::Size& size);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    void aie2host_nb(cv::Mat& img, std::array<uint16_t, 2> tiles, xrtBufferHandle imgHndl = nullptr);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    void aie2host_nb(xrtBufferHandle imgHndl, const cv::Size& size, std::array<uint16_t, 2> tiles);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    void wait();

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    void wait();;
};

//GMIO class specialization
template <DataMoverKind KIND,
          typename DATA_TYPE,
          int TILE_HEIGHT_MAX,
          int TILE_WIDTH_MAX,
          int AIE_VECTORIZATION_FACTOR,
          int CORES>
class xfcvDataMovers<KIND, DATA_TYPE, TILE_HEIGHT_MAX, TILE_WIDTH_MAX, AIE_VECTORIZATION_FACTOR, CORES, 0, true> {
    //Tiler  constructor
    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    xfcvDataMovers(uint16_t overlapH, uint16_t overlapV);

    //Stitcher constructor
    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    xfcvDataMovers();

    //Compute meta data
    void compute_metadata(const cv::Size& img_size);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    std::array<uint16_t, 2> host2aie_nb(DATA_TYPE* img_data, const cv::Size& img_size, std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    std::array<uint16_t, 2> host2aie_nb(cv::Mat& img, std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    void aie2host_nb(DATA_TYPE* img_data, const cv::Size& img_size, std::array<uint16_t, 2> tiles, std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    void aie2host_nb(cv::Mat& img, std::array<uint16_t, 2> tiles, std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    std::array<uint16_t, 2> host2aie(cv::Mat& img, std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    std::array<uint16_t, 2> host2aie(DATA_TYPE* img_data, const cv::Size& img_size, std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    void aie2host(cv::Mat& img, std::array<uint16_t, 2> tiles, std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    void aie2host(DATA_TYPE* img_data, const cv::Size& img_size, std::array<uint16_t, 2> tiles, std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == TILER)>::type* = nullptr>
    void wait(std::array<std::string, CORES> portNames);

    template <DataMoverKind _t = KIND, typename std::enable_if<(_t == STITCHER)>::type* = nullptr>
    void wait(std::array<std::string, CORES> portNames);
};
Table 776 Table: xF::xfcvDataMovers Member Function Descriptions
Member Functions Description
xfcvDataMovers(uint16_t overlapH, uint16_t overlapV) Tiler constructor using horizontal and vertical overlap sizes
xfcvDataMovers() Stitcher constructor
host2aie_nb(cv::Mat& img, xrtBufferHandle imgHndl = nullptr) Host to AIE non blocking transaction using input image.
host2aie_nb(xrt::bo *imgHndl, const cv::Size& size) Host to AIE non blocking transaction using XRT allocated buffer handle and image size
aie2host_nb(cv::Mat& img, std::array<uint16_t, 2> tiles, xrtBufferHandle imgHndl = nullptr) AIE to Host non blocking transaction using input image and {tile rows, tile cols} array
aie2host_nb(xrt::bo *imgHndl, const cv::Size& size, std::array<uint16_t, 2> tiles) AIE to Host non blocking transaction using XRT allocated buffer handle and image size
wait() Wait for transaction to complete

Note

If the XRT mapped buffer handle is associated with an image, it can also be passed to imgHndl argument avoid copy.

Note

Parameter tiles can be obtained from the tiler data transfer API host2aie_nb.

Table 777 Table: xF::xfcvDataMovers Member Function Descriptions (GMIO Specialization)
Member Functions Description
xfcvDataMovers(uint16_t overlapH, uint16_t overlapV) Tiler constructor using horizontal and vertical overlap sizes
xfcvDataMovers() Stitcher constructor
host2aie_nb(cv::Mat& img, std::array<std::string, CORES> portNames) Host to AIE non blocking transaction using input image.
host2aie_nb(DATA_TYPE* img_data, const cv::Size& size, std::array<std::string, CORES> portNames) Host to AIE non blocking transaction using image data pointer and image size
aie2host_nb(cv::Mat& img, std::array<std::string, CORES> portNames) AIE to Host non blocking transaction using input image.
aie2host_nb(DATA_TYPE* img_data, const cv::Size& size, std::array<std::string, CORES> portNames) AIE to Host non blocking transaction using image data pointer and image size
host2aie(cv::Mat& img, std::array<std::string, CORES> portNames) Host to AIE blocking transaction using input image.
host2aie(DATA_TYPE* img_data, const cv::Size& size, std::array<std::string, CORES> portNames) Host to AIE blocking transaction using image data pointer and image size
aie2host(cv::Mat& img, std::array<std::string, CORES> portNames) AIE to Host blocking transaction using input image.
aie2host(DATA_TYPE* img_data, const cv::Size& size, std::array<std::string, CORES> portNames) AIE to Host blocking transaction using image data pointer and image size
wait() Wait for transaction to complete

Note

Argument portNames correspond GMIO port declared as part of platform specification