Skip to content

Commit

Permalink
Bugfix in GpuSolver fetch available Gpus
Browse files Browse the repository at this point in the history
[trigger-nightly-build]
  • Loading branch information
[email protected] committed Feb 27, 2024
1 parent ba773ab commit 15b6852
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/main/java/de/nqueensfaf/impl/GpuSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@

public class GpuSolver extends Solver implements Stateful {

private static ArrayList<Gpu> availableGpus = new ArrayList<Gpu>();
private static boolean availableGpusFetched = false;
private ArrayList<Gpu> availableGpus = new ArrayList<Gpu>();

private GpuSelection gpuSelection = new GpuSelection();
private ArrayList<Constellation> constellations = new ArrayList<Constellation>();
Expand All @@ -88,8 +87,7 @@ public class GpuSolver extends Solver implements Stateful {
private int L;

public GpuSolver() {
if(!availableGpusFetched)
fetchAvailableGpus();
fetchAvailableGpus();
}

// getters and setters
Expand Down Expand Up @@ -193,8 +191,6 @@ private void fetchAvailableGpus() {
availableGpus.add(gpu);
}
}

availableGpusFetched = true;
}
}

Expand Down Expand Up @@ -418,9 +414,7 @@ private ArrayList<Constellation> fillWithPseudoConstellations(List<Constellation
for (var c : constellations) {
// iterate through constellations, add each remaining constellations and fill up
// each group of ijkl till its dividable by workgroup-size
if (c.getSolutions() >= 0)
continue;


if ((c.getStartIjkl() & ((1 << 15) - 1)) != currentJkl) { // check if new ijkl is found
while (newConstellations.size() % workgroupSize != 0) {
addPseudoConstellation(newConstellations);
Expand Down

0 comments on commit 15b6852

Please sign in to comment.