The /routine
qualifier allows you to specify qualifiers
that apply only to specific routines within the source file KAP
processes. The only qualifiers that /routine
can
specify are as follows:
/each_invariant_if_growth
/max_invariant_if_growth
/optimize
/roundoff
/scalaropt
/skip
/unroll
/unroll2
/unroll3
The syntax of a KAP command using the /routine
qualifier is as follows:
kapf [/<qualifiers>] source_file.f \ /routine=<routine_name>[,<routine_name>...]<qualifiers_for_routine_names> ...
Place the /routine
qualifier after the name for the
Fortran source file. Specify qualifiers that apply to all routines
in the source file after kapf
. The <routine_
name>
argument must be a routine in source_
file.f.
For example, consider the following command line:
kapf /scalaropt program.f /routine=sub_1 /roundoff /optimize
This command invokes KAP and passes the /scalaropt
qualifier to all program units in file program.f
including sub_1
. Program unit sub_1
processes with both the /roundoff
and
/optimize
qualifiers.
Using the /routine
qualifier implies that directives
equivalent to the specified qualifiers are asserted only while
processing particular routines. The effect is the same as if the
implied directives were inserted at the top of the associated
routines.
Using the /routine
qualifier makes the resulting
kapf
command contain two halves. The first half
looks like any other kapf
command because it
contains "kapf
," qualifiers different from
/routine
, and a source file name. The second half of
the command is different because it contains one or more
/routine
qualifiers, each with associated routines and
qualifiers for the routines selected from the preceding bulleted
list.
For example, consider the following command line:
kapf /cachesize=8,0 /syntax=a /freeformat my_program.f -
/routine=sub_1,sub_2,sub_3 /roundoff /optimize /routine=sub_4
/unroll
An explanation of the two halves follows:
/cachesize=8,0
,
/freeformat
, and /syntax=a
qualifiers
to all program units in file my_program.f.
The
program units include sub_1, sub_2, sub_3,
and
sub_4
.
sub_1
, sub_2
, and sub_3
process with both the
/roundoff
and /optimize
qualifiers. Routine
/sub_4
processes with the /unroll
qualifier.
The usual rules for shortening the names of qualifiers also apply to
the
/routine
qualifier. For example, the following KAP
command fragments produce identical results:
/routine=subroutine_a /optimize /unroll
/routine=subroutine_a /opt /unr