<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/MPSGraph/controlDependency(with:dependentBlock:name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal Performance Shaders Graph",
      "MetalPerformanceShadersGraph"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSGraph(im)controlDependencyWithOperations:dependentBlock:name:"
  },
  "title" : "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.

```
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

A valid MPSGraphTensor array with results returned from dependentBlock forwarded

## Discussion

This call blocks until execution has completed.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)