This repository was archived by the owner on Apr 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,17 @@ void emitReductionInit(
359
359
context.ss << " ;" << endl;
360
360
}
361
361
362
+ namespace {
363
+ template <typename AFF>
364
+ void emitAccess (AFF access, const CodegenStatementContext& context) {
365
+ // Use a temporary isl::ast_build to print the expression.
366
+ // Ideally, this should use the build at the point
367
+ // where the user statement was created.
368
+ auto astBuild = isl::ast_build::from_context (access.domain ());
369
+ context.ss << astBuild.access_from (access).to_C_str ();
370
+ }
371
+ } // namespace
372
+
362
373
void emitCopyStmt (const CodegenStatementContext& context) {
363
374
using detail::emitDirectSubscripts;
364
375
@@ -613,8 +624,7 @@ void emitMappedTensorAccess(
613
624
auto astToPromoted =
614
625
isl::pw_multi_aff (promotion).pullback (astToScheduledOriginal);
615
626
616
- auto astBuild = isl::ast_build::from_context (astToPromoted.domain ());
617
- context.ss << astBuild.access_from (astToPromoted).to_C_str ();
627
+ emitAccess (astToPromoted, context);
618
628
}
619
629
620
630
void emitDirectSubscripts (
You can’t perform that action at this time.
0 commit comments