| 370 | } |
| 371 | |
| 372 | Status InferenceContext::Profile(ProfilingCommandQueue* queue, |
| 373 | ProfilingInfo* result) { |
| 374 | queue->ResetMeasurements(); |
| 375 | for (auto& node : nodes_) { |
| 376 | queue->SetEventsLabel(node.name); |
| 377 | RETURN_IF_ERROR(node.operations[0]->AddToQueue(queue)); |
| 378 | } |
| 379 | RETURN_IF_ERROR(queue->WaitForCompletion()); |
| 380 | *result = queue->GetProfilingInfo(); |
| 381 | return OkStatus(); |
| 382 | } |
| 383 | |
| 384 | Tensor* InferenceContext::GetTensor(ValueId id) { |
| 385 | return &tensors_[remap_from_graph_ids_to_shared_[id]]; |