Skip to content

Commit

Permalink
Merge pull request RTKConsortium#477 from SimonRit/CudaMemoryCheck
Browse files Browse the repository at this point in the history
BUG: add missing checks after Cuda memory allocation
  • Loading branch information
SimonRit authored Feb 24, 2022
2 parents e7dd60c + fc9e8e2 commit a4897ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rtkCudaUtilities.cu
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ prepareTextureObject(int size[3],
float * singleComponent;
int numel = size[0] * size[1] * size[2];
cudaMalloc(&singleComponent, numel * sizeof(float));
CUDA_CHECK_ERROR;
float one = 1.0;

// Copy image data to arrays. The tricky part is the make_cudaPitchedPtr.
Expand All @@ -131,6 +132,7 @@ prepareTextureObject(int size[3],
cudaMalloc3DArray((cudaArray **)&componentArrays[component], &channelDesc, volExtent, cudaArrayLayered);
else
cudaMalloc3DArray((cudaArray **)&componentArrays[component], &channelDesc, volExtent);
CUDA_CHECK_ERROR;

// Fill it with the current singleComponent
cudaMemcpy3DParms CopyParams = cudaMemcpy3DParms();
Expand Down

0 comments on commit a4897ea

Please sign in to comment.