optimize

Date:

02-09-2023

NAME

optimize - controls the optimization level.

SYNOPSIS

!DIR$ OPTIMIZE [(option[ option])]

DESCRIPTION

The optimize directive enables optimization in the function in which it appears, overriding the optimization level set via the compiler command line. The optimize directive with no option specified is equivalent to optimize -02.

In Fortran, the OPTIMIZE directive may only appear in the declarative section of a program unit. A program unit may be a program, subroutine, function, module, or submodule, but not a block data program unit. OPTIMIZE does not affect any modules invoked with the USE statement in the program unit that contains them. They do affect CONTAINed procedures that do not include an explicit OPTIMIZE directive.

The optimize directive accepts the following subset of the command line options which control optimization. Refer to crayftn(1) for descriptions of these options.

  • -Olevel

  • -h acc

  • -h acc_model=

  • -h add_paren

  • -h [no]aggress

  • -h align_arrays

  • -h [no]autothread

  • -h [no]autoprefetch

  • -h cblock n

  • -h cache n

  • -h concurrent

  • -h contiguous

  • -h contiguous_assumed_shape

  • -h contiguous_pointer

  • -h fast

  • -h find_dirs

  • -h flex_mp=level

  • -h fma

  • -h fortran_ptr_alias

  • -h fortran_ptr_overlap

  • -h fp n

  • -h fpn=[no]approx

  • -h fp_trap

  • -h fusionn

  • -h loop_trips

  • -h msgs

  • -h negmsgs

  • -h nointerchange

  • -h offload_do_concurrent

  • -h omp

  • -h omp_simd

  • -h overindex

  • -h page_align_allocate

  • -h [no]pattern

  • -h preferred_vector_width=

  • -h scalar n

  • -h shortcircuit level

  • -h thread n

  • -h thread_do_concurrent

  • -h unrolln

  • -h vector n

  • -h vector_classic

  • -h zero

SEE ALSO

intro_directives(7)

Cray Fortran Reference Manual