diff options
Diffstat (limited to 'src/CuBaseLib')
-rw-r--r-- | src/CuBaseLib/cumatrix.h | 4 | ||||
-rw-r--r-- | src/CuBaseLib/cumatrix.tcc | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/CuBaseLib/cumatrix.h b/src/CuBaseLib/cumatrix.h index 887b92d..dd76bb2 100644 --- a/src/CuBaseLib/cumatrix.h +++ b/src/CuBaseLib/cumatrix.h @@ -76,9 +76,9 @@ namespace TNet { /// Allocate the memory ThisType& Init(size_t rows, size_t cols); /// Copy the ptr of rSrc starting at x with span of cols - ThisType& Init(CuMatrix<_ElemT>& rSrc, size_t x, size_t cols); + ThisType& Init(const CuMatrix<_ElemT>& rSrc, size_t x, size_t cols); /// Copy the settings of rSrc - ThisType& Init(CuMatrix<_ElemT>& rSrc); + ThisType& Init(const CuMatrix<_ElemT>& rSrc); /// Deallocate the memory void Destroy(); diff --git a/src/CuBaseLib/cumatrix.tcc b/src/CuBaseLib/cumatrix.tcc index 7d6a136..66e335d 100644 --- a/src/CuBaseLib/cumatrix.tcc +++ b/src/CuBaseLib/cumatrix.tcc @@ -41,13 +41,13 @@ namespace TNet { template<typename _ElemT> CuMatrix<_ElemT>& CuMatrix<_ElemT>:: - Init(CuMatrix<_ElemT>& rSrc, size_t x, size_t cols) + Init(const CuMatrix<_ElemT>& rSrc, size_t x, size_t cols) { mRows = rSrc.Rows(); mCols = cols; mStride = rSrc.Stride(); - mpCUData = rSrc.pCUData() + x; - isOwn=false; + mpCUData = const_cast<_ElemT*>(rSrc.pCUData()) + x; + isOwn = false; return *this; } @@ -57,13 +57,13 @@ namespace TNet { template<typename _ElemT> CuMatrix<_ElemT>& CuMatrix<_ElemT>:: - Init(CuMatrix<_ElemT>& rSrc) + Init(const CuMatrix<_ElemT>& rSrc) { mRows = rSrc.Rows(); mCols = rSrc.Cols(); mStride = rSrc.Stride(); - mpCUData = rSrc.pCUData(); - isOwn=false; + mpCUData = const_cast<_ElemT*>(rSrc.pCUData()); + isOwn = false; return *this; } |