Download modules/gapi/src/utils/itt.hpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 3.23 kB
-
https://huggingface.co/tgollogly/test/resolve/main/modules/gapi/src/utils/itt.hpp
- Command line
-
hf download hf://tgollogly/test/modules/gapi/src/utils/itt.hpp
-
curl -L -o itt.hpp https://huggingface.co/tgollogly/test/resolve/main/modules/gapi/src/utils/itt.hpp
3.23 kB
| // This file is part of OpenCV project. | |
| // It is subject to the license terms in the LICENSE file found in the top-level directory | |
| // of this distribution and at http://opencv.org/license.html. | |
| // | |
| // Copyright (C) 2021 Intel Corporation | |
| // for GAPI_ITT_NAMED_TRACE_GUARD | |
| // NOTE: OPENCV_WITH_ITT is only defined if ITT dependency is built by OpenCV infrastructure. | |
| // There will not be such define in G-API standalone mode. | |
| // TODO: Consider using OpenCV's trace.hpp | |
| namespace cv { | |
| namespace util { | |
| template< class T > | |
| using remove_reference_t = typename std::remove_reference<T>::type; | |
| // Home brew ScopeGuard | |
| // D will be called automatically with p as argument when ScopeGuard goes out of scope. | |
| // call release() on the ScopeGuard object to revoke guard action | |
| template<typename T, typename D> | |
| auto make_ptr_guard(T* p, D&& d) -> std::unique_ptr<T, util::remove_reference_t<D>> { | |
| return {p, std::forward<D>(d)}; | |
| } | |
| } // namespace util | |
| namespace gimpl { | |
| extern __itt_domain* gapi_itt_domain; | |
| namespace { | |
| auto make_itt_guard = [](__itt_string_handle* h) { | |
| __itt_task_begin(gapi_itt_domain, __itt_null, __itt_null, (h)); | |
| return util::make_ptr_guard(reinterpret_cast<int*>(1), | |
| [](int* ){ __itt_task_end(gapi_itt_domain); }); | |
| }; | |
| } // namespace | |
| } // namespace gimpl | |
| } // namespace cv | |
| namespace cv { | |
| namespace gimpl { | |
| struct dumb_guard { void reset() { } }; | |
| } // namespace gimpl | |
| } // namespace cv | |