C++ Standard Library extensions in libhipcxx#
2026-10-07
2 min read time
libhipcxx provides HIP C++ developers with familiar Standard Library utilities to improve productivity and flatten the learning curve of HIP. However, there are many aspects of writing high-performance HIP C++ code that cannot be expressed through purely Standard conforming APIs. For these cases, libhipcxx also provides extensions of Standard Library utilities.
To use utilities that are extensions to Standard Library features, drop the std from both the
include path and namespace:
#include <cuda/atomic>
cuda::atomic<int, cuda::thread_scope_device> x;
For a full explanation of the namespace hierarchy, see HIP-specific abstractions and namespaces.
Available extensions#
libhipcxx provides extensions across synchronization, memory, math, and device-specific functionality. The following table lists each extension category with its key APIs:
Extension |
APIs |
Notes |
|---|---|---|
Thread-scope synchronization |
|
|
Functional utilities |
|
|
Math utilities |
|
|
Bit utilities |
|
|
Stream reference |
|
Type-safe wrapper around |
Memory resources |
|
Experimental. Requires |
For per-API documentation, see the Extended API reference.
Unsupported extensions#
Several extensions from the upstream libcudacxx project are not supported in libhipcxx because they depend on NVIDIA hardware. These include:
<cuda/latch>,<cuda/barrier>,<cuda/semaphore>,<cuda/pipeline>— scoped synchronization primitivescuda::memcpy_async,cuda::memcpy_async_tx,cuda::aligned_size_t— asynchronous copies, which depend on<cuda/barrier>and<cuda/pipeline><cuda/annotated_ptr>— memory access properties for pointerscuda::discard_memory— available, but has no effect on AMD GPUscuda::device::warp_shuffle_idx,warp_shuffle_up,warp_shuffle_down,warp_shuffle_xor— warp shuffles, which are only compiled for NVIDIA PTX targetscuda::for_each_canceled_block— work stealing, which depends on NVIDIA hardware block cancellation. On AMD GPUs it invokes the function once for the current block.<cuda/ptx>— NVIDIA PTX instruction wrappers
For the complete list, see Limitations and unsupported APIs.