首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将Ifort标志转换为Pgi Fortran标志

将Ifort标志转换为Pgi Fortran标志
EN

Stack Overflow用户
提问于 2013-02-23 03:51:52
回答 1查看 1K关注 0票数 1

当我使用英特尔Fortran编译器与Portlan Group编译器对同一代码进行编译时,会得到不同的结果。pgi Fortran中最接近ifort中-fp-model precise的标志是什么?

在pgi中是否有一组标志与-O2 -fp-model precise ifort标志的组合相匹配?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2013-02-23 05:39:01

使用不同编译器(甚至同一编译器的不同版本)编译的程序不会产生完全相同的结果。不同级别的优化(-On标志)在编译器之间也不是等价的(除了-O0,它根本不要求优化)。

我不认为PGI中有与ifort的-fp-model precise等同的标志,但您可能希望在PGI Fortran编译器手册中查看特定于目标的标志,更具体地说,这些:

代码语言:javascript
复制
-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

在不同的编译器之间,程序的输出在一些不太重要的数字上是可以接受的。如果你的结果非常不同,你的算法可能不是很健壮,可能需要改进。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15032163

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档