cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
siliangz
Contributor
Contributor
322 Views
Registered: ‎01-07-2020

Vitis AI 1.3 API

Jump to solution

I am very new to VART APIs of Vitis AI 1.3. I am trying to use it in my application. 

I saw VART provides C++ APIs and Python APIs. But because of some limitations that I can't use either of them.

But I found <vart.h> and <xir.h> in the library. It seems like they provide a C-style interface. 

And I am able to use them to create the runner and get the input/output tensors.

But I have some issues getting the tensor buffer.

in the example application which uses C++ APIs. It uses Class CpuFlatTensorBuffer to create the tensor buffer.(like below)

/* in/out tensor refactory for batch inout/output */
    batchTensors.push_back(std::shared_ptr<xir::Tensor>(xir::Tensor::create(
        inputTensors[0]->get_name(), in_dims,
        xir::DataType{xir::DataType::FLOAT, sizeof(float) * 8u})));
    inputs.push_back(std::make_unique<CpuFlatTensorBuffer>(
        imageInputs, batchTensors.back().get()));
    batchTensors.push_back(std::shared_ptr<xir::Tensor>(xir::Tensor::create(
        outputTensors[0]->get_name(), out_dims,
        xir::DataType{xir::DataType::FLOAT, sizeof(float) * 8u})));
    outputs.push_back(std::make_unique<CpuFlatTensorBuffer>(
        FCResult, batchTensors.back().get()));

 But <vart.h> and <xir.h> don't provide the way to create tensor buffer.

I am wondering if <vart.h> and <xir.h> are good to use?

Does VART have C-style APIs? 

0 Kudos
1 Solution

Accepted Solutions
chaoz
Xilinx Employee
Xilinx Employee
141 Views
Registered: ‎09-14-2018

@siliangz I got confirmation that the C implementation of DPU runner should not be used directly. 

 

Chao
----------------------------------------------------------------------------------------------
Don't forget to "Accept as solution" or "Kudo" if it helps. Thanks!
----------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
6 Replies
chaoz
Xilinx Employee
Xilinx Employee
274 Views
Registered: ‎09-14-2018

Hi @siliangz 

There are only C++/Python APIs. Don't think there is C-style APIs for users.

----------------------------------------------------------------------------------------------
Don't forget to "Accept as solution" or "Kudo" if it helps. Thanks!
----------------------------------------------------------------------------------------------

0 Kudos
siliangz
Contributor
Contributor
226 Views
Registered: ‎01-07-2020

 Hi Chaoz,

I found this file in the repo.

And this test file as well.

Is that a valid API to use? According to the test file, it seems valid.

 

 

0 Kudos
chaoz
Xilinx Employee
Xilinx Employee
196 Views
Registered: ‎09-14-2018

@siliangz 

Per my understanding that c implementation of DPU runner is for python ctypes.
Offically we only have C++ and python API. 
For your concern, I will double check and get back.

Thanks,
Chao
----------------------------------------------------------------------------------------------
Don't forget to "Accept as solution" or "Kudo" if it helps. Thanks!
----------------------------------------------------------------------------------------------

0 Kudos
siliangz
Contributor
Contributor
188 Views
Registered: ‎01-07-2020

@chaoz 

Thank you so much for your help.

0 Kudos
chaoz
Xilinx Employee
Xilinx Employee
142 Views
Registered: ‎09-14-2018

@siliangz I got confirmation that the C implementation of DPU runner should not be used directly. 

 

Chao
----------------------------------------------------------------------------------------------
Don't forget to "Accept as solution" or "Kudo" if it helps. Thanks!
----------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
siliangz
Contributor
Contributor
120 Views
Registered: ‎01-07-2020

@chaoz Thank you so much for your reply.

0 Kudos