I am working on an application, where we can specify all the compiler flags, floating point models (eg -fp-model source etc.) etc, in the Macros file.
In the code, I am offloading a certain section to the Xeon Phi. Is it possible to use a different floating point model for this computation on Xeon Phi?
For example, say the Macros file has the flag -fp-model source, and I want to use -fp-model fast=2 -fimf-precision=high for the computation on Xeon Phi.
In most cases, you can choose different values of those settings for each compilation. It seems entirely normal to set -fp-model source for Xeon host and more aggressive settings for Xeon Phi.
I prefer more specific groups of options than -fp-model fast=2, but if you recognize all the consequences, including the implied -complex-limited-range, this should be OK. I have used -fp-model source -fno-prec-div -imf-domain-exclusion=common
and now I might try -fp-model fast=1 -fprotect-parens -imf-domain-exclusion=....
but I suspect -fprotect-parens may still prevent optimization of inner_product and the like.
A few implications of -fp-model fast (e.g. -ftz) apply only in a main program and you may want to check whether they have effect on MIC. If you happened to send denormals over from host it might be bad to have excluded correct handling on MIC by -fp-model-fast=2 or -imf-domain-exclusion. Note the warning against setting -fast-transcendentals (included in -fp-model fast) together with -fp-model strict.
In the application I am working, we can check the error growth over timesteps. Using fp-model fast=2 if fine.
Can you please also suggest how do I set different floating model for the Xeon Phi execution?