There is no difference in the results. I have even raised the precision of the 
number output, but my call to _controlfp_s seems not to influence the output at 
all... what does that mean? That _controlfp_s cannot be a part of the solution?

-----Ursprüngliche Nachricht-----
Von: K. Frank [mailto:kfrank2...@gmail.com] 
Gesendet: Donnerstag, 17. März 2016 14:40
An: mingw64
Betreff: Re: [Mingw-w64-public] Floating-Point Operations Not Deterministic 
When Excecuted Asynchronously

Hi Benjamin!

On Thu, Mar 17, 2016 at 4:07 AM, Benjamin Bihler 
<benjamin.bih...@compositence.de> wrote:
> Thank you for the suggestion.
>
> I have tried the following code snippets when the program starts up to set 
> the floating-point precision:
>
> ---
> unsigned int fpu_cw;
>  _controlfp_s(&fpu_cw, _PC_24, _MCW_PC);
> ---
> ...
> This does not help. Still the asynchronous thread gives different results. 
> Should I use different commands? Which ones?

I don't know anything about the details of _controlfp_s, etc., but I do have a 
debugging question.

Did any of your versions of calling _controlfp_s have any effect in that they 
changed the results produced by the main thread (even if those changed results 
did not match the results of the asynchronous thread)?

Or did your main thread still give the same results as without the _controlfp_s 
call?

Obviously, until you can change the behavior of the main thread, you can't 
change it to match the asynchronous threads.

In any event, hopefully someone on this list could tell you what call to 
_controlfp_s you need to match the floating-point environment that is getting 
set up for the asynchronous thread.  (I certainly can't.)

> Actually limiting the fp precision on the main thread would be a solution for 
> me, though it feels like a dirty workaround.

Yeah, you shouldn't have to use the less-favorable precision.  But that's the 
nature of work-arounds ...

Logically, I do think the idea should work.  Sorry i can't give you any detail 
on how to make it work.

(Of course, the better approach is to figure out how to make the child threads 
behave -- i.e., use the extended precision, and otherwise use a floating-point 
environment consistent with that of the main thread.)


Good luck.


K. Frank

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with Intel Data Analytics 
Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to