cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
469 Views
Registered: ‎03-11-2019

Use of HLS/SDS pragmas in OpenCL kernels

Jump to solution

Dear all,

I am exploring some OpenCL kernels using the SDSoC in a Zynq zcu102 platform. I know this board is for SDAccel, but since I'm using OpenCL I believe that my question still applies here.

 

I am trying to understand how certain optimisations are affecting my codes, thus I wanted to have more control in the HLS generation. I know that the __attribute__(()) is quite useful for defining for example loop unrolling. However, not all HLS/SDS pragmas are available in the __attribute__(()) form. For example, I cannot activate/deactivate loop flatten for a certain loop using the pragmas (as HLS/SDS pragmas are ignored when OpenCL is used, as mentioned in https://forums.xilinx.com/t5/SDAccel/Vivado-HLS-does-not-infer-loop-max-and-min-trip-count-based-on/m-p/879815/highlight/true#M2373).

 

Is there any way that I could use the pragmas in OpenCL or at least define them in another way? For the loop_flattening for example, I tried to use the set_directive_loop_flatten in a tcl script and then added the "--xp prop:solution.hls_pre_tcl=directives.tcl" arguments to the xocc command line, but I saw no effect in the generated verilog, nor any report message about my changes. The *_csynth.rpt also shows no difference in the latency estimations.

 

Edit: I also compared using __attribute__((opencl_unroll_hint)) against set_directive_loop_unroll. The first I can successfuly see the loop being unrolled (as expected), while the directive makes no difference at all.

 

Thank you very much!

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
375 Views
Registered: ‎03-24-2010

回复: Use of HLS/SDS pragmas in OpenCL kernels

Jump to solution

HLS pragmas are not supported in opencl kernel.

If you want to fine tune performance, you may choose c++ kernel instead.

Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
Highlighted
Xilinx Employee
Xilinx Employee
376 Views
Registered: ‎03-24-2010

回复: Use of HLS/SDS pragmas in OpenCL kernels

Jump to solution

HLS pragmas are not supported in opencl kernel.

If you want to fine tune performance, you may choose c++ kernel instead.

Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Highlighted
Visitor
Visitor
310 Views
Registered: ‎03-11-2019

回复: Use of HLS/SDS pragmas in OpenCL kernels

Jump to solution

Hello,

I know that it is not supported. I just wanted to know if there was anything to overcome this limitation, but apparently not.

 

Anyway, thanks for the help!

0 Kudos