Using the Fortran 2008 BLOCK construct with the Intel® Xeon Phi™ coprocessor

The Intel® Parallel Studio XE 2015 Composer Editions for Fortran Windows* and Linux* have a feature enhancement supporting the Fortran 2008 standard BLOCK construct.

This feature support includes use with the Intel® Xeon Phi™ coprocessor where the use is within code that executes exclusively on the coprocessor but excluding inside a structured block of an OpenMP* directive. It is a general usage restriction applicable on the host and coprocessor that a BLOCK construct cannot appear inside a structured block of an OpenMP* directive and such attempted use evokes a compile-time error.

For the Intel® Xeon Phi™ coprocessor and use with offloaded code, this feature only supports use of a BLOCK construct within a the target of an offload execution, meaning inside an offloaded subprogram.

A BLOCK construct cannot appear inside a structured block of a !DIR$ OFFLOAD OMP directive or !DIR$ OFFLOAD BEGIN / END OFFLOAD directives. Use with the former (OMP specific) directive evokes a compile-time error. Use with the latter directive pair does not evoke any compile-time diagnostics; however, the use should not be considered safe and program behavior involving such use is unpredictable.

The use of a BLOCK construct with offloading should be restricted to within the target of an offload execution (i.e inside an offloaded subprogram).

For example:

          subroutine adj_temp
          !dir$ attributes offload : mic :: calc_temp
          …
          !  Offload call of calc_temp
          !dir$ offload begin target (mic:0)
                 call calc_temp
           …
           end subroutine adj_temp

           !dir$ attributes offload : mic :: calc_temp
           subroutine calc_temp
           …

           !  Use within an offloaded subprogram but outside a
           !  structured block of an OpenMP* directive is supported
           block
                   integer :: iTemp
                   iTemp=20
                   print "(A,I2)",”In block, iTemp=',iTemp
           end block
           …
           end subroutine calc_temp

Code compiled to execute natively (/Qmic [-mmic]) on the Intel® Xeon Phi™ coprocessor can use a BLOCK construct under the same usage requirement as the host CPU, that is, a BLOCK construct cannot appear inside a structured block of an OpenMP* directive.

This feature enhancement is available in the Fortran Intel® 15.0 compiler.

Refer to the Intel® Parallel Studio XE 2015 Composer Edition for Fortran product documentation for additional details.

For more complete information about compiler optimizations, see our Optimization Notice.