Add full namespace resolution in CAFFE_DURATION (#12065)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12065

Had compilation issues using CAFFE_DURATION in some contexts, specifically due to namespace resolution. Since this is a macro, it should fully qualify.

Reviewed By: heslami

Differential Revision: D10036132

fbshipit-source-id: b8d55dfe5e991ca702ce5b7483f0ffc699882c85
This commit is contained in:
Vlad Belous
2018-09-26 13:22:17 -07:00
committed by Facebook Github Bot
parent d9c27f4d8d
commit 6ff568df4d

View File

@@ -350,8 +350,8 @@ _ScopeGuard<T> ScopeGuard(T f) {
##__VA_ARGS__); \
}
#define CAFFE_DURATION(stats, field, ...) \
if (auto g = detail::ScopeGuard([&](int64_t nanos) { \
CAFFE_EVENT(stats, field, nanos, ##__VA_ARGS__); \
#define CAFFE_DURATION(stats, field, ...) \
if (auto g = ::caffe2::detail::ScopeGuard([&](int64_t nanos) { \
CAFFE_EVENT(stats, field, nanos, ##__VA_ARGS__); \
}))
} // namespace caffe2