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(
915
915
const tc::CompilerOptions& compilerOptions = tc::CompilerOptions()) {
916
916
LOG_IF (INFO, tc::FLAGS_debug_halide) << treeRef;
917
917
return translateDef (
918
- lang::Def (lang::Sema ().checkFunction (treeRef)), compilerOptions);
918
+ lang::Def (lang::Sema (compilerOptions).checkFunction (treeRef)),
919
+ compilerOptions);
919
920
}
920
921
921
922
// 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 21
21
#include " tc/lang/error_report.h"
22
22
#include " tc/lang/tree.h"
23
23
#include " tc/lang/tree_views.h"
24
+ #include " tc/utils/compiler_options.h"
24
25
25
26
namespace lang {
26
27
@@ -170,6 +171,10 @@ static inline TreeRef match_types(TreeRef a, TreeRef b) {
170
171
// / variable objects.
171
172
// / - checks that input variables are readonly.
172
173
struct Sema {
174
+ explicit Sema (
175
+ const tc::CompilerOptions& compilerOptions = tc::CompilerOptions())
176
+ : compilerOptions(compilerOptions) {}
177
+
173
178
TreeRef typeOfExpr (TreeRef ref) {
174
179
if (expr_to_type.count (ref) == 0 ) {
175
180
throw ErrorReport (ref)
@@ -556,7 +561,7 @@ struct Sema {
556
561
<< " is not pre-initialized before calling the TC function,"
557
562
<< " consider using the !-suffixed reduction operator " << tk
558
563
<< " ! instead of " << tk;
559
- warn (err);
564
+ warn (err, compilerOptions );
560
565
}
561
566
562
567
auto type = TensorType::create (
@@ -709,5 +714,8 @@ struct Sema {
709
714
710
715
std::unordered_set<std::string> inputParameters;
711
716
std::unordered_set<std::string> nonTemporaries;
717
+
718
+ // TC compilation flow options.
719
+ tc::CompilerOptions compilerOptions;
712
720
};
713
721
} // namespace lang
You can’t perform that action at this time.
0 commit comments