MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / makeExclusiveUse

Function makeExclusiveUse

extensions/include/cuMat/src/Matrix.h:759–769  ·  view source on GitHub ↗

* \brief Checks if the underlying data is used by an other matrix expression and if so, * copies the data so that this matrix is the exclusive user of that data. * * This method has no effect if \ref isExclusiveUse is already true. * * Postcondition: isExclusiveUse() == true */

Source from the content-addressed store, hash-verified

757 * Postcondition: <code>isExclusiveUse() == true</code>
758 */
759 void makeExclusiveUse()
760 {
761 if (isExclusiveUse()) return;
762
763 DevicePointer<_Scalar> ptr = data_.dataPointer();
764 data_ = Storage_t(rows(), cols(), batches());
765 CUMAT_SAFE_CALL(cudaMemcpyAsync(data(), ptr.pointer(), sizeof(_Scalar)*rows()*cols()*batches(), cudaMemcpyDeviceToDevice, Context::current().stream()));
766 CUMAT_PROFILING_INC(MemcpyDeviceToDevice);
767
768 assert(isExclusiveUse());
769 }
770
771 // COPY CALLS
772

Callers

nothing calls this directly

Calls 6

dataFunction · 0.85
streamMethod · 0.80
isExclusiveUseFunction · 0.70
rowsFunction · 0.70
colsFunction · 0.70
batchesFunction · 0.70

Tested by

no test coverage detected