<cuda/std/cstring>#

2026-10-23

1 min read time

Applies to Linux and Windows

This page documents <cuda/std/cstring>, which provides the byte-wise memory functions cuda::std::memset and cuda::std::memcpy for host and device code.

cuda::std::memset#

__host__ __device__
inline void* memset(void* dest, int ch, size_t count) noexcept;

See std::memset for the full documentation.

Preconditions

The following preconditions are only enabled with libhipcxx 3.4 or later:

  • dest is a valid pointer.

  • dest + count is a valid pointer.

A valid pointer is one that is not NULL and within the correct range if it belongs to the shared memory address space.


cuda::std::memcpy#

__host__ __device__
inline void* memcpy(void* dest, const void* src, size_t count) noexcept;

See std::memcpy for the full documentation.

Preconditions

The following preconditions are only enabled with libhipcxx 3.4 or later:

  • src is a valid pointer.

  • src + count is a valid pointer.

  • dest is a valid pointer.

  • dest + count is a valid pointer.

  • src and dest don’t overlap.

A valid pointer is one that is not NULL and within the correct range if it belongs to the shared memory address space.