UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
846 Views
Registered: ‎06-26-2017

Double and float vector datatypes - OpenCL on HLS and HLS Testbench

Hi everyone! I would like to fix an issue on the CTestbench for an OpenCL kernel I should test and run on a ZedBoard. I am new with this topic: excuse my naïf questions and mistakes. 

 

As suggested I am debugging everything using the Simulation in Vivado HLS. 

 

I am able to pass to my kernel all float, double, int, int* arguments but not float4 and double4 data types (both constant values and __global pointers).

I have included <clc.h> in the kernel .cl file, but I am not able to transfer from the C-testbench some valid inputs:

 

 

1) I have tried to pass to my kernel (__global float4*) a float array (4 times the length of the float4 I need) but I get some errors, specifically:

 

eval.c:177:1: error: unknown type name 'ap_private'
ap_private<128, true> hls_PartSet_OC_i128_OC_i128_OC_i32_OC_i32_OC_i32(ap_private<128, true> , signed int , signed int , signed int ) __ATTRIBUTE_WEAK__;
^
eval.c:177:11: error: expected identifier or '('
ap_private<128, true> hls_PartSet_OC_i128_OC_i128_OC_i32_OC_i32_OC_i32(ap_private<128, true> , signed int , signed int , signed int ) __ATTRIBUTE_WEAK__;
^
eval.c:178:17: error: unknown type name 'ap_private'
void evaluation(ap_private<128, true> *gmem, signed int *group_id_2e_x, signed int *group_id_2e_y, signed int *group_id_2e_z, signed int *global_offset_2e_x, signed int *global_offset_2e_y, signed int *global_offset_2e_z, signed int *N, signed int *globalX, signed int *istart, signed int *ppGpus, signed int *Bfactor, signed int *dimension, signed int *next, signed int *loc_time, signed int *TIME, signed int *EPS, signed int *pl_core, signed int *pl_mass, signed int *rscale, signed int *mscale);
^
eval.c:178:27: error: expected ')'
void evaluation(ap_private<128, true> *gmem, signed int *group_id_2e_x, signed int *group_id_2e_y, signed int *group_id_2e_z, signed int *global_offset_2e_x, signed int *global_offset_2e_y, signed int *global_offset_2e_z, signed int *N, signed int *globalX, signed int *istart, signed int *ppGpus, signed int *Bfactor, signed int *dimension, signed int *next, signed int *loc_time, signed int *TIME, signed int *EPS, signed int *pl_core, signed int *pl_mass, signed int *rscale, signed int *mscale);
^
eval.c:178:16: note: to match this '('
void evaluation(ap_private<128, true> *gmem, signed int *group_id_2e_x, signed int *group_id_2e_y, signed int *group_id_2e_z, signed int *global_offset_2e_x, signed int *global_offset_2e_y, signed int *global_offset_2e_z, signed int *N, signed int *globalX, signed int *istart, signed int *ppGpus, signed int *Bfactor, signed int *dimension, signed int *next, signed int *loc_time, signed int *TIME, signed int *EPS, signed int *pl_core, signed int *pl_mass, signed int *rscale, signed int *mscale);
^
eval.c:179:22: error: unknown type name 'ap_private'
void _OC_evaluation7(ap_private<128, true> *, l_struct_OC_three_tuple_t *, l_struct_OC_three_tuple_t *, l_struct_OC_evaluation_args_t *);
^
eval.c:179:32: error: expected ')'
void _OC_evaluation7(ap_private<128, true> *, l_struct_OC_three_tuple_t *, l_struct_OC_three_tuple_t *, l_struct_OC_evaluation_args_t *);
^
eval.c:179:21: note: to match this '('
void _OC_evaluation7(ap_private<128, true> *, l_struct_OC_three_tuple_t *, l_struct_OC_three_tuple_t *, l_struct_OC_evaluation_args_t *);
^
eval.c:258:1: error: unknown type name 'ap_private'
ap_private<128, true

 

Should I include something to my testbench? Can it handle vector data types? I have seen the simulator is very strict wrt SDK or others IDE on how to add source files. Where should I place the files/headers and the #include directives?

The example in the documentation is for int arrays and not for vector data types. 

 

2) What about __local float4 and __local double4 inputs of my kernel?  Is it OK for Vivado HLS to handle __local arrays in the prototype of the OpenCl kernel?   How should I handle them in the testbench?  Please note that I am gradually adding these interfaces, thus the before-mentioned (1) problem is present even without these __local input parameters.

 

 

Thanks in advance for your help, suggestions and answers! 

 

Cheers, Marco :) 

0 Kudos