MCPcopy Create free account
hub / github.com/OAID/Tengine / main

Function main

internal/bin/test_transpose.cpp:229–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229int main(int argc, char* argv[])
230{
231 int c = 2, h = 1, w = 3;
232 const char* test_node_name = "test";
233 int data_type = TENGINE_DT_FP32;
234 int layout = TENGINE_LAYOUT_NCHW;
235 // float negative_slope=0.0;
236 int res;
237
238 while((res = getopt(argc, argv, "h:w:l:t:s")) != -1)
239 {
240 switch(res)
241 {
242 case 'h':
243 h = strtoul(optarg, NULL, 10);
244 break;
245
246 case 'w':
247 w = strtoul(optarg, NULL, 10);
248 break;
249
250 case 'l':
251 layout = strtoul(optarg, NULL, 10);
252 break;
253
254 case 't':
255 data_type = strtoul(optarg, NULL, 10);
256 break;
257
258 default:
259 break;
260 }
261 }
262
263 init_tengine();
264
265 graph_t graph = create_test_graph(test_node_name, c, h, w, layout, data_type);
266
267 if(graph == nullptr)
268 return 1;
269
270 /* set input */
271 void* i_buf = set_input_data(graph);
272
273 // prerun graph
274 if(prerun_graph(graph) < 0)
275 {
276 std::cerr << "prerun_graph failed: ERRNO: " << get_tengine_errno() << "\n";
277 return 1;
278 }
279 dump_graph(graph);
280 node_t test_node = get_graph_node(graph, test_node_name);
281
282 const char* dev = get_node_device(test_node);
283
284 std::cout << "node running on dev: " << dev << "\n";
285
286 if(run_graph(graph, 1) < 0)

Callers

nothing calls this directly

Calls 15

init_tengineFunction · 0.85
prerun_graphFunction · 0.85
get_tengine_errnoFunction · 0.85
dump_graphFunction · 0.85
get_graph_nodeFunction · 0.85
get_node_deviceFunction · 0.85
run_graphFunction · 0.85
get_graph_input_tensorFunction · 0.85
set_tensor_shapeFunction · 0.85
release_graph_nodeFunction · 0.85
postrun_graphFunction · 0.85
destroy_graphFunction · 0.85

Tested by

no test coverage detected