Skip to content

Commit

Permalink
tileSize is corrected to be a multiple of 256.
Browse files Browse the repository at this point in the history
  • Loading branch information
shinmorino committed Jul 1, 2018
1 parent a4f79da commit 3016ffa
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions sqaodc/common/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ template<class real>
void DenseGraphBFSearcher<real>::setPreference(const Preference &pref) {
if (pref.name == pnTileSize) {
throwErrorIf(pref.tileSize <= 0, "tileSize must be a positive integer.");
tileSize_ = pref.tileSize;

SizeType tileSize = roundUp(pref.tileSize, 256);
if (pref.tileSize != tileSize)
log("Tile size is adjusted to %d.", tileSize_);
tileSize_ = tileSize;
}
else {
Solver<real>::setPreference(pref);
Expand All @@ -213,15 +217,24 @@ Preferences BipartiteGraphBFSearcher<real>::getPreferences() const {
return prefs;
}


template<class real>
void BipartiteGraphBFSearcher<real>::setPreference(const Preference &pref) {
if (pref.name == pnTileSize0) {
throwErrorIf(pref.tileSize <= 0, "tileSize0 must be a positive integer.");
tileSize0_ = pref.tileSize;

SizeType tileSize0 = roundUp(pref.tileSize, 256);
if (pref.tileSize != tileSize0)
log("Tile size 0 is adjusted to %d.", tileSize0_);
tileSize0_ = tileSize0;
}
if (pref.name == pnTileSize1) {
throwErrorIf(pref.tileSize <= 0, "tileSize1 must be a positive integer.");
tileSize1_ = pref.tileSize;

SizeType tileSize1 = roundUp(pref.tileSize, 256);
if (pref.tileSize != tileSize1)
log("Tile size 1 is adjusted to %d.", tileSize1_);
tileSize1_ = tileSize1;
}
}

Expand Down

0 comments on commit 3016ffa

Please sign in to comment.