// gpu_log_ring.cu — unified GPU diagnostic log ring (tick kernel).
//
// Provides the `gpu_log_tick` kernel that increments the step counter
// once per captured-graph step.
//
// Struct definitions (`LogHeader`, `LogRecord`, `LogRing`) and the
// `log_record` device helper live in `gpu_log_helpers.cuh` so other
// kernels can include the helpers without re-compiling them as
// separate symbols. Single source of truth — see
// `feedback_single_source_of_truth_no_duplicates`.
//
// Constraints (still apply to anything including the helper header):
//   - No atomicAdd (slot reservation by deterministic step/kid/rt math).
//   - No host branches; thread-id gating only.
//   - Header-last commit (magic field written after payload + other header).
//   - Mapped-pinned ring; host reads via volatile, no DtoH memcpy.

#include "gpu_log_helpers.cuh"

// Tick kernel — 1 thread, 1 block. Increments step counter; runs FIRST in
// every captured-graph replay so all subsequent kernels see the new step.
extern "C" __global__ void gpu_log_tick(int* step_counter) {
    if (threadIdx.x == 0 && blockIdx.x == 0) {
        step_counter[0] = step_counter[0] + 1;
    }
}
