---
title: "Stream"
sidebar_label: "Stream"
description: "Kotlin binding reference: Stream."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Stream](index.md)

# Stream

[common]\
class [Stream](index.md) : [Placement](../Placement/index.md)

An execution stream: an ordered queue of device work. Work placed on a stream you [create](Companion/create.md) is pipelined, so the host keeps queueing while the device runs, and two such streams overlap independent work. The per-device [defaultStream](Companion/defaultStream.md) runs each operation on the calling thread instead: the explicit opt-in to synchronous execution.

AutoCloseable: [close](close.md) releases this handle (the stream itself outlives its handles).

## Types

| Name | Summary |
|---|---|
| [Companion](Companion/index.md) | [common]<br>object [Companion](Companion/index.md) |

## Properties

| Name | Summary |
|---|---|
| [device](device.md) | [common]<br>val [device](device.md): [Device](../Device/index.md)<br>The device this stream runs on. |
| [isDefault](isDefault.md) | [common]<br>val [isDefault](isDefault.md): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)<br>True if this is the device's default stream. |
| [isIdle](isIdle.md) | [common]<br>val [isIdle](isIdle.md): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)<br>True if the stream currently has no work in flight (a hint, not a barrier). |

## Functions

| Name | Summary |
|---|---|
| [close](close.md) | [common]<br>open fun [close](close.md)() |
| [synchronize](synchronize.md) | [common]<br>fun [synchronize](synchronize.md)()<br>Block until all work submitted on this stream has completed. |