<!--
{
  "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/BNNSGraphCompileOptionsSetOutputFD(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@BNNSGraphCompileOptionsSetOutputFD"
  },
  "title" : "BNNSGraphCompileOptionsSetOutputFD(_:_:)"
}
-->

# BNNSGraphCompileOptionsSetOutputFD(_:_:)

Sets the option for graph compilation to generate the graph object directly to the specified file descriptor.

```
func BNNSGraphCompileOptionsSetOutputFD(_ options: bnns_graph_compile_options_t, _ fd: Int32)
```

## Parameters

`options`

The compilation options object.

`fd`

The destination file descriptor. Pass `-1` to reset to the default behavior of strictly in-memory graph generation or the path that [`BNNSGraphCompileOptionsSetOutputPath(_:_:)`](/documentation/Accelerate/BNNSGraphCompileOptionsSetOutputPath(_:_:)) specifies.

    The file that the descriptor indicates must be open for writing. Graph compilation truncates and completely overwrites the file.

## Discussion

Use this option to specify that the graph [`BNNSGraphCompileFromFile(_:_:_:)`](/documentation/Accelerate/BNNSGraphCompileFromFile(_:_:_:)) returns is a read-only memory-mapped file.

The option reduces the memory that compilation requires because BNNS doesn’t require the full set of graph weights to be memory resident.

Note that this option overrides the path that [`BNNSGraphCompileOptionsSetOutputPath(_:_:)`](/documentation/Accelerate/BNNSGraphCompileOptionsSetOutputPath(_:_:)) sets.

---

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)