Skip to content

Commit

Permalink
Multi gpu cleanup only if gpu actually did something
Browse files Browse the repository at this point in the history
  • Loading branch information
olepoeschl authored Feb 19, 2024
1 parent d2864dd commit 1e3155d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/de/nqueensfaf/impl/GpuSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ private void multiGpu(List<Constellation> constellations) {
throw new RuntimeException("could not wait for termination of GpuSolver: " + e.getMessage());
}

for (var gpu : selectedGpus) {
if (gpu.maxNumOfConstellationsPerRun == 0)
for (int gpuIdx = 0; gpuIdx < selectedGpus.size(); gpuIdx++) {
if (firstWorkloads.get(gpuIdx).size() == 0)
continue;
gpu.releaseBuffers();
selectedGpus.get(gpuIdx).releaseBuffers();
}
}

Expand Down

0 comments on commit 1e3155d

Please sign in to comment.