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

Commit c91026a

Browse files
committed
make sharedDepth mapping option tunable
Introduce a tunable parameter for sharedDepth added by a preceding commit. Select the initial range as [0,7] because the range of privateDepth goes until 10, and 3 innermost loops may be mapped to threads making it impossible to promote below them.
1 parent fe11d2a commit c91026a

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

tc/autotuner/autotuner-inl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ void setupTuningParameters(
374374
RangeParameter(powers2(FLAGS_tuner_max_unroll_size), "unroll");
375375
configuration.privateDepth =
376376
RangeParameter({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, "pdepth");
377+
configuration.sharedDepth =
378+
RangeParameter({0, 1, 2, 3, 4, 5, 6, 7}, "sdepth");
377379
}
378380
} // namespace
379381

tc/autotuner/parameters.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ void TuningConfiguration::applyToParameters(
240240
useReadOnlyCache.apply(f);
241241
matchLibraryCalls.apply(f);
242242
privateDepth.apply(f);
243+
sharedDepth.apply(f);
243244
}
244245

245246
bool TuningConfiguration::isValid() const {
@@ -275,6 +276,7 @@ std::vector<ParameterView> TuningConfiguration::collectParameters() {
275276
params.emplace_back(useReadOnlyCache);
276277
params.emplace_back(matchLibraryCalls);
277278
params.emplace_back(privateDepth);
279+
params.emplace_back(sharedDepth);
278280

279281
return params;
280282
}
@@ -306,6 +308,7 @@ void TuningConfiguration::fromCudaMappingOptions(
306308
unrollCopyShared.selectValue(options.proto().unroll_copy_shared());
307309
useReadOnlyCache.selectValue(options.proto().use_readonly_cache());
308310
privateDepth.selectFromValue(options.proto().private_depth());
311+
sharedDepth.selectFromValue(options.proto().shared_depth());
309312
}
310313

311314
void TuningConfiguration::fromCpuMappingOptions(
@@ -335,6 +338,7 @@ void TuningConfiguration::applyToCudaMappingOptions(
335338
options.unrollCopyShared(unrollCopyShared.value());
336339
options.useReadOnlyCache(useReadOnlyCache.value());
337340
options.privateDepth(privateDepth.value());
341+
options.sharedDepth(sharedDepth.value());
338342
}
339343

340344
void TuningConfiguration::applyToCpuMappingOptions(

tc/autotuner/parameters.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ class TuningConfiguration {
191191
BoolParameter useReadOnlyCache;
192192
BoolParameter matchLibraryCalls;
193193
RangeParameter privateDepth;
194+
RangeParameter sharedDepth;
194195

195196
private:
196197
std::vector<std::function<bool(const TuningConfiguration&)>> validators_;
@@ -229,6 +230,7 @@ class TuningParameterFixer {
229230
llvm::Optional<bool> useReadOnlyCache;
230231
llvm::Optional<bool> matchLibraryCalls;
231232
llvm::Optional<uint32_t> privateDepth;
233+
llvm::Optional<uint32_t> sharedDepth;
232234

233235
friend class TuningConfiguration;
234236
};

0 commit comments

Comments
 (0)