<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAI",
  "identifier" : "/documentation/CoreAI/ComputeStream/init(commandQueue:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core AI"
    ],
    "preciseIdentifier" : "s:13CoreAIRuntime13ComputeStreamC12commandQueueACSo010MTLCommandF0_p_tcfc"
  },
  "title" : "init(commandQueue:)"
}
-->

# init(commandQueue:)

Initialize a compute stream which will encode its work to the provided command queue.

```
init(commandQueue: any MTLCommandQueue)
```

## Parameters

`commandQueue`

The queue which inference will be encoded to when running [`encode(inputs:states:outputViews:to:)`](/documentation/CoreAI/InferenceFunction/encode(inputs:states:outputViews:to:)).

## Discussion

You can use this to encode inferences to your own metal queue.

---

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)