<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTL4CounterHeap/resolveCounterRange(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So15MTL4CounterHeapP5MetalE07resolveB5Rangey10Foundation4DataVSgSnySiGKF"
  },
  "title" : "resolveCounterRange(_:)"
}
-->

# resolveCounterRange(_:)

Resolves heap data on the CPU timeline.

```
func resolveCounterRange(_ range: Range<Int>) throws -> Data?
```

## Parameters

`range`

The range in the heap to resolve.

## Discussion

This method resolves heap data in the CPU timeline. Your app needs to ensure the GPU work has completed in order to
retrieve the data correctly. You can alternatively resolve the heap data in the GPU timeline by calling
`MTL4CommandBuffer/resolveCounterHeap:withRange:intoBuffer:atOffset:waitFence:updateFence:`.

- Returns a newly allocated autoreleased NSData containing tightly packed resolved heap counter values.

> Note: When resolving counters in the CPU timeline, signaling an instance of ``doc://com.apple.metal/documentation/Metal/MTLSharedEvent`` after any workloads
> write counters (and waiting on that signal on the CPU) is sufficient to ensure synchronization.

---

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)