当我使用英特尔Fortran编译器与Portlan Group编译器对同一代码进行编译时,会得到不同的结果。pgi Fortran中最接近ifort中-fp-model precise的标志是什么?
在pgi中是否有一组标志与-O2 -fp-model precise ifort标志的组合相匹配?
谢谢
发布于 2013-02-23 05:39:01
使用不同编译器(甚至同一编译器的不同版本)编译的程序不会产生完全相同的结果。不同级别的优化(-On标志)在编译器之间也不是等价的(除了-O0,它根本不要求优化)。
我不认为PGI中有与ifort的-fp-model precise等同的标志,但您可能希望在PGI Fortran编译器手册中查看特定于目标的标志,更具体地说,这些:
-K[no]ieee Use IEEE division, optionally enable traps
-Ktrap=align|denorm|divz|fp|inexact|inv|none|ovf|unf
Determine IEEE Trap conditions
-M[no]daz Treat denormalized numbers as zero
-M[no]flushz Set SSE to flush-to-zero mode
-M[no]fpapprox[=div|sqrt|rsqrt]
Perform certain fp operations using low-precision approximation
div Approximate floating point division
sqrt Approximate floating point square root
rsqrt Approximate floating point reciprocal square root
-Mfpapprox Approximate div,sqrt,rsqrt
-M[no]fpmisalign Allow use of vector arithmetic instructions for unaligned operands
-M[no]fprelaxed[=div|recip|sqrt|rsqrt|[no]order]
Perform certain fp operations using relaxed precision
div Perform divide with relaxed precision
recip Perform reciprocal with relaxed precision
sqrt Perform square root with relaxed precision
rsqrt Perform reciprocal square root with relaxed precision
[no]order Allow expression reordering, including factoring
-Mfprelaxed Choose which operations depending on target processor在不同的编译器之间,程序的输出在一些不太重要的数字上是可以接受的。如果你的结果非常不同,你的算法可能不是很健壮,可能需要改进。
https://stackoverflow.com/questions/15032163
复制相似问题