Memory

Memory#

2026-10-23

1 min read time

Applies to Linux and Windows

This page covers the memory extended API, providing pointer alignment, address space, and pointer range utilities.

cuda::aligned_size_t and cuda::discard_memory are not supported in libhipcxx. See Limitations and unsupported APIs.

Header

Content

libhipcxx Availability

get_device_address

Returns a valid address to a device object

libhipcxx 3.0 (in <cuda/memory> since libhipcxx 3.4)

is_address_from and is_object_from

Check if a pointer or object is from a specific address space

libhipcxx 3.4

is_aligned

Check if a pointer is aligned

libhipcxx 3.4

align_up

Align up a pointer to the specified alignment

libhipcxx 3.4

align_down

Align down a pointer to the specified alignment

libhipcxx 3.4

ptr_rebind

Rebind a pointer to a different type

libhipcxx 3.4

ptr_in_range

Check if a pointer is in a range

libhipcxx 3.4

ranges_overlap

Check if two ranges overlap

libhipcxx 3.4

is_host_accessible, is_device_accessible, is_managed

Check if a pointer is accessible from the host, device, or managed memory

libhipcxx 3.4