Runtime

Runtime#

2026-10-23

2 min read time

Applies to Linux and Windows

The Runtime API provides higher-level building blocks for core HIP functionality. It takes the existing HIP runtime API set and removes or replaces some problematic patterns, such as implicit state. It is designed to make common operations like resource management, work submission, and memory allocation easier to express and safer to compose. These APIs lower to the HIP runtime/driver API under the hood, but remain composable with the HIP runtime API by reusing runtime handle types (such as hipStream_t) in the interfaces. This results in an interface that applies RAII for lifetime management, while remaining composable with existing HIP C++ code that manages resources explicitly.

At a glance, the runtime layer includes:

  • Streams and events work submission and synchronization.

  • Memory pools to allocate device memory, either synchronously or in stream order.

  • Launch API to configure and launch kernels.

  • Runtime algorithms like copy_bytes and fill_bytes for basic data movement.

  • Legacy memory resources as synchronous allocation interfaces for pinned and managed memory.

See HIP runtime interactions if you are interested in HIP runtime interop.

API

Content

Since

devices

A range of all available HIP devices

libhipcxx 3.4

device_ref

A non-owning representation of a HIP device

libhipcxx 3.4

stream_ref

A non-owning wrapper around a hipStream_t

libhipcxx 2.7

stream

An owning wrapper around a hipStream_t

libhipcxx 3.4

event_ref

A non-owning wrapper around a hipEvent_t

libhipcxx 3.4

event

An owning wrapper around a hipEvent_t (timing disabled)

libhipcxx 3.4

timed_event

An owning wrapper around a hipEvent_t with timing enabled and elapsed-time queries

libhipcxx 3.4

copy_bytes

Byte-wise copy into a cuda::stream_ref for cuda::std::span/cuda::std::mdspan sources and destinations

libhipcxx 3.4

fill_bytes

Byte-wise fill into a cuda::stream_ref for cuda::std::span/cuda::std::mdspan destinations

libhipcxx 3.4

hierarchy

Representation of HIP thread hierarchies (grid, block, warp, thread)

libhipcxx 3.4

launch

Kernel launch with configuration and options

libhipcxx 3.4

kernel_config

Kernel launch configuration combining hierarchy dimensions and launch options

libhipcxx 3.4

make_config

Factory function to create kernel configurations from hierarchy dimensions and launch options

libhipcxx 3.4

device_memory_pool

Stream-ordered device memory pool using the HIP memory pool API

libhipcxx 3.4

device_default_memory_pool

Get the default device memory pool for a device

libhipcxx 3.4

legacy resources

Synchronous compatibility resources backed by legacy HIP allocation APIs.

libhipcxx 3.4