Add const batch accessor to RowVectorBatch.

PiperOrigin-RevId: 675530484
This commit is contained in:
Daniel Keysers 2024-09-17 05:41:36 -07:00 committed by Copybara-Service
parent 892f3bbcbe
commit e4ba93412a
1 changed files with 4 additions and 0 deletions

View File

@ -58,6 +58,10 @@ class RowVectorBatch {
HWY_DASSERT(batch_idx < batch_size_); HWY_DASSERT(batch_idx < batch_size_);
return mem_.get() + batch_idx * len_; 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. // For MatMul or other operations that process the entire batch at once.
T* All() { return mem_.get(); } T* All() { return mem_.get(); }