Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tpetra_Details_KokkosCounter.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Tpetra: Templated Linear Algebra Services Package
4 //
5 // Copyright 2008 NTESS and the Tpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 // clang-format off
11 #ifndef TPETRA_DETAILS_KOKKOS_COUNTER_HPP
12 #define TPETRA_DETAILS_KOKKOS_COUNTER_HPP
13 
17 
18 #include <string>
19 #include <Teuchos_FancyOStream.hpp>
20 
21 namespace Tpetra {
22 namespace Details {
23 
25 namespace DeepCopyCounter {
27  void start();
28 
30  void reset();
31 
33  void stop();
34 
36  size_t get_count_same_space();
37 
40 
41 }
42 
44 namespace FenceCounter {
46  void start();
47 
49  void reset();
50 
52  void stop();
53 
55  size_t get_count_instance(const std::string & device);
56 
58  size_t get_count_global(const std::string & device);
59 }
60 
61 // clang-format on
62 
64 namespace KokkosRegionCounter {
66 void start();
67 
69 void reset();
70 
72 void stop();
73 
75 size_t get_count_region_contains(const std::string &substr);
76 
78 void dump_regions(std::ostream &os);
79 void dump_regions(Teuchos::FancyOStream &os);
80 } // namespace KokkosRegionCounter
81 
82 // clang-format off
83 
84 
85 
86 } // namespace Details
87 } // namespace Tpetra
88 
89 #endif // TPETRA_DETAILS_KOKKOS_COUNTER_HPP
void reset()
Reset the deep_copy counter.
void dump_regions(std::ostream &os)
Print all observed region labels, separated by newline.
size_t get_count_same_space()
Query the deep_copy counter for copies in the same space.
size_t get_count_global(const std::string &device)
Query the fence counter for given device, for an Kokkos::fence()
size_t get_count_region_contains(const std::string &substr)
How many regions containing substr have been seen.
void start()
Start the fence counter.
size_t get_count_different_space()
Query the deep_copy counter for copies between different spaces.
void reset()
Reset the fence counter.
void start()
Start the deep_copy counter.
size_t get_count_instance(const std::string &device)
Query the fence counter for given device, for an exec_space_instance.fence()
void stop()
Stop the deep_copy counter.