| 222 | |
| 223 | template <typename Kernel, typename... Args> |
| 224 | static void runCase(const char *label, Kernel &&kernel, Args &&...args) { |
| 225 | try { |
| 226 | std::string demText = |
| 227 | cudaq::dem_from_kernel(std::forward<Kernel>(kernel), &g_emptyNoise, |
| 228 | std::forward<Args>(args)...); |
| 229 | // Tally distinct DEM instructions. |
| 230 | std::printf("%s errors=%zu detectors=%zu observables=%zu\n", label, |
| 231 | countOccurrences(demText, "error("), |
| 232 | maxIndexAfter(demText, 'D'), maxIndexAfter(demText, 'L')); |
| 233 | } catch (const std::exception &e) { |
| 234 | std::printf("%s THREW: %s\n", label, e.what()); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | static void runTrivial() { |
| 239 | try { |
no test coverage detected