MCPcopy Create free account
hub / github.com/RenderKit/embree / run

Method run

tutorials/verify/verify.cpp:5309–5356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5307 : VerifyApplication::Test(name,isa,VerifyApplication::TEST_SHOULD_PASS), func(func), mode(mode), intensity(intensity) {}
5308
5309 VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent)
5310 {
5311 std::string cfg = state->rtcore + ",isa="+stringOfISA(isa);
5312 RTCDeviceRef device = rtcNewDevice(cfg.c_str());
5313 errorHandler(nullptr,rtcGetDeviceError(device));
5314
5315 /* only test supported intersect modes */
5316 intersectModes.push_back(MODE_INTERSECT1);
5317 intersectModes.push_back(MODE_INTERSECT4);
5318 intersectModes.push_back(MODE_INTERSECT8);
5319 intersectModes.push_back(MODE_INTERSECT16);
5320
5321 size_t errorCounter = 0;
5322 unsigned int sceneIndex = 0;
5323 while (sceneIndex < size_t(intensity*state->intensity))
5324 {
5325 if (mode)
5326 {
5327 unsigned numThreads = getNumberOfLogicalThreads();
5328
5329 std::vector<RegressionTask*> tasks;
5330 while (numThreads)
5331 {
5332 unsigned int N = max(unsigned(1),random_int()%numThreads); numThreads -= N;
5333 RegressionTask* task = new RegressionTask(this,sceneIndex++,5,N,false);
5334 tasks.push_back(task);
5335
5336 for (unsigned int i=0; i<N; i++)
5337 threads.push_back(createThread(func,new ThreadRegressionTask(i,N,state,device,intersectModes,task),DEFAULT_STACK_SIZE,numThreads+i));
5338 }
5339
5340 for (size_t i=0; i<threads.size(); i++)
5341 join(threads[i]);
5342 for (size_t i=0; i<tasks.size(); i++) {
5343 errorCounter += tasks[i]->errorCounter;
5344 delete tasks[i];
5345 }
5346
5347 threads.clear();
5348 }
5349 else
5350 {
5351 RegressionTask task(this,sceneIndex++,5,0,false);
5352 func(new ThreadRegressionTask(0,0,state,device,intersectModes,&task));
5353 }
5354 }
5355 return (VerifyApplication::TestReturnValue) (errorCounter == 0);
5356 }
5357 };
5358
5359 size_t monitorMemoryBreak = 0;

Callers

nothing calls this directly

Calls 12

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
createThreadFunction · 0.85
joinFunction · 0.85
maxFunction · 0.50
c_strMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected