How to use par statment in C function

If you have a simple question and just want an answer.
malbahri
Member++
Posts: 19
Joined: Sun Mar 23, 2014 9:51 pm

How to use par statment in C function

Post by malbahri »

I have some functions It has been writen in C I would like to use par statment in some of these functions any idea how to call par statement in C function. I have functions where they are located in .c file whereas I call these functions in .xc file but I need to perform some parallelization in these functions.

Another things it would be highly appreciated if somebody could help me solving the below error

cannot declare array of aliasing pointers
henk
Verified
Respected Member
Posts: 347
Joined: Wed Jan 27, 2016 5:21 pm

Post by henk »

Hi Malbahri,

Can you call an XC function where you want the parallelisation and go back to C from there?

Cheers,
Henk
malbahri
Member++
Posts: 19
Joined: Sun Mar 23, 2014 9:51 pm

Post by malbahri »

Dear Henk,

Thanks a lot for your reply. Will you please kindly provide some example for your suggestion
User avatar
Ross
Verified
XCore Legend
Posts: 1185
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

I think henk is talking about wrapping your C functions in an XC that does the par.. i.e.

example_c_file.c:

Code: Select all

void main()
{
   // Returns when both c_func_1() and c_func_2() complete
   an_xc_function();
}

void c_func_1();
{

}
void c_func_2();
{

}
example_xc_file.xc:

Code: Select all

void an_xc_function()
{
    par{
            c_func_1();
            c_func_2();
       }
}