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 libintrins.a. For more information on 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® Compiler)

Intrinsic CACHESIZE (n)is used only with the Intel® Itanium® Compiler. CACHESIZE (n) returns the size in kilobytes of the cache at level n; 1 represents the first level cache. Zero is returned for a nonexistent cache level.

This intrinsic can be used in many scenarios where application programmers would like to tailor their 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.

subroutine foo (level)
integer level
if (cachesize(level) > threshold) then
call big_bar()
else
call small_bar()
end if
end subroutine