| 1517 | #endif // defined(OIDN_FILTER_RT) |
| 1518 | |
| 1519 | int main(int argc, char* argv[]) |
| 1520 | { |
| 1521 | Catch::Session session; |
| 1522 | |
| 1523 | std::string deviceStr = "default"; |
| 1524 | |
| 1525 | using namespace Catch::clara; |
| 1526 | auto cli |
| 1527 | = session.cli() |
| 1528 | | Opt(deviceStr, "[0-9]+|default|cpu|sycl|cuda|hip|metal") |
| 1529 | ["--device"] |
| 1530 | ("Open Image Denoise device to use"); |
| 1531 | |
| 1532 | session.cli(cli); |
| 1533 | |
| 1534 | int returnCode = session.applyCommandLine(argc, argv); |
| 1535 | if (returnCode != 0) |
| 1536 | return returnCode; |
| 1537 | |
| 1538 | try |
| 1539 | { |
| 1540 | if (isdigit(deviceStr[0])) |
| 1541 | physicalDevice = fromString<int>(deviceStr); |
| 1542 | else |
| 1543 | deviceType = fromString<DeviceType>(deviceStr); |
| 1544 | } |
| 1545 | catch (const std::exception& e) |
| 1546 | { |
| 1547 | std::cerr << "Error: " << e.what() << std::endl; |
| 1548 | return 1; |
| 1549 | } |
| 1550 | |
| 1551 | return session.run(); |
| 1552 | } |
nothing calls this directly
no test coverage detected