pytorch/torch/csrc/itt_wrapper.cpp
cyy 77f2883c41 [Reland2] fix missing-prototypes warnings in torch_cpu (Part 4) (#102228)
This PR relands the changes introduced in PR https://github.com/pytorch/pytorch/pull/100849. The old PR turnd nnc_* functions into  static. We now add declarations for them and hope that inter builds will pass.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/102228
Approved by: https://github.com/albanD
2023-06-02 22:04:44 +00:00

29 lines
754 B
C++

#include <ittnotify.h>
#include <torch/csrc/itt_wrapper.h>
#include <torch/csrc/profiler/stubs/base.h>
namespace torch {
namespace profiler {
__itt_domain* _itt_domain = __itt_domain_create("PyTorch");
bool itt_is_available() {
return torch::profiler::impl::ittStubs()->enabled();
}
void itt_range_push(const char* msg) {
__itt_string_handle* hsMsg = __itt_string_handle_create(msg);
__itt_task_begin(_itt_domain, __itt_null, __itt_null, hsMsg);
}
void itt_range_pop() {
__itt_task_end(_itt_domain);
}
void itt_mark(const char* msg) {
__itt_string_handle* hsMsg = __itt_string_handle_create(msg);
__itt_task_begin(_itt_domain, __itt_null, __itt_null, hsMsg);
__itt_task_end(_itt_domain);
}
} // namespace profiler
} // namespace torch