| 5385 | : VerifyApplication::Test(name,isa,VerifyApplication::TEST_SHOULD_PASS), func(func), intensity(intensity) {} |
| 5386 | |
| 5387 | VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent) |
| 5388 | { |
| 5389 | std::string cfg = state->rtcore + ",isa="+stringOfISA(isa); |
| 5390 | RTCDeviceRef device = rtcNewDevice(cfg.c_str()); |
| 5391 | errorHandler(nullptr,rtcGetDeviceError(device)); |
| 5392 | |
| 5393 | /* only test supported intersect modes */ |
| 5394 | intersectModes.push_back(MODE_INTERSECT1); |
| 5395 | intersectModes.push_back(MODE_INTERSECT4); |
| 5396 | intersectModes.push_back(MODE_INTERSECT8); |
| 5397 | intersectModes.push_back(MODE_INTERSECT16); |
| 5398 | |
| 5399 | rtcSetDeviceMemoryMonitorFunction(device,monitorMemoryFunction,nullptr); |
| 5400 | |
| 5401 | unsigned int sceneIndex = 0; |
| 5402 | while (sceneIndex < size_t(intensity*state->intensity)) |
| 5403 | { |
| 5404 | monitorMemoryBreak = std::numeric_limits<size_t>::max(); |
| 5405 | monitorMemoryBytesUsed = 0; |
| 5406 | monitorMemoryInvokations = 0; |
| 5407 | monitorMemoryBreakExecuted = 0; |
| 5408 | monitorProgressBreak = std::numeric_limits<size_t>::max(); |
| 5409 | monitorProgressInvokations = 0; |
| 5410 | monitorProgressBreakExecuted = 0; |
| 5411 | RegressionTask task1(this,sceneIndex,1,0,true); |
| 5412 | func(new ThreadRegressionTask(0,0,state,device,intersectModes,&task1)); |
| 5413 | if (monitorMemoryBytesUsed) |
| 5414 | return VerifyApplication::FAILED; |
| 5415 | |
| 5416 | monitorMemoryBreak = size_t(float(monitorMemoryInvokations) * random_float()); |
| 5417 | monitorMemoryBytesUsed = 0; |
| 5418 | monitorMemoryInvokations = 0; |
| 5419 | monitorMemoryBreakExecuted = 0; |
| 5420 | monitorProgressBreak = size_t(float(monitorProgressInvokations) * 2.0f * random_float()); |
| 5421 | monitorProgressInvokations = 0; |
| 5422 | monitorProgressBreakExecuted = 0; |
| 5423 | RegressionTask task2(this,sceneIndex,1,0,true); |
| 5424 | func(new ThreadRegressionTask(0,0,state,device,intersectModes,&task2)); |
| 5425 | if (monitorMemoryBytesUsed) |
| 5426 | return VerifyApplication::FAILED; |
| 5427 | if (monitorMemoryBreakExecuted && task2.errorCounter != 1) |
| 5428 | return VerifyApplication::FAILED; |
| 5429 | if (monitorProgressBreakExecuted && task2.errorCounter != 1) |
| 5430 | return VerifyApplication::FAILED; |
| 5431 | if (!monitorMemoryBreakExecuted && !monitorProgressBreakExecuted && task2.errorCounter != 0) |
| 5432 | return VerifyApplication::FAILED; |
| 5433 | sceneIndex++; |
| 5434 | } |
| 5435 | rtcSetDeviceMemoryMonitorFunction(device,nullptr,nullptr); |
| 5436 | AssertNoError(device); |
| 5437 | return VerifyApplication::PASSED; |
| 5438 | } |
| 5439 | }; |
| 5440 | |
| 5441 | struct ParallelForExceptionTest1 : public VerifyApplication::Test |
nothing calls this directly
no test coverage detected