Namespace hierarchy in libhipcxx#
2026-10-01
3 min read time
libhipcxx organizes its APIs into three tiers, each reflecting where code can run and how closely it conforms to the C++ Standard. Understanding this hierarchy tells you which header to include and which namespace to use for any given facility.
Namespace |
Include path |
Where it runs |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
The cuda:: and hip:: prefixes, and their include path equivalents, are interchangeable
aliases that resolve to the same headers. Use whichever fits your project’s conventions.
The following example shows all three libhipcxx tiers side by side:
// Standard C++, __host__ only.
#include <atomic>
std::atomic<int> x;
// HIP C++, __host__ __device__.
// Strictly conforming to the C++ Standard.
#include <cuda/std/atomic>
cuda::std::atomic<int> x;
// HIP C++, __host__ __device__.
// Conforming extensions to the C++ Standard.
#include <cuda/atomic>
cuda::atomic<int, cuda::thread_scope_block> x;