Skip to content

Commit

Permalink
little bugfix
Browse files Browse the repository at this point in the history
[trigger-nightly-build]
  • Loading branch information
[email protected] committed Feb 19, 2024
1 parent cadb6bb commit c8fef51
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/de/nqueensfaf/impl/GpuSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,16 @@ private void multiGpu(List<Constellation> constellations) {
toIndex = firstWorkloadSize;

var gpuFirstWork = constellations.subList(fromIndex, toIndex);
if (gpuFirstWork.size() == 0)
if (gpuFirstWork.size() == 0) {
firstWorkloads.add(new ArrayList<Constellation>());
continue;
}

var gpuFirstWorkload = fillWithPseudoConstellations(gpuFirstWork, selectedGpus.get(gpuIdx).workgroupSize);
firstWorkloads.add(gpuFirstWorkload);

var gpu = selectedGpus.get(gpuIdx);
gpu.createBuffers(gpuFirstWorkload.size());
gpu.maxNumOfConstellationsPerRun = gpuFirstWorkload.size();

fromIndex = toIndex;
}
Expand All @@ -314,7 +315,7 @@ private void multiGpu(List<Constellation> constellations) {
final int gpuIdx = idx;
final var gpu = selectedGpus.get(idx);

if (gpu.maxNumOfConstellationsPerRun == 0)
if (firstWorkloads.get(gpuIdx).size() == 0)
continue;

executor.execute(() -> {
Expand Down

0 comments on commit c8fef51

Please sign in to comment.