1 2 static char help[] = "Example of using PetscLikely() and PetscUnlikely().\n\n"; 3 4 /*T 5 Concepts: optimization^likely 6 Concepts: optimization^unlikely 7 Processors: n 8 T*/ 9 10 #include <petscsys.h> 11 12 int main(int argc,char **argv) 13 { 14 PetscBool flg = PETSC_TRUE; 15 16 PetscCall(PetscInitialize(&argc,&argv,(char*)0,help)); 17 if (PetscLikely(flg)) { 18 /* do something */ 19 } 20 if (PetscUnlikely(flg)) { 21 /* do something */ 22 } 23 PetscCall(PetscFinalize()); 24 return 0; 25 } 26 27 /*TEST 28 29 test: 30 31 TEST*/ 32