---
title: "runAsync(on:inputs:results:executionDescriptor:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraphexecutable/runasync(on:inputs:results:executiondescriptor:)"
---

# runAsync(on:inputs:results:executionDescriptor:)

Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately.

## Declaration

```swift
func runAsync(on commandQueue: any MTL4CommandQueue, inputs inputsArray: [MPSGraphTensorData], results resultsArray: [MPSGraphTensorData]?, executionDescriptor: MPSGraphExecutableExecutionDescriptor?) -> [MPSGraphTensorData]
```

## Parameters

- `commandQueue`: MTL4CommandQueue passed to exectute the graph on.
- `inputsArray`: Feeds tensorData for the placeholder tensors, same order as arguments of main function.
- `resultsArray`: Tensors for which the caller wishes MPSGraphTensorData to be returned.
- `executionDescriptor`: ExecutionDescriptor to be passed in and used.

## Return Value

Return Value A valid MPSGraphTensorData array with results synchronized to the CPU memory if MPSGraphOptionsSynchronizeResults set.
