MCPcopy Create free account
hub / github.com/creatale/node-dv / profileDevices

Function profileDevices

deps/tesseract/opencl/openclwrapper.cpp:226–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226static ds_status profileDevices(ds_profile *profile,
227 const ds_evaluation_type type,
228 ds_perf_evaluator evaluator,
229 void *evaluatorData, unsigned int *numUpdates) {
230 ds_status status = DS_SUCCESS;
231 unsigned int i;
232 unsigned int updates = 0;
233
234 if (profile == NULL) {
235 return DS_INVALID_PROFILE;
236 }
237 if (evaluator == NULL) {
238 return DS_INVALID_PERF_EVALUATOR;
239 }
240
241 for (i = 0; i < profile->numDevices; i++) {
242 ds_status evaluatorStatus;
243
244 switch (type) {
245 case DS_EVALUATE_NEW_ONLY:
246 if (profile->devices[i].score != NULL) break;
247 // else fall through
248 case DS_EVALUATE_ALL:
249 evaluatorStatus = evaluator(profile->devices + i, evaluatorData);
250 if (evaluatorStatus != DS_SUCCESS) {
251 status = evaluatorStatus;
252 return status;
253 }
254 updates++;
255 break;
256 default:
257 return DS_INVALID_PERF_EVALUATOR_TYPE;
258 break;
259 };
260 }
261 if (numUpdates) *numUpdates = updates;
262 return status;
263}
264
265static const char *findString(const char *contentStart, const char *contentEnd,
266 const char *string) {

Callers 1

openclwrapper.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected