Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 114212b

Browse files
nicolasvasilacheftynse
authored andcommitted
Fix tuning parameter intialization
Previously, when intializing parameters for a tuning problem, we used the problem dimensions. Unfortunately this can be error prone (and hard to debug) in cases where default options have larger dimensionalities (e.g "naive" options with 3-D tilings on 2-D problems). This commit just takes the min dimension.
1 parent 3cca670 commit 114212b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tc/autotuner/parameters.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,11 @@ void CudaDimParameters::setRange(
459459
namespace {
460460
template <typename Params, typename View>
461461
void fromMappingOptions(Params& params, const View& options) {
462-
CHECK_LE(options.size(), params.dims.size());
463-
params.numberDims.selectFromValue(options.size());
464-
for (size_t i = 0; i < options.size(); ++i) {
462+
// It is possible mapping options are higher dimensional than problem sizes
463+
// in which case options could be larger
464+
auto min = std::min(options.size(), params.dims.size());
465+
params.numberDims.selectFromValue(min);
466+
for (size_t i = 0; i < min; ++i) {
465467
params.dims[i].selectFromValue(options[i]);
466468
}
467469
}

0 commit comments

Comments
 (0)