diff --git a/src/cudamatrix/cu-packed-matrix.cc b/src/cudamatrix/cu-packed-matrix.cc index eeccae94fa2..64f8afe0616 100644 --- a/src/cudamatrix/cu-packed-matrix.cc +++ b/src/cudamatrix/cu-packed-matrix.cc @@ -118,7 +118,7 @@ void CuPackedMatrix::Swap(PackedMatrix *mat) { this->Swap(&temp); // now temp is full, *this is empty. mat->Swap(&temp); // now mat has data from *this, temp has // data from mat. - this->Swap(mat); // copy data in mat to *this, which is now empty. + this->Swap(&temp); // copy data in mat to *this, which is now empty. } else { // *this is full but *mat is empty. mat->Resize(this->num_rows_, kUndefined); this->CopyToPacked(mat); diff --git a/src/cudamatrix/cu-vector.cc b/src/cudamatrix/cu-vector.cc index f61fd4408db..f85d20d37f1 100644 --- a/src/cudamatrix/cu-vector.cc +++ b/src/cudamatrix/cu-vector.cc @@ -387,7 +387,7 @@ void CuVectorBase::ApplyCeiling(Real ceiling_val, MatrixIndexT *ceiled_cou // vector as a matrix with a single row. ::MatrixDim dim = {1, Dim(), 1}; cuda_apply_ceiling(dimGrid, dimBlock, data_, ceiling_val, dim); - + CuDevice::Instantiate().AccuProfile("CuVectorBase::ApplyCeilingNoCount", tim); } else { if (dim_ == 0) { *ceiled_count = 0; return; } @@ -991,7 +991,7 @@ void CuVector::Swap(Vector *vec) { this->Swap(&temp); // now temp is full, *this is empty. vec->Swap(&temp); // now vec has data from *this, temp has // data from vec. - Swap(vec); // copy data in vec to *this, which is now empty. + Swap(&temp); // copy data in vec to *this, which is now empty. } else { // *this is full but *vec is empty. vec->Resize(this->dim_, kUndefined); this->CopyToVec(vec);