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
Xilinx Employee
Xilinx Employee
6,729 Views
Registered: ‎03-08-2016

[Opencl] Data type for intermediate number of bits

HI,

 

I want to know is there any method by which I can use user defined data types in opencl code.

For example a data type of 12 bit or 9 bit ? (something greater then 'char' but lesser then 'short')

Tags (2)
0 Kudos
4 Replies
Teacher muzaffer
Teacher
6,705 Views
Registered: ‎03-31-2012

Re: [Opencl] Data type for intermediate number of bits

did you try to include ap_int.h ?
- 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.
0 Kudos
Xilinx Employee
Xilinx Employee
6,703 Views
Registered: ‎08-17-2011

Re: [Opencl] Data type for intermediate number of bits


@muzaffer wrote:
did you try to include ap_int.h ?

Hi @muzaffer!!

humm.. ap_int is C++ but OpenCL is C only so wouldn't work i'd think... either switch to C/C++ kernels to use ap_int, or trust that the tool will do the right thing.

as last resort, if really in doubt, insert modulo by power of 2 to give more hints, but would start to get "ugly".

- Hervé

SIGNATURE:
* New Dedicated Vivado HLS forums* http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/bd-p/hls
* Readme/Guidance* http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

* 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.
0 Kudos
Xilinx Employee
Xilinx Employee
6,701 Views
Registered: ‎03-08-2016

Re: [Opencl] Data type for intermediate number of bits

Actually there is a header file "ap_cint.h" for C files, as per below Xilinx's SDAccel document.
http://www.xilinx.com/support/documentation/sw_manuals/xilinx2012_2/ug902-vivado-high-level-synthesis.pdf "page 13".

But when I include this file in to my opencl kernel, it reports 'file not found error'

"lz77kernel.cl:2:10: fatal error: 'ap_cint.h' file not found"

Any suggestions how I can get this file and where I need to keep it ?

0 Kudos
Xilinx Employee
Xilinx Employee
6,696 Views
Registered: ‎08-17-2011

Re: [Opencl] Data type for intermediate number of bits


@saurabhs wrote:

Actually there is a header file "ap_cint.h" for C files, as per below Xilinx's SDAccel document.
http://www.xilinx.com/support/documentation/sw_manuals/xilinx2012_2/ug902-vivado-high-level-synthesis.pdf "page 13".

But when I include this file in to my opencl kernel, it reports 'file not found error'

"lz77kernel.cl:2:10: fatal error: 'ap_cint.h' file not found"

Any suggestions how I can get this file and where I need to keep it ?


Hi @saurabhs!!

 

Oops correct for ap_cint.h, then in this situation please try to pass the include path to the tools with host flags " -I /VHLS/path/to/include " - either in tcl script or similar xocc; this should work.

However, i am not sure how the difference is made between "vector type int3 with 3 dimension" and "3 bit integer int3".. let us know how you get on.

- Hervé

SIGNATURE:
* New Dedicated Vivado HLS forums* http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/bd-p/hls
* Readme/Guidance* http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

* 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.
0 Kudos