- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great news, thanks :)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page