> For the complete documentation index, see [llms.txt](https://docs.natml.ai/unity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.natml.ai/unity/api/mlmodel/mledgemodel/configuration.md).

# Configuration

The `Configuration` type provides the ability to customize how edge models are created and executed on the local device.

## Creating the Model Configuration

```csharp
/// <summary>
/// Create a configuration
/// </summary>
Configuration ();
```

The `Configuration` defines a trivial constructor.

## Specifying the Compute Target

```csharp
/// <summary>
/// Specify the compute target used for model predictions.
/// </summary>
ComputeTarget computeTarget { get; set; }
```

The `computeTarget` is used to specify the compute target that will be used to accelerate model predictions:

### Compute Target

```csharp
/// <summary>
/// Compute target used for model predictions.
/// </summary>
enum ComputeTarget : int {
    /// <summary>
    /// Use the default compute target for the given platform.
    /// </summary>
    Default = 0,
    /// <summary>
    /// Use the CPU.
    /// </summary>
    CPU     = 1 << 0,
    /// <summary>
    /// Use the GPU.
    /// </summary>
    GPU     = 1 << 1,
    /// <summary>
    /// Use the neural processing unit.
    /// </summary>
    NPU     = 1 << 2,
    /// <summary>
    /// Use all available compute targets including the CPU, GPU, and neural processing units.
    /// </summary>
    All     = CPU | GPU | NPU,
}
```

{% hint style="info" %}
The `ComputeTarget` enumeration is defined in the [`MLEdgeModel`](/unity/api/mlmodel/mledgemodel.md) class.
{% endhint %}

## Specifying the Compute Device

```csharp
/// <summary>
/// Specify the compute device used for model predictions.
/// The native type of this pointer is platform-specific.
/// </summary>
IntPtr computeDevice { get; set; }
```

On systems with multiple GPU's, the model data allows for specifying the preferred compute device for accelerating model predictions.

{% hint style="info" %}
Set this field to `IntPtr.Zero` to use the default compute device.
{% endhint %}

{% hint style="success" %}
The `computeDevice` is exposed as an opaque pointer to a platform-specific type:

* On iOS and macOS, this pointer is an [`id<MTLDevice>`](https://developer.apple.com/documentation/metal/mtldevice?language=objc).
* On Windows, this pointer is an [`ID3D12Device`](https://docs.microsoft.com/en-us/windows/win32/api/d3d12/nn-d3d12-id3d12device).
  {% endhint %}
