cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

afo
Adept I

calling .br functions from C code

how to call .br function from c code

Dear people,

I can not find in the documentation or in the forum a way to call .br functions from normal C code. The only reference is

http://forums.amd.com/devforum/messageview.cfm?catid=328&threadid=94403&highlight_key=y&keyword1=calling%20kernel%20from%20c%20code

Could be possible to have an example?

thanks in advance for your help

regards,

Alfonso

0 Likes
3 Replies
gaurav_garg
Adept I

You can take a look at any of the samples comig with Brook+ SDK under samples\CPP folder. All these samples call kernel defined in .bf from cpp file.

0 Likes

Thanks for point me in the right direction.

About the examples, I need to call a kernel from a pure C source (not cpp). How can this be acomplished? Should I use a c++ wrapper that calls the kernel and can be called from the c source? Is there another way?

regards,

Alfonso

0 Likes

The code generated by brcc is C++ code. Brook+ streams are also C++ classes. So, you must create a C++ wrapper that does all the stream creation and call kernel.

0 Likes