| 72 | } |
| 73 | |
| 74 | int main(int argc, char* argv[]) |
| 75 | { |
| 76 | DeviceType deviceType = DeviceType::Default; |
| 77 | PhysicalDeviceRef physicalDevice; |
| 78 | std::string filterType = "RT"; |
| 79 | std::string colorFilename, albedoFilename, normalFilename; |
| 80 | std::string outputFilename, refFilename; |
| 81 | std::string weightsFilename; |
| 82 | Quality quality = Quality::Default; |
| 83 | Storage bufferStorage = Storage::Undefined; |
| 84 | bool hdr = false; |
| 85 | bool srgb = false; |
| 86 | bool directional = false; |
| 87 | float inputScale = std::numeric_limits<float>::quiet_NaN(); |
| 88 | bool cleanAux = false; |
| 89 | DataType dataType = DataType::Undefined; |
| 90 | int numRuns = 1; |
| 91 | int numThreads = -1; |
| 92 | int setAffinity = -1; |
| 93 | int maxMemoryMB = -1; |
| 94 | bool inplace = false; |
| 95 | double errorThreshold = -1; |
| 96 | int verbose = -1; |
| 97 | |
| 98 | // Parse the arguments |
| 99 | if (argc == 1) |
| 100 | { |
| 101 | printUsage(); |
| 102 | return 1; |
| 103 | } |
| 104 | |
| 105 | try |
| 106 | { |
| 107 | ArgParser args(argc, argv); |
| 108 | while (args.hasNext()) |
| 109 | { |
| 110 | std::string opt = args.getNextOpt(); |
| 111 | if (opt == "d" || opt == "dev" || opt == "device") |
| 112 | { |
| 113 | std::string value = args.getNext(); |
| 114 | if (isdigit(value[0])) |
| 115 | physicalDevice = fromString<int>(value); |
| 116 | else |
| 117 | deviceType = fromString<DeviceType>(value); |
| 118 | } |
| 119 | else if (opt == "f" || opt == "filter") |
| 120 | filterType = args.getNextValue(); |
| 121 | else if (opt == "hdr") |
| 122 | { |
| 123 | colorFilename = args.getNextValue(); |
| 124 | hdr = true; |
| 125 | } |
| 126 | else if (opt == "ldr") |
| 127 | { |
| 128 | colorFilename = args.getNextValue(); |
| 129 | hdr = false; |
| 130 | } |
| 131 | else if (opt == "srgb") |
nothing calls this directly
no test coverage detected