This repository was archived by the owner on Apr 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -915,7 +915,8 @@ HalideComponents translate(
915915 const tc::CompilerOptions& compilerOptions = tc::CompilerOptions()) {
916916 LOG_IF (INFO, tc::FLAGS_debug_halide) << treeRef;
917917 return translateDef (
918- lang::Def (lang::Sema ().checkFunction (treeRef)), compilerOptions);
918+ lang::Def (lang::Sema (compilerOptions).checkFunction (treeRef)),
919+ compilerOptions);
919920}
920921
921922// NOTE: there is no guarantee here that the tc string has only one def. It
Original file line number Diff line number Diff line change 2121#include " tc/lang/error_report.h"
2222#include " tc/lang/tree.h"
2323#include " tc/lang/tree_views.h"
24+ #include " tc/utils/compiler_options.h"
2425
2526namespace lang {
2627
@@ -170,6 +171,10 @@ static inline TreeRef match_types(TreeRef a, TreeRef b) {
170171// / variable objects.
171172// / - checks that input variables are readonly.
172173struct Sema {
174+ explicit Sema (
175+ const tc::CompilerOptions& compilerOptions = tc::CompilerOptions())
176+ : compilerOptions(compilerOptions) {}
177+
173178 TreeRef typeOfExpr (TreeRef ref) {
174179 if (expr_to_type.count (ref) == 0 ) {
175180 throw ErrorReport (ref)
@@ -556,7 +561,7 @@ struct Sema {
556561 << " is not pre-initialized before calling the TC function,"
557562 << " consider using the !-suffixed reduction operator " << tk
558563 << " ! instead of " << tk;
559- warn (err);
564+ warn (err, compilerOptions );
560565 }
561566
562567 auto type = TensorType::create (
@@ -709,5 +714,8 @@ struct Sema {
709714
710715 std::unordered_set<std::string> inputParameters;
711716 std::unordered_set<std::string> nonTemporaries;
717+
718+ // TC compilation flow options.
719+ tc::CompilerOptions compilerOptions;
712720};
713721} // namespace lang
You can’t perform that action at this time.
0 commit comments