| 130 | |
| 131 | |
| 132 | std::unique_ptr<Pipeline> GetExternalSourcePipeline(bool no_copy, const std::string &device) { |
| 133 | int dev = device == "cpu" ? CPU_ONLY_DEVICE_ID : device_id; |
| 134 | auto pipe_ptr = std::make_unique<Pipeline>(batch_size, num_thread, dev, seed, pipelined, |
| 135 | prefetch_queue_depth, async); |
| 136 | auto &pipe = *pipe_ptr; |
| 137 | |
| 138 | pipe.AddOperator(OpSpec("ExternalSource") |
| 139 | .AddArg("device", device) |
| 140 | .AddArg("name", input_name) |
| 141 | .AddArg("no_copy", no_copy) |
| 142 | .AddOutput(input_name, ParseStorageDevice(device)), input_name); |
| 143 | // Some Op |
| 144 | pipe.AddOperator(OpSpec("Resize") |
| 145 | .AddArg("device", device) |
| 146 | .AddArg("image_type", DALI_RGB) |
| 147 | .AddArg("resize_x", output_size) |
| 148 | .AddArg("resize_y", output_size) |
| 149 | .AddInput(input_name, ParseStorageDevice(device)) |
| 150 | .AddOutput(output_name, ParseStorageDevice(device))); |
| 151 | |
| 152 | std::vector<std::pair<std::string, std::string>> outputs = {{output_name, device}}; |
| 153 | |
| 154 | pipe.SetOutputDescs(outputs); |
| 155 | return pipe_ptr; |
| 156 | } |
| 157 | |
| 158 | |
| 159 | // Takes Outputs from baseline and handle and compares them |
no test coverage detected