File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class RowBuffer {
60
60
*/
61
61
inline real* get (int row) const {
62
62
if (preallocatedBuf_) {
63
- CHECK_LE ((row + 1 ) * width_ * sizeof (real), preallocatedBuf_->getSize ());
63
+ CHECK_LE ((row)* width_ * sizeof (real), preallocatedBuf_->getSize ());
64
64
return reinterpret_cast <real*>(preallocatedBuf_->getBuf ()) + row * width_;
65
65
} else {
66
66
CHECK_LE ((row + 1 ) * width_, rowStore_.size ());
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ void ParameterClient2::sendParallel(int tid,
186
186
parameter->getMat (recvParameterType).get ());
187
187
CHECK (recvMat);
188
188
size_t width = parameter->getConfig ().dims (1 );
189
+ // TODO(wuyi): need add lock here? may also cause resize.
189
190
buf = recvMat->getLocalRow (block.begin_pos () / width);
190
191
}
191
192
// / sparse_id is not useful while receiving data since sparse data
@@ -265,9 +266,9 @@ void ParameterClient2::prepareSendData(
265
266
uint64_t beginDim = 0 ;
266
267
uint64_t endDim = 0 ;
267
268
268
- // FIXME (typhoonzero): let it resize first
269
- prefetchMat->getLocalRow (nLocalBlocks + 1 );
270
- sendMat->getLocalRow (nLocalBlocks + 1 );
269
+ // HACK (typhoonzero): let it resize first
270
+ prefetchMat->getLocalRow (nLocalBlocks);
271
+ sendMat->getLocalRow (nLocalBlocks);
271
272
272
273
for (size_t row = 0 ; row < nLocalBlocks; ++row) {
273
274
int64_t blockId = localIndices[row]; // local row -> sparse row
You can’t perform that action at this time.
0 commit comments