|
Ginkgo
Generated from pipelines/1556235455 branch based on develop. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_LOG_PERFORMANCE_HINT_HPP_
6 #define GKO_PUBLIC_CORE_LOG_PERFORMANCE_HINT_HPP_
11 #include <unordered_map>
13 #include <ginkgo/core/log/logger.hpp>
33 const uintptr& location)
const override;
36 const uintptr& location)
const override;
41 const size_type& num_bytes)
const override;
61 static std::unique_ptr<PerformanceHint>
create(
62 std::ostream& os = std::cerr,
size_type allocation_size_limit = 16,
66 os, allocation_size_limit, copy_size_limit, histogram_max_size));
75 allocation_size_limit_{allocation_size_limit},
76 copy_size_limit_{copy_size_limit},
77 histogram_max_size_{histogram_max_size}
82 std::ostream& log()
const;
85 mutable std::unordered_map<uintptr_t, size_type> allocation_sizes_;
86 mutable std::unordered_map<size_type, int> allocation_histogram_;
87 mutable std::unordered_map<uintptr_t, int> copy_src_histogram_;
88 mutable std::unordered_map<uintptr_t, int> copy_dst_histogram_;
92 static constexpr Logger::mask_type mask_ =
93 Logger::allocation_completed_mask | Logger::free_completed_mask |
94 Logger::copy_completed_mask;
95 static constexpr
const char* prefix_ =
"[PERFORMANCE] >>> ";
103 #endif // GKO_PUBLIC_CORE_LOG_PERFORMANCE_HINT_HPP_
std::uintptr_t uintptr
Unsigned integer type capable of holding a pointer to void.
Definition: types.hpp:138
std::size_t size_type
Integral type used for allocation quantities.
Definition: types.hpp:86
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
Definition: logger.hpp:75
The first step in using the Ginkgo library consists of creating an executor.
Definition: executor.hpp:615