GpuMat 1.0.1
A GpuMat for CS205 C/C++ Project4
|
Base MAT class for GPU memory with reference counting. More...
Friends | |
std::ostream & | operator<< (std::ostream &os, const Matrix< T > &matrix) |
友函数,输出矩阵 | |
Base MAT class for GPU memory with reference counting.
Its limitations:
Some member functions are described as a "Blocking Call" while some are described as a "Non-Blocking Call". Blocking functions are synchronous to host. It is guaranteed that the GPU operation is finished when the function returns. However, non-blocking functions are asynchronous to host. Those functions may return even if the GPU operation is not finished.
Compared to their blocking counterpart, non-blocking functions accept Stream as an additional argument. If a non-default stream is passed, the GPU operation may overlap with operations in other streams.
Constructor for the first time.
rows,cols,device |
Destructor.
拷贝构造函数,增加引用计数
other_Matrix |
change GPU where the matrix is stored
device_num |
row | |
col |
深拷贝函数,用于在CUDA设备之间复制数据
深拷贝函数,用于在CUDA设备之间复制数据
Get the Cols object.
Get the Data object.
Get the Device object.
row,col |
Get the Size object.
判断两个矩阵是否相等
other |
Mul two matrices.
other_Matrix,result_ptr |
|
inline |
|
inline |
浅拷贝
Matrix& | other |
重写 == 运算符
Set our Matrix as the ROI (Region of Interest) of other.
startRow,startCol,roiRows,roiCols |
|
inline |
设置ROI
startRow,startCol,numRows,numCols,other |
上传数据到 GPU
上传到GPU上的数据的指针 |