2013-02-22 2 views
1

인텔 포트란 컴파일러 및 Portlan Group 컴파일러로 컴파일 할 때 동일한 코드에서 다른 결과가 나타납니다. ifort의 -fp-model precise에 pgi Fortran에서 가장 가까운 플래그는 무엇입니까?
ifort 플래그가 -O2 -fp-model precise의 조합과 일치하는 플래그가 pgi에 있습니까?
감사합니다Ifort 플래그를 Pgi Fortran 플래그로 변환

답변

3

다른 컴파일러 (또는 동일한 컴파일러의 다른 버전)로 컴파일 된 프로그램은 정확히 동일한 결과를 생성 할 것으로 예상되지 않습니다. 다른 최적화 수준 (-On 플래그)도 컴파일러간에 동일하지 않습니다 (-O0은 최적화를 전혀 요구하지 않습니다).

내가의 -fp-model precise을 ifort하는 PGI에 해당하는 플래그가 없다고 생각하지만,이 더 구체적으로 PGI 포트란 컴파일러에 대한 설명서 대상 특정 플래그 보길 원하고 있습니다

-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 

프로그램의 출력이 다른 컴파일러 사이의 일부 덜 중요한 자리에서 다를 수 있습니다. 결과가 매우 다른 경우 알고리즘이 강력하지 않을 수 있으며 작업이 필요할 수 있습니다.