| 1067 | } |
| 1068 | |
| 1069 | static cl_bool |
| 1070 | findBestPattern(SolutionStep *step) |
| 1071 | { |
| 1072 | cl_uint maxImages; |
| 1073 | |
| 1074 | maxImages = getQueueMaxImages(step->cmdQueue); |
| 1075 | |
| 1076 | do { |
| 1077 | /* It may be non first attempt. Ensure that there are not |
| 1078 | * hold images for this step |
| 1079 | */ |
| 1080 | releaseStepImgs(step); |
| 1081 | |
| 1082 | step->patternID = selectPattern( step, maxImages ); |
| 1083 | |
| 1084 | assert(step->patternID != (unsigned int)-1); |
| 1085 | |
| 1086 | #ifdef DEBUG_2 |
| 1087 | printf("select Pattern Done\n"); |
| 1088 | #endif |
| 1089 | |
| 1090 | getStepGranulation(step); |
| 1091 | #ifdef DEBUG_2 |
| 1092 | printf("getStepGranulation done \n"); |
| 1093 | #endif |
| 1094 | |
| 1095 | assertGranulation(step->subdims, mempat->nrLevels, |
| 1096 | &step->pgran, mempat->thLevel); |
| 1097 | if (getStepResources(step)) |
| 1098 | break; |
| 1099 | } while (maxImages-- != 0); |
| 1100 | |
| 1101 | return (maxImages != (cl_uint)-1) ? CL_TRUE : CL_FALSE; |
| 1102 | } |
| 1103 | |
| 1104 | void |
| 1105 | detectProblemTails(SolutionStep *step) |
no test coverage detected