Using Intrinsics for ItaniumŪ-based Systems

Intel® Fortran supports all standard Fortran intrinsic procedures and provides Intel-specific intrinsic procedures to extend the language functionality. These intrinsic procedures are provided in 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.

Use this intrinsic in any situation you would like to tailor algorithms for the cache hierarchy on the target processor. For example, an application may query the cache size and use the result 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