[AOTInductor] Make the unsupported-device path in aoti_inference tests fail (#194657)
Summary: `testing::AssertionFailure()` returns an `AssertionResult`. Streaming into it and discarding the temporary registers nothing -- a failure is only recorded when the result is passed to `EXPECT_TRUE`/`ASSERT_TRUE` or returned from a predicate. So the `else` arm of the device dispatch in these tests is a silent no-op today. That matters beyond the missing message: each of these functions leaves `runner` as a default-constructed `std::unique_ptr` and dereferences it immediately after the dispatch. An unsupported device value -- or `"cuda"` in a build where neither `USE_CUDA` nor `USE_ROCM` is defined, which compiles the `cuda` arm out -- falls straight through to a null dereference instead of a test failure. The current test registrations guard the `cuda` cases behind the same `#if`, so this is latent rather than live, but it depends on the registrations and the dispatch staying in sync. `FAIL()` both records the failure and returns, so the null dereference cannot follow. It is already the idiom used at one site in this same file (`test_multi_cuda_streams`); this makes the other four consistent with it. All four enclosing functions return `void`, which `FAIL()` requires. Differential Revision: D117248586 Pull Request resolved: https://github.com/pytorch/pytorch/pull/194657 Approved by: https://github.com/desertfire
J
Joshua Su committed
20e11d662606a2196e3cfe356f4181b5e8b0acf3
Parent: 404bc9e
Committed by PyTorch MergeBot <pytorchmergebot@users.noreply.github.com>
on 8/25/2026, 4:07:21 AM