---
title: "ClikaRT::placement"
sidebar_label: "placement"
description: "Namespace ClikaRT::placement"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--namespace">namespace</span>

## Classes

| Name | Description |
| --- | --- |
| [`PlacementScope`](./PlacementScope.md) | RAII region: sets the calling thread's ambient placement on construction and restores the previous one on destruction (normal exit and exception unwind alike). Scopes nest; each restores exactly what it displaced. Not copyable or movable: the scope is bound to the thread and region that created it. |

## Functions

### ambient() {#ambient}

<div class="api-signature">

[`StreamOrDevice`](../StreamOrDevice.md) **`ambient`**()

</div>

The calling thread's ambient placement. Unspecified when none is set.

<div class="api-declared">

Declared in `ClikaRT/compute/placement.h`, line 35

</div>

### set\_ambient() {#set_ambient}

<div class="api-signature">

[`StreamOrDevice`](../StreamOrDevice.md) **`set_ambient`**([`StreamOrDevice`](../StreamOrDevice.md) `value`)

</div>

Replace the calling thread's ambient placement and return the previous one. Pass a default-constructed (unspecified) value to clear it. Prefer [`PlacementScope`](./PlacementScope.md) for region-shaped use; this is the primitive it rides.

<div class="api-declared">

Declared in `ClikaRT/compute/placement.h`, line 40

</div>
