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

Commit 2a318d2

Browse files
author
Sven Verdoolaege
committed
emitCudaKernel: take parameter values from those stored in specialized scop
There is little point in trying to extract these values from a context when those very same values were used to create the context. Simply use the original known values.
1 parent 8d4410c commit 2a318d2

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

tc/core/polyhedral/cuda/codegen.cc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -747,15 +747,8 @@ string emitCudaKernel(
747747

748748
// Make a map of the specialized scalar parameter values
749749
map<string, Halide::Expr> paramValues;
750-
{
751-
auto set = scop.globalParameterContext;
752-
for (unsigned i = 0; i < set.n_param(); i++) {
753-
auto val = set.plain_get_val_if_fixed(isl::dim_type::param, i);
754-
auto name = set.get_space().get_dim_name(isl::dim_type::param, i);
755-
if (!val.is_nan()) {
756-
paramValues[name] = static_cast<int>(val.get_num_si());
757-
}
758-
}
750+
for (const auto& kvp : scop.parameterValues) {
751+
paramValues[kvp.first] = kvp.second;
759752
}
760753

761754
stringstream ss;

0 commit comments

Comments
 (0)