Lines Matching refs:runtime
34 struct xnn_runtime* runtime = NULL; in xnn_create_runtime_v2() local
44 runtime = xnn_allocate_zero_memory(sizeof(struct xnn_runtime)); in xnn_create_runtime_v2()
45 if (runtime == NULL) { in xnn_create_runtime_v2()
50 runtime->ops = xnn_allocate_zero_memory(sizeof(struct xnn_operator_data) * subgraph->num_nodes); in xnn_create_runtime_v2()
51 if (runtime->ops == NULL) { in xnn_create_runtime_v2()
56 runtime->num_ops = subgraph->num_nodes; in xnn_create_runtime_v2()
67 &runtime->ops[i].op); in xnn_create_runtime_v2()
71 runtime->ops[i].shape1.num_dims = values[node->inputs.raw[0]].shape.num_dims; in xnn_create_runtime_v2()
72 runtime->ops[i].shape2.num_dims = values[node->inputs.raw[1]].shape.num_dims; in xnn_create_runtime_v2()
73 …memcpy(runtime->ops[i].shape1.dim, values[node->inputs.raw[0]].shape.dim, values[node->inputs.raw[… in xnn_create_runtime_v2()
74 …memcpy(runtime->ops[i].shape2.dim, values[node->inputs.raw[1]].shape.dim, values[node->inputs.raw[… in xnn_create_runtime_v2()
75 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
76 runtime->ops[i].inputs[1] = node->inputs.raw[1]; in xnn_create_runtime_v2()
77 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
101 &runtime->ops[i].op); in xnn_create_runtime_v2()
105 runtime->ops[i].batch_size = values[node->inputs.raw[0]].shape.dim[0]; in xnn_create_runtime_v2()
106 runtime->ops[i].input_height = values[node->inputs.raw[0]].shape.dim[1]; in xnn_create_runtime_v2()
107 runtime->ops[i].input_width = values[node->inputs.raw[0]].shape.dim[2]; in xnn_create_runtime_v2()
108 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
109 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
119 &runtime->ops[i].op); in xnn_create_runtime_v2()
123 runtime->ops[i].batch_size = 1; in xnn_create_runtime_v2()
125 runtime->ops[i].batch_size *= values[node->inputs.raw[0]].shape.dim[i]; in xnn_create_runtime_v2()
127 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
128 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
152 &runtime->ops[i].op); in xnn_create_runtime_v2()
156 runtime->ops[i].batch_size = values[node->inputs.raw[0]].shape.dim[0]; in xnn_create_runtime_v2()
157 runtime->ops[i].input_height = values[node->inputs.raw[0]].shape.dim[1]; in xnn_create_runtime_v2()
158 runtime->ops[i].input_width = values[node->inputs.raw[0]].shape.dim[2]; in xnn_create_runtime_v2()
159 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
160 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
168 &runtime->ops[i].op); in xnn_create_runtime_v2()
172 runtime->ops[i].batch_size = 1; in xnn_create_runtime_v2()
174 runtime->ops[i].batch_size *= values[node->inputs.raw[0]].shape.dim[i]; in xnn_create_runtime_v2()
176 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
177 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
184 &runtime->ops[i].op); in xnn_create_runtime_v2()
188 runtime->ops[i].shape1.num_dims = values[node->inputs.raw[0]].shape.num_dims; in xnn_create_runtime_v2()
189 runtime->ops[i].shape2.num_dims = values[node->inputs.raw[1]].shape.num_dims; in xnn_create_runtime_v2()
190 …memcpy(runtime->ops[i].shape1.dim, values[node->inputs.raw[0]].shape.dim, values[node->inputs.raw[… in xnn_create_runtime_v2()
191 …memcpy(runtime->ops[i].shape2.dim, values[node->inputs.raw[1]].shape.dim, values[node->inputs.raw[… in xnn_create_runtime_v2()
192 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
193 runtime->ops[i].inputs[1] = node->inputs.raw[1]; in xnn_create_runtime_v2()
194 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
205 &runtime->ops[i].op); in xnn_create_runtime_v2()
209 runtime->ops[i].batch_size = 1; in xnn_create_runtime_v2()
211 runtime->ops[i].batch_size *= values[node->inputs.raw[0]].shape.dim[i]; in xnn_create_runtime_v2()
213 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
214 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
222 &runtime->ops[i].op); in xnn_create_runtime_v2()
226 runtime->ops[i].batch_size = 1; in xnn_create_runtime_v2()
228 runtime->ops[i].batch_size *= values[node->inputs.raw[0]].shape.dim[i]; in xnn_create_runtime_v2()
230 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
231 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
239 &runtime->ops[i].op); in xnn_create_runtime_v2()
243 runtime->ops[i].batch_size = 1; in xnn_create_runtime_v2()
245 runtime->ops[i].batch_size *= values[node->inputs.raw[0]].shape.dim[i]; in xnn_create_runtime_v2()
247 runtime->ops[i].inputs[0] = node->inputs.raw[0]; in xnn_create_runtime_v2()
248 runtime->ops[i].outputs[0] = node->outputs.raw[0]; in xnn_create_runtime_v2()
257 runtime->blobs = xnn_allocate_zero_memory(sizeof(struct xnn_blob) * subgraph->num_values); in xnn_create_runtime_v2()
258 if (runtime->blobs == NULL) { in xnn_create_runtime_v2()
263 runtime->num_blobs = subgraph->num_values; in xnn_create_runtime_v2()
268 struct xnn_blob* blob = &runtime->blobs[i]; in xnn_create_runtime_v2()
284 runtime->workspace = xnn_allocate_simd_memory(buffer_size); in xnn_create_runtime_v2()
285 if (runtime->workspace == NULL) { in xnn_create_runtime_v2()
293 struct xnn_blob* blob = &runtime->blobs[i]; in xnn_create_runtime_v2()
297 blob->data = (void*) ((uintptr_t) runtime->workspace + buffer_offset); in xnn_create_runtime_v2()
303 runtime->threadpool = threadpool; in xnn_create_runtime_v2()
305 *runtime_out = runtime; in xnn_create_runtime_v2()
309 xnn_delete_runtime(runtime); in xnn_create_runtime_v2()
314 xnn_runtime_t runtime, in xnn_setup_runtime() argument
323 if (value_id >= runtime->num_blobs) { in xnn_setup_runtime()
329 const struct xnn_blob* blob = &runtime->blobs[value_id]; in xnn_setup_runtime()
340 struct xnn_blob* blob = &runtime->blobs[value_id]; in xnn_setup_runtime()
344 for (size_t i = 0; i < runtime->num_ops; i++) { in xnn_setup_runtime()
345 const struct xnn_operator_data* op = &runtime->ops[i]; in xnn_setup_runtime()
349 assert(runtime->blobs[op->inputs[0]].data != NULL); in xnn_setup_runtime()
350 assert(runtime->blobs[op->inputs[1]].data != NULL); in xnn_setup_runtime()
351 assert(runtime->blobs[op->outputs[0]].data != NULL); in xnn_setup_runtime()
358 runtime->blobs[op->inputs[0]].data, in xnn_setup_runtime()
359 runtime->blobs[op->inputs[1]].data, in xnn_setup_runtime()
360 runtime->blobs[op->outputs[0]].data, in xnn_setup_runtime()
361 runtime->threadpool); in xnn_setup_runtime()
364 assert(runtime->blobs[op->inputs[0]].data != NULL); in xnn_setup_runtime()
365 assert(runtime->blobs[op->outputs[0]].data != NULL); in xnn_setup_runtime()
371 runtime->blobs[op->inputs[0]].data, in xnn_setup_runtime()
372 runtime->blobs[op->outputs[0]].data, in xnn_setup_runtime()
373 runtime->threadpool); in xnn_setup_runtime()
376 assert(runtime->blobs[op->inputs[0]].data != NULL); in xnn_setup_runtime()
377 assert(runtime->blobs[op->outputs[0]].data != NULL); in xnn_setup_runtime()
381 runtime->blobs[op->inputs[0]].data, in xnn_setup_runtime()
382 runtime->blobs[op->outputs[0]].data, in xnn_setup_runtime()
383 runtime->threadpool); in xnn_setup_runtime()
386 assert(runtime->blobs[op->inputs[0]].data != NULL); in xnn_setup_runtime()
387 assert(runtime->blobs[op->outputs[0]].data != NULL); in xnn_setup_runtime()
391 runtime->blobs[op->inputs[0]].data, in xnn_setup_runtime()
392 runtime->blobs[op->outputs[0]].data, in xnn_setup_runtime()
393 runtime->threadpool); in xnn_setup_runtime()
396 assert(runtime->blobs[op->inputs[0]].data != NULL); in xnn_setup_runtime()
397 assert(runtime->blobs[op->inputs[1]].data != NULL); in xnn_setup_runtime()
398 assert(runtime->blobs[op->outputs[0]].data != NULL); in xnn_setup_runtime()
405 runtime->blobs[op->inputs[0]].data, in xnn_setup_runtime()
406 runtime->blobs[op->inputs[1]].data, in xnn_setup_runtime()
407 runtime->blobs[op->outputs[0]].data, in xnn_setup_runtime()
408 runtime->threadpool); in xnn_setup_runtime()
411 assert(runtime->blobs[op->inputs[0]].data != NULL); in xnn_setup_runtime()
412 assert(runtime->blobs[op->outputs[0]].data != NULL); in xnn_setup_runtime()
416 runtime->blobs[op->inputs[0]].data, in xnn_setup_runtime()
417 runtime->blobs[op->outputs[0]].data, in xnn_setup_runtime()
418 runtime->threadpool); in xnn_setup_runtime()
421 assert(runtime->blobs[op->inputs[0]].data != NULL); in xnn_setup_runtime()
422 assert(runtime->blobs[op->outputs[0]].data != NULL); in xnn_setup_runtime()
426 runtime->blobs[op->inputs[0]].data, in xnn_setup_runtime()
427 runtime->blobs[op->outputs[0]].data, in xnn_setup_runtime()
428 runtime->threadpool); in xnn_setup_runtime()
431 assert(runtime->blobs[op->inputs[0]].data != NULL); in xnn_setup_runtime()
432 assert(runtime->blobs[op->outputs[0]].data != NULL); in xnn_setup_runtime()
436 runtime->blobs[op->inputs[0]].data, in xnn_setup_runtime()
437 runtime->blobs[op->outputs[0]].data, in xnn_setup_runtime()
438 runtime->threadpool); in xnn_setup_runtime()
454 xnn_runtime_t runtime) in xnn_invoke_runtime() argument
456 for (size_t i = 0; i < runtime->num_ops; i++) { in xnn_invoke_runtime()
457 const enum xnn_status status = xnn_run_operator(runtime->ops[i].op, runtime->threadpool); in xnn_invoke_runtime()
466 xnn_runtime_t runtime) in xnn_delete_runtime() argument
468 if (runtime != NULL) { in xnn_delete_runtime()
469 if (runtime->ops != NULL) { in xnn_delete_runtime()
470 for (size_t i = 0; i < runtime->num_ops; i++) { in xnn_delete_runtime()
471 xnn_delete_operator(runtime->ops[i].op); in xnn_delete_runtime()
473 xnn_release_memory(runtime->ops); in xnn_delete_runtime()
475 xnn_release_memory(runtime->blobs); in xnn_delete_runtime()
476 xnn_release_memory(runtime->workspace); in xnn_delete_runtime()
478 xnn_release_memory(runtime); in xnn_delete_runtime()