<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSGraphContextMake(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@BNNSGraphContextMake"
  },
  "title" : "BNNSGraphContextMake(_:)"
}
-->

# BNNSGraphContextMake(_:)

Returns an allocated and initialized graph context from the specified graph.

```
func BNNSGraphContextMake(_ graph: bnns_graph_t) -> bnns_graph_context_t
```

## Parameters

`graph`

The compiled graph object.

## Return Value

A compiled graph context object. If the operation fails, the graph object’s [`data`](/documentation/Accelerate/bnns_graph_context_t/data) property is `nil`.

## Discussion

To prevent memory leaks, call [`BNNSGraphContextDestroy(_:)`](/documentation/Accelerate/BNNSGraphContextDestroy(_:)) when you’re finished using the graph context.

---

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)