File tree Expand file tree Collapse file tree 10 files changed +24
-11
lines changed
Expand file tree Collapse file tree 10 files changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -483,6 +483,7 @@ SOURCE_FILES = \
483483 CodeGen_WebAssembly.cpp \
484484 CodeGen_WebGPU_Dev.cpp \
485485 CodeGen_X86.cpp \
486+ CompilerProfiling.cpp \
486487 CompilerLogger.cpp \
487488 ConstantBounds.cpp \
488489 ConstantInterval.cpp \
@@ -557,7 +558,6 @@ SOURCE_FILES = \
557558 Pipeline.cpp \
558559 Prefetch.cpp \
559560 PrintLoopNest.cpp \
560- ProfiledIRVisitor.cpp \
561561 Profiling.cpp \
562562 PurifyIndexMath.cpp \
563563 PythonExtensionGen.cpp \
@@ -678,6 +678,7 @@ HEADER_FILES = \
678678 CodeGen_PyTorch.h \
679679 CodeGen_Targets.h \
680680 CodeGen_WebGPU_Dev.h \
681+ CompilerProfiling.h \
681682 CompilerLogger.h \
682683 ConciseCasts.h \
683684 CPlusPlusMangle.h \
Original file line number Diff line number Diff line change 11#include " AddParameterChecks.h"
2+ #include " CompilerProfiling.h"
23#include " IROperator.h"
34#include " IRVisitor.h"
45#include " Substitute.h"
56#include " Target.h"
6- #include " CompilerProfiling.h"
77
88namespace Halide {
99namespace Internal {
Original file line number Diff line number Diff line change 99#include " CodeGen_Posix.h"
1010#include " CodeGen_Targets.h"
1111#include " CompilerLogger.h"
12+ #include " CompilerProfiling.h"
1213#include " Debug.h"
1314#include " Deinterleave.h"
1415#include " EmulateFloat16Math.h"
2829#include " Simplify.h"
2930#include " StrictifyFloat.h"
3031#include " Util.h"
31- #include " CompilerProfiling.h"
3232
3333// MSVC won't set __cplusplus correctly unless certain compiler flags are set
3434// (and CMake doesn't set those flags for you even if you specify C++17),
Original file line number Diff line number Diff line change @@ -184,7 +184,11 @@ template<typename Base>
184184class Profiled : public Base {
185185public:
186186 using Base::Base;
187+ #ifdef HALIDE_ENABLE_RTTI
187188 const char *tag = typeid (Base).name();
189+ #else
190+ const char *tag = " Unknown (no RTTI)" ;
191+ #endif
188192
189193#define PROFILE_VISIT_STMT_OVERRIDE (T ) \
190194 auto visit (const T *op) -> decltype(this ->Base::visit (op)) override { \
@@ -218,9 +222,11 @@ using Profiled = Profiling::Profiled<Base>;
218222#else
219223
220224namespace Profiling {
221- inline void generic_zone_begin (const char *src_tag, unsigned data = 0 ) {}
222- inline void generic_zone_end (const char *src_tag, unsigned data = 0 ) {}
225+ inline void generic_zone_begin (const char *src_tag, unsigned data = 0 ) {
223226}
227+ inline void generic_zone_end (const char *src_tag, unsigned data = 0 ) {
228+ }
229+ } // namespace Profiling
224230
225231template <typename Base>
226232using Profiled = Base;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace Internal {
66
77const char *IRNodeType_string (IRNodeType type) {
88 switch (type) {
9- #define PROFILE_NODE_CASE (T ) \
9+ #define PROFILE_NODE_CASE (T ) \
1010 case Halide::Internal::IRNodeType::T: \
1111 return #T;
1212
Original file line number Diff line number Diff line change @@ -168,7 +168,13 @@ class IRGraphVisitor : public IRVisitor {
168168template <typename T, typename ExprRet, typename StmtRet>
169169class VariadicVisitor {
170170private:
171+ #ifdef WITH_COMPILER_PROFILING
172+ #ifdef HALIDE_ENABLE_RTTI
171173 const char *name = typeid (T).name();
174+ #else
175+ const char *name = " VariadicVisitor" ;
176+ #endif
177+ #endif
172178
173179 template <typename ... Args>
174180 ExprRet dispatch_expr (const BaseExprNode *node, Args &&...args) {
Original file line number Diff line number Diff line change 11#include " LLVM_Runtime_Linker.h"
2+ #include " CompilerProfiling.h"
23#include " Error.h"
34#include " LLVM_Headers.h"
45#include " Target.h"
5- #include " CompilerProfiling.h"
66
77namespace Halide {
88
Original file line number Diff line number Diff line change 44#include " Argument.h"
55#include " Callable.h"
66#include " CodeGen_Internal.h"
7+ #include " CompilerProfiling.h"
78#include " Deserialization.h"
89#include " FindCalls.h"
910#include " Func.h"
1718#include " RealizationOrder.h"
1819#include " Serialization.h"
1920#include " WasmExecutor.h"
20- #include " CompilerProfiling.h"
2121
2222using namespace Halide ::Internal;
2323
Original file line number Diff line number Diff line change 11#include < map>
2- #include < unordered_map>
32#include < string>
3+ #include < unordered_map>
44#include < utility>
55
66#include " Bounds.h"
@@ -18,9 +18,9 @@ namespace Halide {
1818namespace Internal {
1919
2020using std::map;
21- using std::unordered_map;
2221using std::set;
2322using std::string;
23+ using std::unordered_map;
2424using std::vector;
2525
2626/* *
Original file line number Diff line number Diff line change 33
44#include " CSE.h"
55#include " CompilerLogger.h"
6+ #include " CompilerProfiling.h"
67#include " IRMutator.h"
78#include " Substitute.h"
8- #include " CompilerProfiling.h"
99
1010namespace Halide {
1111namespace Internal {
You can’t perform that action at this time.
0 commit comments