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
10 changes: 9 additions & 1 deletion cubool/sources/cuda/cuda_matrix_multiply.cu
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ namespace cubool {
assert(this->getNrows() == M);
assert(this->getNcols() == N);

if (!accumulate && (this == a || this == b)) {
// Keep both operands intact until the product is ready.
CudaMatrix temporary(M, N, mInstance);
temporary.multiply(aBase, bBase, false, checkTime);
mMatrixImpl = std::move(temporary.mMatrixImpl);
return;
}

if (!accumulate) {
// Clear all values
this->clearAndResizeStorageToDim();
Expand All @@ -63,4 +71,4 @@ namespace cubool {
this->mMatrixImpl = std::move(result);
}

}// namespace cubool
}// namespace cubool