Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public
Document Table of Contents

fopenmp-do-concurrent-maptype-modifier, Qopenmp-do-concurrent-maptype-modifier

Lets you specify the data movement for variables referenced inside the DO CONCURRENT region when it is auto-offloaded. This feature is only available for ifx.

Syntax

Linux:

-fopenmp-do-concurrent-maptype-modifier[=modifier]

Windows:

/Qopenmp-do-concurrent-maptype-modifier [=modifier]

Arguments

modifier

Specifies the data movement to be applied to the TOFROM maptype that is used when offloading a DO CONCURRENT region. It can be any of the following:

always

Tells the compiler that data must be moved to and from the device.

present

Tells the compiler that data has already been moved to the device and no further movement is required.

none

Tells the compiler that if the runtime cannot determine whether the data is already present, move it to the device and then back. This is the default if modifier is not specified.

Default

TOFROM

When you do not specify this option, no modifier is specified, or none is specified, TOFROM is used when offloading a DO CONCURRENT region.

Description

This option lets you specify the data movement for variables referenced inside the DO CONCURRENT region when it is auto-offloaded.

This option is ignored if you do not also specify both of the following options in the command line:

  • -fopenmp-targets (Linux) or /Qopenmp-targets (Windows)

  • -fopenmp-target-do-concurrent (Linux) or /Qopenmp-target-do-concurrent (Windows)

IDE Equivalent

None

Alternate Options

None

Example

Consider the following program (named test.f90) on a Linux system:

  program do_conc_omp_hybrid
    implicit none
 
    integer :: i
    integer, dimension(10) :: x, y
 
    x = 1
    y = 0
 
    !$omp target data map(to: x) map(from: y)
    x = 2
 
    do concurrent (i = 1:10)
        y(i) = x(i) + 1
    enddo
 
    !$omp end target data
 
    print *, y
  end program do_conc_omp_hybrid

Previously, there was no control for data movement and the compiler would move the X and Y data to and from the device by default, despite the fact that the user had already mapped it.

However, if you specify option -fopenmp-do-concurrent-maptype-modifier, you have more control over the movement.

For example, if you specify the following command, the compiler is told that the data for X and Y has already been moved to the device and no further movement is required:

ifx -fiopenmp -fopenmp-targets=spir64 -fopenmp-target-do-concurrent -fopenmp-do-concurrent-maptype-modifier=present test.f90