You are here: HSA Programmer's Reference Manual Version 1.0.1 > Chapter 12. Exceptions > Hardware Exceptions

Hardware Exceptions

HSAIL defines a set of exceptions, and provides a mechanism to control these exceptions by means of hardware exception policies (see Hardware Exception Policies). The exception policies are specified when a kernel is finalized and cannot be changed at runtime.

HSAIL requires the hardware to generate the exceptions, as defined by the HSAIL instructions, that are enabled for at least one of the exception policies. The hardware is not required to generate exceptions that are not enabled for any exception policy.

The exceptions include the five floating-point exceptions specified in IEEE/ANSI Standard 754-2008. HSAIL also allows, but does not require, an implementation to generate a divide by zero exception if integer division or remainder with a divisor of zero is performed.

For the Base profile (see Base Profile Requirements), it is not permitted to enable any of the exception policies for the five floating-point exceptions.

HSAIL also allows, but does not require, an implementation to generate other exceptions, such as invalid address and memory exception. However, HSAIL does not provide support to control these exceptions by means of the HSAIL exception policies. If such exceptions are generated, it is implementation defined if the exception is signaled. See Handling Signaled Exceptions. If the implementation does not signal the exception, or if execution is resumed after being halted due to signaling the exception, the value returned by the associated instruction is undefined. For example, a load from an address of a non-existent memory page can return an undefined value.

The exceptions supported by the HSAIL exception policies are:

In addition, the native floating-point operations may generate exceptions. However, it is implementation defined if, and which, exceptions they generate. For example, the nlog2 instruction may generate a divide by zero exception when given the value 0.