1.3.72
 
Loading...
Searching...
No Matches
helios::TestVulkanDeviceManager Class Reference

Shared Vulkan device singleton for test process. More...

#include <test_helpers.h>

Public Member Functions

 TestVulkanDeviceManager (const TestVulkanDeviceManager &)=delete
 
TestVulkanDeviceManageroperator= (const TestVulkanDeviceManager &)=delete
 

Static Public Member Functions

static bool isVulkanAvailable ()
 Check if a functional Vulkan device is available for testing.
 
static void markGPURuntimeFailed ()
 Mark GPU as unavailable due to a runtime failure (e.g., VK_ERROR_DEVICE_LOST)
 

Detailed Description

Shared Vulkan device singleton for test process.

INTERNAL TEST-ONLY HELPER - NOT FOR PRODUCTION USE

Purpose: Work around NVIDIA driver bug where >25 vkCreateInstance/vkDestroyInstance cycles in same process cause VK_ERROR_INCOMPATIBLE_DRIVER.

Solution: Share single VulkanDevice across all 78 tests in the binary. Device created on first use, destroyed at process exit via atexit().

Thread Safety: Not thread-safe (tests run sequentially in selfTest.cpp).

Validation: Disabled for test performance (20-30% faster).

If Vulkan is not available (e.g., CI runners without GPUs), initialization fails gracefully and isVulkanAvailable() returns false.

References:

Definition at line 51 of file test_helpers.h.

Member Function Documentation

◆ isVulkanAvailable()

static bool helios::TestVulkanDeviceManager::isVulkanAvailable ( )
inlinestatic

Check if a functional Vulkan device is available for testing.

Returns
True if Vulkan device was successfully initialized and no runtime failure has occurred

Triggers device initialization on first call if not already attempted. Also returns false if a GPU runtime failure (e.g., VK_ERROR_DEVICE_LOST) has been detected during test execution.

Definition at line 113 of file test_helpers.h.

◆ markGPURuntimeFailed()

static void helios::TestVulkanDeviceManager::markGPURuntimeFailed ( )
inlinestatic

Mark GPU as unavailable due to a runtime failure (e.g., VK_ERROR_DEVICE_LOST)

Called when a GPU test encounters a runtime failure that indicates the device cannot actually execute compute work. Once marked, all subsequent GPU tests skip.

Definition at line 130 of file test_helpers.h.


The documentation for this class was generated from the following file: