Skip to content

Commit 3a46d57

Browse files
committed
More logs
1 parent 2846aec commit 3a46d57

File tree

1 file changed

+18
-9
lines changed
  • examples_tests/48.ArithmeticUnitTest

1 file changed

+18
-9
lines changed

examples_tests/48.ArithmeticUnitTest/main.cpp

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class ArythmeticUnitTestApp : public NonGraphicalApplicationBase
300300
void onAppInitialized_impl() override
301301
{
302302
CommonAPI::InitOutput initOutput;
303-
CommonAPI::InitWithNoExt(initOutput, nbl::video::EAT_OPENGL, "Subgroup Arithmetic Test");
303+
CommonAPI::InitWithNoExt(initOutput, nbl::video::EAT_VULKAN, "Subgroup Arithmetic Test");
304304
gl = std::move(initOutput.apiConnection);
305305
gpuPhysicalDevice = std::move(initOutput.physicalDevice);
306306
logicalDevice = std::move(initOutput.logicalDevice);
@@ -405,6 +405,17 @@ class ArythmeticUnitTestApp : public NonGraphicalApplicationBase
405405
// no need to wait on fences because its only a shader create, does not result in the filling of image or buffers
406406
};
407407

408+
auto logTestOutcome = [this](bool passed, uint32_t workgroupSize)
409+
{
410+
if (passed)
411+
logger->log("Passed test #%u", system::ILogger::ELL_INFO, workgroupSize);
412+
else
413+
{
414+
totalFailCount++;
415+
logger->log("Failed test #%u", system::ILogger::ELL_ERROR, workgroupSize);
416+
}
417+
};
418+
408419
//max workgroup size is hardcoded to 1024
409420
const auto ds = descriptorSet.get();
410421
auto computeQueue = initOutput.queues[CommonAPI::InitOutput::EQT_COMPUTE];
@@ -423,19 +434,17 @@ class ArythmeticUnitTestApp : public NonGraphicalApplicationBase
423434

424435
const video::IGPUDescriptorSet* ds = descriptorSet.get();
425436
passed = runTest<emulatedSubgroupReduction>(logicalDevice.get(), computeQueue, fence.get(), cmdbuf.get(), pipelines[0u].get(), descriptorSet.get(), inputData, workgroupSize, buffers, logger.get()) && passed;
437+
logTestOutcome(passed, workgroupSize);
426438
passed = runTest<emulatedSubgroupScanExclusive>(logicalDevice.get(), computeQueue, fence.get(), cmdbuf.get(), pipelines[1u].get(), descriptorSet.get(), inputData, workgroupSize, buffers, logger.get()) && passed;
439+
logTestOutcome(passed, workgroupSize);
427440
passed = runTest<emulatedSubgroupScanInclusive>(logicalDevice.get(), computeQueue, fence.get(), cmdbuf.get(), pipelines[2u].get(), descriptorSet.get(), inputData, workgroupSize, buffers, logger.get()) && passed;
441+
logTestOutcome(passed, workgroupSize);
428442
passed = runTest<emulatedWorkgroupReduction>(logicalDevice.get(), computeQueue, fence.get(), cmdbuf.get(), pipelines[3u].get(), descriptorSet.get(), inputData, workgroupSize, buffers, logger.get(), true) && passed;
443+
logTestOutcome(passed, workgroupSize);
429444
passed = runTest<emulatedWorkgroupScanExclusive>(logicalDevice.get(), computeQueue, fence.get(), cmdbuf.get(), pipelines[4u].get(), descriptorSet.get(), inputData, workgroupSize, buffers, logger.get(), true) && passed;
445+
logTestOutcome(passed, workgroupSize);
430446
passed = runTest<emulatedWorkgroupScanInclusive>(logicalDevice.get(), computeQueue, fence.get(), cmdbuf.get(), pipelines[5u].get(), descriptorSet.get(), inputData, workgroupSize, buffers, logger.get(), true) && passed;
431-
432-
if (passed)
433-
logger->log("Passed test #%u", system::ILogger::ELL_INFO, workgroupSize);
434-
else
435-
{
436-
totalFailCount++;
437-
logger->log("Failed test #%u", system::ILogger::ELL_ERROR, workgroupSize);
438-
}
447+
logTestOutcome(passed, workgroupSize);
439448
}
440449
computeQueue->endCapture();
441450
}

0 commit comments

Comments
 (0)