MCPcopy Create free account
hub / github.com/NVIDIA/DALI / GetExternalSourcePipeline

Function GetExternalSourcePipeline

dali/c_api/c_api_test.cc:132–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130
131
132std::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

Callers 2

TYPED_TESTFunction · 0.85
TestForceFlagRunFunction · 0.85

Calls 5

ParseStorageDeviceFunction · 0.85
AddOutputMethod · 0.80
SetOutputDescsMethod · 0.80
OpSpecClass · 0.50
AddOperatorMethod · 0.45

Tested by

no test coverage detected