#include <petscmacros.h> bool PetscUnlikelyDebug(bool cond)Not Collective
| cond | - Boolean expression |
This returns the same truth value, it is only a hint to compilers that the result of cond is likely to be false. When PETSc is compiled in optimized mode this will always return false. Additionally, cond is guaranteed to not be evaluated when PETSc is compiled in optimized mode.
if (PetscUnlikelyDebug(cond)) {
foo();
} else {
bar();
}
is equivalent to
if (PetscDefined(USE_DEBUG)) {
if (PetscUnlikely(cond)) {
foo();
} else {
bar();
}
} else {
bar();
}