same_tbs

Date:

02-06-2023

NAME

same_tbs - asserts that a specified group of assumed-shape array arguments have the same rank, type, low-bound, extent and stride multiplier for corresponding dimensions.

SYNOPSIS

!DIR$ SAME_TBS (array, array[, array])

DESCRIPTION

The SAME_TBS directive informs the compiler that the specified assumed-shape arrays are of the same rank and type, and that they have identical low-bound, extent, and stride multiplier information for corresponding dimensions.

This information allows the compiler to generate more efficient code by reducing the number of potentially distinct intermediate values required for array element accesses. This may offer significant execution performance improvement when using assumed-shape dummy arrays of corresponding type, low-bound, extent, and stride.

The SAME_TBS directive supports this option:

array

Two or more array arguments are required. array is the name of an assumed-shape dummy array. The arrays specified must not have the TARGET attribute. All arrays, specified on a single SAME_TBS directive must have same element type, bounds, and strides. Use the -Rd command line option to verify that the arrays have the same element type, bounds, and strides.

The SAME_TBS directive applies only to the program unit in which it appears.

Ordinarily, for multidimensional assumed-shape arrays, some classes of loop optimizations cannot be performed when an assumed-shape dummy array is referenced or defined in a loop or an array assignment statement. The lost optimizations and the additional copy operations performed can significantly reduce the performance of a procedure that uses assumed-shape dummy arrays when compared to an equivalent procedure that uses explicit-shape array dummy arguments. This directive may provide significant performance improvement depending on certain factors such as greater numbers of assumed-shape arrays and smaller array sizes.

SEE ALSO

intro_directives(7)

Cray Fortran Reference Manual