Software Archive
Read-only legacy content

Using a different floating point model for offload section

Amlesh_K_
Beginner
253 Views

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
Honored Contributor III
253 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.

0 Kudos
Amlesh_K_
Beginner
253 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

0 Kudos
Ravi_N_Intel
Employee
253 Views

To pass different options for Xeon Phi compilation use

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

0 Kudos
Amlesh_K_
Beginner
253 Views

Thanks Ravi.

0 Kudos
Reply