---
title: "reset(encoder:)"
framework: Compute Graph
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "computegraph/computegraphsimulation/reset(encoder:)"
---

# reset(encoder:)

Resets the simulation to its initial state, clearing all live elements and accumulated time.

## Declaration

```swift
final func reset(encoder: any MTLComputeCommandEncoder)
```

## Parameters

- `encoder`: The compute command encoder to encode the reset operation with.

## Discussion

Discussion The reset is encoded as a compute dispatch into encoder. You must commit the enclosing command buffer for the reset to take effect on the GPU.
