> This page is for version 3.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 3.0 (Latest) (default): https://docs.nvidia.com/holoscan/sensor-bridge/3-0/llms.txt
> - 2.7: https://docs.nvidia.com/holoscan/sensor-bridge/2-7/llms.txt
> - Archives: https://docs.nvidia.com/holoscan/sensor-bridge/archives/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sensor-bridge/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sensor-bridge/_mcp/server.

# hololink::module::round_up

> Round a value up to a multiple of an alignment.

```cpp showLineNumbers={false}
inline size_t hololink::module::round_up(
    size_t value,
    size_t alignment
)
```

Round a value up to a multiple of an alignment.

Used to size and place buffers so they start and end on the boundaries the hardware or an API requires, for example `round_up(size, PAGE_SIZE)`.

The alignment may be any positive value; it need not be a power of two. A `value` that is already a multiple of `alignment` (including zero) is returned unchanged.

**Returns:** The smallest multiple of `alignment` that is not less than `value`.

**Throws:** `std::runtime_error` if `alignment` is zero.

**Throws:** `std::overflow_error` if the rounded result is too large to be represented in a `size_t`.

**Parameters**

**`value`** `size_t`

The size or offset to round.

---

**`alignment`** `size_t`

The multiple to round up to. Must be greater than zero.

---