Files
versitygw/cuwrapper/rc/v2-clock.h
T
Jihyeon Gim efa0309da4 rdma: port the hipObject v2 RC session core
Port the hipObject v2 reliable-connection session core into
cuwrapper/rc: the session table and state machine, the wire
codec for the hipobj-rc-v2 headers, request parsing, the
injectable clock and randomness sources, the transport layer
(QP/CQ lifecycle, RTR/RTS transitions, staging registration),
the data phase (RDMA write with immediate for GET, receive with
immediate for PUT), the RDMA token codec, and the dynamically
loaded ibverbs shim (ibv-core.h plus the dlopen host binding).

The sources are a port of the upstream hipObject v2 core, kept
close to the original so the two trees can be diffed during
review. Nothing links against them yet; a Makefile rule builds
the objects into rdma/librcserver.a for the ABI layer that
follows.

Signed-off-by: Jihyeon Gim <potatogim@potatogim.net>
2026-08-30 00:00:29 +09:00

35 lines
938 B
C++

/* Copyright (c) Advanced Micro Devices, Inc. All rights reserved.
* Copyright (c) Gluesys Inc. and Jihyeon Gim. All rights reserved.
*
* SPDX-License-Identifier: MIT
*/
/* Injectable monotonic clock for v2 lifetime policies (retired-ring
* expiry, session timeouts). Production uses a steady-clock
* implementation; unit tests install a fake to control time. */
#pragma once
#include <cstdint>
namespace hipObj {
namespace v2 {
class ClockSource {
public:
virtual ~ClockSource() = default;
virtual uint64_t nowMs() = 0;
};
/* Returns the active clock. Production default unless a test
* override is installed. */
ClockSource& clockSource();
/* Installs a test clock and returns the previously active source
* (nullptr when the production default was active). Passing nullptr
* restores the default. Unit tests only. */
ClockSource* setClockSourceForTest(ClockSource* source);
} // namespace v2
} // namespace hipObj