From e4ba93412aca4f2ffc0fe3e749b4170fff44640f Mon Sep 17 00:00:00 2001 From: Daniel Keysers Date: Tue, 17 Sep 2024 05:41:36 -0700 Subject: [PATCH] Add const batch accessor to RowVectorBatch. PiperOrigin-RevId: 675530484 --- util/allocator.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/allocator.h b/util/allocator.h index f459fe7..e8fa41c 100644 --- a/util/allocator.h +++ b/util/allocator.h @@ -58,6 +58,10 @@ class RowVectorBatch { HWY_DASSERT(batch_idx < batch_size_); return mem_.get() + batch_idx * len_; } + const T* Batch(size_t batch_idx) const { + HWY_DASSERT(batch_idx < batch_size_); + return mem_.get() + batch_idx * len_; + } // For MatMul or other operations that process the entire batch at once. T* All() { return mem_.get(); }