Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Amlesh_K_
Beginner
45 Views

Using a different floating point model for offload section

Hi,

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.

 

Thanks,

Amlesh

0 Kudos
4 Replies
TimP
Black Belt
45 Views

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.

Amlesh_K_
Beginner
45 Views

Hi Tim,

 

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?

 

Thanks,

Amlesh

Ravi_N_Intel
Employee
45 Views

To pass different options for Xeon Phi compilation use

-qoffload-option,mic,compiler,”-fp-model fast –fimf-precision=high”

Amlesh_K_
Beginner
45 Views

Thanks Ravi.

Reply