Skip to content

SCA within ELEMENTAL function subroutine

Valentin Clement (バレンタイン クレメン) edited this page Mar 15, 2019 · 6 revisions

ELEMENTAL functions or subroutines have to be handled specifically within CLAW SCA transformation as the actual arguments of such function/subroutine is not known before the call is made on the calling translation unit.

The actual arguments in a reference to an elemental procedure can be either of the following: All scalar. For elemental functions, if the arguments are all scalar, the result is scalar. One or more array-valued. The following rules apply if one or more of the arguments is array-valued: For elemental functions, the shape of the result is the same as the shape of the array actual argument with the greatest rank. If more than one argument appears then all actual arguments must be conformable. For elemental subroutines, all actual arguments associated with INTENT(OUT) and INTENT(INOUT) dummy arguments must be arrays of the same shape, and the remaining actual arguments must be conformable with them. IBM

Inside the elemental function/subroutine

The ELEMENTAL function/subroutine is not transformed during the first pass on its translation unit. Only relevant information are stored in the XcodeML module file resulting for the pass. This file is named accordingly to the desired target and directive language passed by the user on the command line.

For example, the module file for the following command:

clawfc --target=gpu --directive=omp -o my_module_trans.f90 my_module.f90

Will be named like this:

my_module.openmp.gpu.claw.xmod

This module file is used only by the CLAW XcodeML to XcodeML translator (CX2T) and not by the OMNI Compiler front-end.