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

Function copyToHost

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

* \brief Performs a synchronous copy from the * device memory of this matrix into the * specified host memory * This copy is synchronized on the default stream, * hence synchronous to every computation but slow. * \param data the data in which the matrix is stored */

Source from the content-addressed store, hash-verified

845 * \param data the data in which the matrix is stored
846 */
847 void copyToHost(_Scalar* data) const
848 {
849 //slower, conservative: full synchronization
850 //CUMAT_SAFE_CALL(cudaStreamSynchronize(Context::current().stream()));
851 //CUMAT_SAFE_CALL(cudaMemcpy(data, data_.data(), sizeof(_Scalar)*size(), cudaMemcpyDeviceToHost));
852
853 //faster: only synchronize this stream
854 CUMAT_SAFE_CALL(cudaMemcpyAsync(data, data_.data(), sizeof(_Scalar)*size(), cudaMemcpyDeviceToHost, Context::current().stream()));
855 CUMAT_SAFE_CALL(cudaStreamSynchronize(Context::current().stream()));
856
857 CUMAT_PROFILING_INC(MemcpyDeviceToHost);
858 }
859
860 // EIGEN INTEROP
861#if CUMAT_EIGEN_SUPPORT==1

Callers 1

toEigenFunction · 0.85

Calls 3

sizeFunction · 0.85
streamMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected