---
title: "BNNSGraphCompileOptionsSetOutputPath(_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/bnnsgraphcompileoptionssetoutputpath(_:_:)"
---

# BNNSGraphCompileOptionsSetOutputPath(_:_:)

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

## Declaration

```swift
func BNNSGraphCompileOptionsSetOutputPath(_ options: bnns_graph_compile_options_t, _ path: UnsafePointer<CChar>?)
```

## Parameters

- `options`: The compilation options object.
- `path`: The destination file path. Pass nil to reset to the default behavior of strictly in-memory graph generation.

## Discussion

Discussion Use this option to specify that the graph 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. The generated file has 0600 permissions (read and write by the user only). Note that the BNNSGraphCompileOptionsSetOutputFD(_:_:) function overrides this option.

## See Also

### Specifying and querying compilation options

- [bnns_graph_compile_options_t](accelerate/bnns_graph_compile_options_t.md)
- [BNNSGraphCompileOptionsMakeDefault()](accelerate/bnnsgraphcompileoptionsmakedefault().md)
- [BNNSGraphCompileOptionsDestroy(_:)](accelerate/bnnsgraphcompileoptionsdestroy(_:).md)
- [BNNSGraphCompileOptionsGetOutputPath(_:)](accelerate/bnnsgraphcompileoptionsgetoutputpath(_:).md)
- [BNNSGraphCompileOptionsSetOutputFD(_:_:)](accelerate/bnnsgraphcompileoptionssetoutputfd(_:_:).md)
- [BNNSGraphCompileOptionsGetOutputFD(_:)](accelerate/bnnsgraphcompileoptionsgetoutputfd(_:).md)
- [BNNSGraphCompileOptionsSetTargetSingleThread(_:_:)](accelerate/bnnsgraphcompileoptionssettargetsinglethread(_:_:).md)
- [BNNSGraphCompileOptionsGetTargetSingleThread(_:)](accelerate/bnnsgraphcompileoptionsgettargetsinglethread(_:).md)
- [BNNSGraphCompileOptionsSetOptimizationPreference(_:_:)](accelerate/bnnsgraphcompileoptionssetoptimizationpreference(_:_:).md)
- [BNNSGraphCompileOptionsGetOptimizationPreference(_:)](accelerate/bnnsgraphcompileoptionsgetoptimizationpreference(_:).md)
- [BNNSGraphOptimizationPreference](accelerate/bnnsgraphoptimizationpreference.md)
- [BNNSGraphCompileOptionsSetGenerateDebugInfo(_:_:)](accelerate/bnnsgraphcompileoptionssetgeneratedebuginfo(_:_:).md)
- [BNNSGraphCompileOptionsGetGenerateDebugInfo(_:)](accelerate/bnnsgraphcompileoptionsgetgeneratedebuginfo(_:).md)
- [BNNSTargetSystemGeneric](accelerate/bnnstargetsystemgeneric.md)
