Intel® Fortran Compiler 17.0 Developer Guide and Reference
Run-Time Function: Returns the availability of High Bandwidth (HBW) memory for a program.
USE IFCORE
result = FOR_GET_HBW_AVAILABILITY( )
The result type is INTEGER(4). The return value will be one of the following:
FOR_K_HBW_AVAILABLE - HBW memory is available on this node.
FOR_K_HBW_NO_ROUTINES - The routines needed for HBW memory allocation are not linked in (for example, there is no libmemkind).
FOR_K_HBW_NOT_AVAILABLE - HBW memory is not available on this node.
If the return value indicates that High Bandwidth (HBW) memory is available, it does not guarantee that type of memory will be used for the allocated target through the life of the program. That is, if the node runs out of HBM memory, regular heap memory will be used.
Consider the following:
program hbw_availability
use ifcore
integer(4) :: i4_hbw_availability
i4_hbw_availability = for_get_hbw_availability()
print *,"Results of for_get_hbw_availability():"
select case (i4_hbw_availability)
case (FOR_K_HBW_AVAILABLE)
print *," HBM is available."
case (FOR_K_HBW_NO_ROUTINES)
print *," The libmemkind routines needed for hbw memory allocation are not linked-in."
case (FOR_K_HBW_NOT_AVAILABLE)
print *," HBM is NOT available on this node."
end select
end program hbw_availability