restrict(amp) restrictions part 7 of N – volatile and miscellaneous forbidden operators and statements
This post assumes and requires that you have read the introductory post to this series which also includes a table of content. With that out of the way let’s look at some restrictions for some statements, operators and the volatile qualifier.
Following is a list of statements or operators that are not allowed in an amp-restricted function:
- dynamic_cast;
- typeid operator
- goto statements or labeled statements;
- inline native assembly (asm) declarations;
- function try blocks, try blocks, catch blocks, or throw;
Also, the volatile type qualifier is not supported in an amp restricted function because the semantics defined by C++ volatile memory cannot be safely emulated by the underlying Direct3D platform. This also means volatile member functions are not supported since a volatile member function actually means the this pointer is volatile, which is not supported.