---
title: "BNNSGraphContextMake(_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/bnnsgraphcontextmake(_:)"
---

# BNNSGraphContextMake(_:)

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

## Declaration

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

## Parameters

- `graph`: The compiled graph object.

## Return Value

Return Value A compiled graph context object. If the operation fails, the graph object’s data property is nil.

## Discussion

Discussion To prevent memory leaks, call BNNSGraphContextDestroy(_:) when you’re finished using the graph context.

## See Also

### Creating and destroying a context

- [bnns_graph_context_t](accelerate/bnns_graph_context_t.md)
- [BNNSGraphContextMakeStreaming(_:_:_:_:)](accelerate/bnnsgraphcontextmakestreaming(_:_:_:_:).md)
- [BNNSGraphContextDestroy(_:)](accelerate/bnnsgraphcontextdestroy(_:).md)
