TBB and cilk

TBB and cilk

Imagen de Walter Shands (Intel)

Hi,
I have the following loop that is executed within a lambda function called by TBB and I would like to use a cilk_for instead of the usual for:

//distsq and tmpC3 are arrays of floats
for (int k = 0; k < len1D; k += 1)

{

int t = k*3;

distsq[k] = tmpC3[t] + tmpC3[t+1] + tmpC3[t+2];

}

When I do change the for to a cilk_for the program crashes and Parallel Inspector says I have a data race. I assume the race involves distsq[k]; is that right? Do I need to protect distsq? Is it OK to use cilk_for inside a TBB lambda function?

Technical Consulting Engineer Intel Corporation
publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de Barry Tannenbaum (Intel)

It looks like this should work.

Are you using Composer 12.0, or the Cilk++ kit? And which OS are you using?

The version of Intel Cilk Plus in Composer 12.0 should work with TBB. We may need a sample program to track this down.

- Barry

Inicie sesión para dejar un comentario.