|
Gromacs
2027.0-dev-20261118-bc88ada
|
#include <testutils/include/testutils/hardware_test_fixture.h>
Hardware context for parameterized tests.
Represents either CPU or GPU execution context. Encapsulates device selection, activation, and context/stream access. Supports test naming and tracing with string representations. See file-level documentation for usage examples.
Public Member Functions | |
| TestHardwareContext (TestDevice *testDevice=nullptr) | |
| Constructor (nullptr for CPU context, valid pointer for GPU) | |
| std::string | description () const |
| Returns human-readable context description. | |
| std::string | testName () const |
| Returns sanitized name suitable for GoogleTest parameter names. | |
| std::optional< int > | gpuId () const |
| Returns GPU ID if this is a GPU context, std::nullopt otherwise. | |
| bool | isGpuTest () const |
| Returns true if this is a GPU context. | |
| const DeviceContext * | deviceContext () const |
| Get device context (nullptr for CPU) | |
| const DeviceStream * | deviceStream () const |
| Get device stream (nullptr for CPU) | |
| void | activate () const |
| Activate the context (set the device for GPU) | |
1.8.5