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(
359359 context.ss << " ;" << endl;
360360}
361361
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+
362373void emitCopyStmt (const CodegenStatementContext& context) {
363374 using detail::emitDirectSubscripts;
364375
@@ -613,8 +624,7 @@ void emitMappedTensorAccess(
613624 auto astToPromoted =
614625 isl::pw_multi_aff (promotion).pullback (astToScheduledOriginal);
615626
616- auto astBuild = isl::ast_build::from_context (astToPromoted.domain ());
617- context.ss << astBuild.access_from (astToPromoted).to_C_str ();
627+ emitAccess (astToPromoted, context);
618628}
619629
620630void emitDirectSubscripts (
You can’t perform that action at this time.
0 commit comments