Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/mpc/TPC.inl
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,18 @@ TPCBase<T, I> &TPCBase<T, I>::operator*=(const TPCBase<T, I2> &rhs) {

temp.zero();
temp += f;
temp -= *y.getShare(0);
temp *= e;
*this += temp;

temp.zero();
temp -= *y.getShare(0);
temp *= e;
*this.getShare(0) += temp;

temp.zero();
temp -= *x.getShare(0);
temp *= f;
*this += temp;
*this.getShare(0) += temp;

return *this;
}
Expand Down Expand Up @@ -298,14 +302,18 @@ TPCBase<T, I> &TPCBase<T, I>::operator&=(const TPCBase<T, I2> &rhs) {

temp.zero();
temp ^= f;
temp ^= *y.getShare(0);
temp &= e;
*this ^= temp;

temp.zero();
temp ^= *y.getShare(0);
temp &= e;
*this->getShare(0) ^= temp;

temp.zero();
temp ^= *x.getShare(0);
temp &= f;
*this ^= temp;
*this->getShare(0) ^= temp;

return *this;
}
Expand Down Expand Up @@ -1082,11 +1090,11 @@ void localMatMul(const TPC<T> &a, const TPC<T> &b, TPC<T> &c,
temp.zero();

gpu::gemm(M, N, K, &e, transpose_a, y.getShare(0), transpose_b, &temp, transpose_c);
c -= temp;
*c.getShare(0) -= temp;
temp.zero();

gpu::gemm(M, N, K, x.getShare(0), transpose_a, &f, transpose_b, &temp, transpose_c);
c -= temp;
*c.getShare(0) -= temp;
}

template<typename T, typename I, typename I2>
Expand Down