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

TBB 3. update 5.0 question

michaelnikelsky1
Beginner
793 Views
Hi,

I just read the changes of the update 5.0 and happily stumbled upon this:

-Added automatic propagation of master thread FPU settings to TBB worker threads.

What I wonder is: Does this also set the SSE control registers? At the moment I have to do something like

const unsigned int oldState = _mm_getcsr();
_mm_setcsr( oldState | 0x8040);

....do work

_mm_setcsr( oldState);

each time I enter the operator() function of my task since this isnt propagated. Will this be done automatically when I do it in the master thread with the 5.0 update?

Michael
0 Kudos
2 Replies
Andrey_Marochko
New Contributor III
793 Views
Yes, MXCSR is propagated too.

The only caveat is that the snapshot of FPU settings is done at the moment of task scheduler initialization in a master thread (e.g. when task_scheduler_init object is created). Thus if you change them afterwards, the current values will remain unknown to worker threads.

On the other hand if you uninitialize TBB scheduler (destroy task_scheduler_init object), change FPU settings, and then initialize the scheduler again, the new setting will be visible to workers.
0 Kudos
michaelnikelsky1
Beginner
793 Views
Great news, thanks :)
0 Kudos
Reply