1 #pragma once 2 3 #include <c10/macros/Export.h> 4 #include <string> 5 6 namespace torch::profiler::impl { 7 8 // Adds the execution trace observer as a global callback function, the data 9 // will be written to output file path. 10 TORCH_API bool addExecutionTraceObserver(const std::string& output_file_path); 11 12 // Remove the execution trace observer from the global callback functions. 13 TORCH_API void removeExecutionTraceObserver(); 14 15 // Enables execution trace observer. 16 TORCH_API void enableExecutionTraceObserver(); 17 18 // Disables execution trace observer. 19 TORCH_API void disableExecutionTraceObserver(); 20 21 } // namespace torch::profiler::impl 22