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!

Does SDAccel host program support C/C++

Accepted Solution Solved
Reply
Highlighted
Adventurer
Posts: 76
Registered: ‎02-09-2017
Accepted Solution

Does SDAccel host program support C/C++

Hi there,

I'm new to SDAccel. 

Now I know the kernel supports OpenCL, and C/C++. 

Does SDAccel host program support C/C++?


Accepted Solutions
Xilinx Employee
Posts: 68
Registered: ‎06-07-2016

Re: Does SDAccel host program support C/C++

[ Edited ]

Hi @sl_cgi

 

Yes, the host code is built with gcc/g++ on your Linux development system.

 

For reference, look at the hello example on GitHub there are hello.cpp (host) and hello.cl (device) sources.

 

Best,

-Dutch

 

 

View solution in original post


All Replies
Xilinx Employee
Posts: 68
Registered: ‎06-07-2016

Re: Does SDAccel host program support C/C++

[ Edited ]

Hi @sl_cgi

 

Yes, the host code is built with gcc/g++ on your Linux development system.

 

For reference, look at the hello example on GitHub there are hello.cpp (host) and hello.cl (device) sources.

 

Best,

-Dutch

 

 

Adventurer
Posts: 76
Registered: ‎02-09-2017

Re: Does SDAccel host program support C/C++

Yes. I saw the hello.cpp. I'm not familar with openCL C. Just want to double check the host program support C/C++.

Xilinx Employee
Posts: 68
Registered: ‎06-07-2016

Re: Does SDAccel host program support C/C++

There are some good video tutorials on OpenCL here and here.

 

There is also a Khronos certified tutorial here:

https://handsonopencl.github.io/

 

Unfortunately, it does not include setup in an FPGA environment, but the material and exercises are good for learning the model. 

 

As a reference, and since the standard is frequently updated keep the reference pages handy:

https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/

 

Best,

-Dutch

Visitor
Posts: 2
Registered: ‎03-26-2017

Re: Does SDAccel host program support C/C++

Hi,
this hello example on github isn't exist now,and I have a problem that how to use gcc4.8 in sdaccel to support the c++11?I had update my gcc version on the ubuntu,but when I compiled the tcl scripts,the error also occured.
Could you give me some advice?Thx.
Xilinx Employee
Posts: 68
Registered: ‎06-07-2016

Re: Does SDAccel host program support C/C++

Hi @xingqing_

 

The link has bee updated. 

 

You can use C++ 11 with the compiler flag:

-std=c++0x

 

Older versions of gcc/g++ (not in your case) will need to link against the libstdc++.so shipped with SDAccel to support C++ 11.

 

You can find the shipped libraries here:

<Install Directory>/SDx/<version>/runtime/lib/x86_64/

Adding them to the system loader path with:

export LD_LIBRARY_PATH=<Install Directory>/SDx/<version>/runtime/lib/x86_64:$LD_LIBRARY_PATH

 


Please be mindful that from the SDAccel release notes for 2016.4 (UG1238):

 

SDAccel supports RedHat Enterprise Linux or CentOS 6.4-6.7 and 7.2 64-bit.

 

That does not mean SDAccel will not work with Ubuntu, however it is not supported so you are trailblazing on your own.

 

Additionally, the tcl flow is not supported since SDAccel 2016.3, I strongly recommend you use the latest version (2016.4). Each new release has significant improvements over the last.

 

Best,

-Dutch