---
title: "controlDependency(with:dependentBlock:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/controldependency(with:dependentblock:name:)"
---

# controlDependency(with:dependentBlock:name:)

Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.

## Declaration

```swift
func controlDependency(with operations: [MPSGraphOperation], dependentBlock: @escaping MPSGraphControlFlowDependencyBlock, name: String?) -> [MPSGraphTensor]
```

## Parameters

- `operations`: Operations maked as control dependency for all ops created inside the dependent block
- `dependentBlock`: MPSGraphControlFlowDependencyBlock which is provided by caller to create dependent ops
- `name`: Name of scope

## Return Value

Return Value A valid MPSGraphTensor array with results returned from dependentBlock forwarded

## Discussion

Discussion This call blocks until execution has completed.
