Using Intrinsics for ItaniumŪ-based Systems

IntelŪ Fortran supports all standard Fortran intrinsic procedures and, in addition, provides  Intel-specific intrinsic procedures to extend the functionality of the language. Intel Fortran intrinsic procedures are provided in the library the following libraries:

Platform

Library

Linux*

libintrins.a

Windows*

libintrins.lib

For more details on these intrinsic procedures, see the IntelŪ Fortran Language Reference.

This topic provides examples of the Intel-extended intrinsics that are helpful in developing efficient applications.

CACHESIZE Intrinsic (ItaniumŪ-based Compiler)

The intrinsic CACHESIZE(n) is used only with the IntelŪ ItaniumŪ-based compiler. CACHESIZE(n)returns the size in kilobytes of the cache at level n; One (1) represents the first level cache. Zero (0) is returned for a nonexistent cache level.

This intrinsic can be used in many scenarios where the application programmer would like to tailor algorithms for the target processor's cache hierarchy. For example, an application may query the cache size and use it to select block sizes in algorithms that operate on matrices.

Example

subroutine foo (level)

integer level

if (cachesize(level) > threshold) then

   call big_bar()

else

   call small_bar()

end if

end subroutine