Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

internal compiler error

chowdhary__sangeeta
569 Views

Hello Everyone,

I am trying to build tbb program with parallel_for    

 tbb::parallel_for(

    tbb::blocked_range<int>(0,len),

    [&](tbb::blocked_range<int> &r, size_t thdId) {

        for(int i = r.begin(), i_end = r.end(); i < i_end - 1; i++) {

            for (int j = 0; j < len ; j += 1) { 

                a += a[i + 1];

        }

        }

    });

I am building it using g++ on 64-bit linux machine with version 5.4. I am getting this error while building it 

 internal compiler error: in expand_expr_real_1, at expr.c:9608

                 a += a[i + 1];

                                       ^

Any help would be appreciated.

 
0 Kudos
1 Reply
Alexey-Kukanov
Employee
569 Views

The body of parallel_for should only have one parameter, in your case - a blocked_range. The second parameter - size_t thdld - should be removed.

0 Kudos
Reply