// `cstring` for NVRTC, which ships no device headers (see README.md).
// `std::memcpy`, as a byte loop: device code type-puns through it, and the
// compiler folds a constant-size copy to a move.

#pragma once

namespace std {

__device__ __forceinline__ void* memcpy(void* dst, const void* src, unsigned long n) {
    char* d = static_cast<char*>(dst);
    const char* s = static_cast<const char*>(src);
    for (unsigned long i = 0; i < n; ++i) {
        d[i] = s[i];
    }
    return dst;
}

}  // namespace std
