cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
keanfj421ss
Participant
Participant
305 Views
Registered: ‎07-31-2020

Using std::vector in Kernel Code instead of Array

All the examples on the Vitis_Accel_Examples repository uses std::vector on host code, and store these in cl::buffer and then on the kernel they are stored in arrays with #pragma HLS array partition.

Is it possible to std::vector in kernel part too ? Is there any pragma to partition vectors ?

 

Thank you

0 Kudos
2 Replies
bchebrol
Xilinx Employee
Xilinx Employee
246 Views
Registered: ‎06-04-2018

Hi @keanfj421ss ,

We do have the vector support in kernel code which was supported in 2020.2 release.

The Vitis™ HLS library provides the reference implementation for the hls::vector<T, N> type which represent a single-instruction multiple-data (SIMD) vector of N elements of type T:

  • T can be a user-defined type which must provide common arithmetic operations.
  • N must be a positive integer.
  • The best performance is achieved when both the bit-width of T and N are integer powers of 2.

For more details please refer the following UG1399 document : 

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_2/ug1399-vitis-hls.pdf

Thanks,

Vishnu

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

keanfj421ss
Participant
Participant
229 Views
Registered: ‎07-31-2020

Thank you for the answer,

one problem I have both Vitis 2020.1 and Vitis 2020.2 versions but on both of them it says error the hls_vector.h not found to include.

Do I need to download this file ? I couldn't find it on google search

 

0 Kudos