Add cuda compile define and cmake setting

This commit is contained in:
kradchen
2023-10-30 13:34:51 +08:00
parent e3abe9fabe
commit dd6a22f47d
5 changed files with 25 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
#ifdef USE_CUDA
#include "CudaMatrix.h"
#include "Function.h"
@@ -218,6 +219,7 @@ CudaMatrix CudaMatrix::block(int aDim,int aBeginIndex, int aEndIndex) const
return CudaMatrix::fromRawData(dataOutput,getDimSize(0),dimLength,getDimSize(2),getValueType());
}
case 2:
default:
{
int copySize = dimLength*sliceStride;
cudaMemcpy(dataOutput,
@@ -235,4 +237,6 @@ bool CudaMatrix::setBlockValue(int aDim,int aBeginIndx, int aEndIndex,float valu
std::cerr<<"CudaMatrix block only support 1D-3D data!"<<std::endl;
return false;
}
}
return true;
}
#endif // USE_CUDA