Skip to content

Commit

Permalink
Really release the cached memory
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Sep 25, 2018
1 parent 540b284 commit 97e51f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions HeterogeneousCore/CUDAServices/src/CUDAService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ CUDAService::CUDAService(edm::ParameterSet const& config, edm::ActivityRegistry&

CUDAService::~CUDAService() {
if (enabled_) {
// Explicitly destruct the allocator before the device resets below
allocator_.reset();

for (int i = 0; i < numberOfDevices_; ++i) {
cudaCheck(cudaSetDevice(i));
cudaCheck(cudaDeviceSynchronize());
Expand Down

0 comments on commit 97e51f7

Please sign in to comment.