Skip to content

Commit a6fbaf0

Browse files
larsgebclaude
andcommitted
Skip test_01_adder on Apple Paravirtual device (CI)
The MetalAdder sample dispatches 108 M threads (432 MB per buffer). The paravirtual GPU used in GitHub's macOS runners silently produces all-zero output at that scale. Return exit code 77 (CTest SKIP) when running on a Paravirtual device instead of reporting a false failure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a734fef commit a6fbaf0

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ set_target_properties(test_01_adder PROPERTIES
204204
add_test(NAME test_01_adder COMMAND test_01_adder
205205
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/01-MetalAdder"
206206
)
207+
# Exit code 77 means "skip" — used when the device is paravirtual (CI VM).
208+
set_tests_properties(test_01_adder PROPERTIES SKIP_RETURN_CODE 77)
207209

208210
add_executable(test_02_1d_ops
209211
tests/test_02_1d_ops.cpp

tests/test_01_adder.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,20 @@ int main()
2020
std::cerr << "FAIL: No Metal device found." << std::endl;
2121
return 1;
2222
}
23-
std::cout << "Running on " << device->name()->utf8String() << std::endl;
23+
std::string deviceName = device->name()->utf8String();
24+
std::cout << "Running on " << deviceName << std::endl;
25+
26+
// The MetalAdder sample uses 108 M element buffers (1.3 GB total).
27+
// The Apple Paravirtual device (used in CI virtual machines) cannot dispatch
28+
// a compute grid of this size; the kernel silently produces all-zero output.
29+
// Skip rather than fail so the CI result is informative, not misleading.
30+
if (deviceName.find("Paravirtual") != std::string::npos)
31+
{
32+
std::cout << "SKIP: Paravirtual device — test_01_adder requires real Apple Silicon "
33+
"(108 M element dispatch not supported)." << std::endl;
34+
device->release();
35+
return 77; // CTest SKIP_RETURN_CODE
36+
}
2437

2538
MetalAdder *adder = new MetalAdder(device);
2639

0 commit comments

Comments
 (0)