_tbb_trace_impl.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. Copyright (c) 2005-2020 Intel Corporation
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #ifndef _FGT_TBB_TRACE_IMPL_H
  14. #define _FGT_TBB_TRACE_IMPL_H
  15. #include "../tbb_profiling.h"
  16. namespace tbb {
  17. namespace internal {
  18. #if TBB_PREVIEW_ALGORITHM_TRACE
  19. static inline void fgt_algorithm( string_index t, void *algorithm, void *parent ) {
  20. itt_make_task_group( ITT_DOMAIN_FLOW, algorithm, ALGORITHM, parent, ALGORITHM, t );
  21. }
  22. static inline void fgt_begin_algorithm( string_index t, void *algorithm ) {
  23. itt_task_begin( ITT_DOMAIN_FLOW, algorithm, ALGORITHM, NULL, FLOW_NULL, t );
  24. }
  25. static inline void fgt_end_algorithm( void * ) {
  26. itt_task_end( ITT_DOMAIN_FLOW );
  27. }
  28. static inline void fgt_alg_begin_body( string_index t, void *body, void *algorithm ) {
  29. itt_task_begin( ITT_DOMAIN_FLOW, body, FLOW_BODY, algorithm, ALGORITHM, t );
  30. }
  31. static inline void fgt_alg_end_body( void * ) {
  32. itt_task_end( ITT_DOMAIN_FLOW );
  33. }
  34. #else // TBB_PREVIEW_ALGORITHM_TRACE
  35. static inline void fgt_algorithm( string_index /*t*/, void * /*algorithm*/, void * /*parent*/ ) { }
  36. static inline void fgt_begin_algorithm( string_index /*t*/, void * /*algorithm*/ ) { }
  37. static inline void fgt_end_algorithm( void * ) { }
  38. static inline void fgt_alg_begin_body( string_index /*t*/, void * /*body*/, void * /*algorithm*/ ) { }
  39. static inline void fgt_alg_end_body( void * ) { }
  40. #endif // TBB_PREVIEW_ALGORITHM_TRACEE
  41. } // namespace internal
  42. } // namespace tbb
  43. #endif