Fix fftshift and ifftshift memory bug.
This commit is contained in:
@@ -1194,7 +1194,7 @@ void Aurora::fftshift(CudaMatrix &aMatrix){
|
||||
} else {
|
||||
int copySize = aMatrix.getDimSize(0) / 2 + 1;
|
||||
float *data = nullptr;
|
||||
cudaMalloc((void **)&data, copySize * aMatrix.getValueType());
|
||||
cudaMalloc((void **)&data,copySize*sizeof(float)*aMatrix.getValueType());
|
||||
memcpyColKernel<<<aMatrix.getDimSize(1), 256>>>(
|
||||
aMatrix.getData(), data, copySize * aMatrix.getValueType(),
|
||||
aMatrix.getDimSize(0) * aMatrix.getValueType(),
|
||||
@@ -1220,7 +1220,7 @@ void Aurora::ifftshift(CudaMatrix &aMatrix){
|
||||
} else {
|
||||
int copySize = aMatrix.getDimSize(0) / 2 + 1;
|
||||
float *data = nullptr;
|
||||
cudaMalloc((void **)&data, copySize * aMatrix.getValueType());
|
||||
cudaMalloc((void **)&data,copySize*sizeof(float)*aMatrix.getValueType());
|
||||
memcpyColKernel<<<aMatrix.getDimSize(1), 256>>>(
|
||||
aMatrix.getData()+(copySize-1)* aMatrix.getValueType(),
|
||||
data, copySize * aMatrix.getValueType(),
|
||||
|
||||
Reference in New Issue
Block a user