diff --git a/projects/rocprofiler-sdk/source/lib/common/container/operators.hpp b/projects/rocprofiler-sdk/source/lib/common/container/operators.hpp index 3531fd9fd5..24b0d44388 100644 --- a/projects/rocprofiler-sdk/source/lib/common/container/operators.hpp +++ b/projects/rocprofiler-sdk/source/lib/common/container/operators.hpp @@ -162,10 +162,10 @@ struct dereferenceable : B P operator->() const { return ::std::addressof(*static_cast(*this)); } }; -template > +template > struct indexable : B { - R operator[](I n) const { return *(static_cast(*this) + n); } + R operator[](N n) const { return *(static_cast(*this) + n); } }; template > diff --git a/projects/rocprofiler-sdk/source/lib/common/container/small_vector.hpp b/projects/rocprofiler-sdk/source/lib/common/container/small_vector.hpp index 1f88a86359..bb0c56ddcd 100644 --- a/projects/rocprofiler-sdk/source/lib/common/container/small_vector.hpp +++ b/projects/rocprofiler-sdk/source/lib/common/container/small_vector.hpp @@ -770,7 +770,7 @@ public: return result; } - void swap(small_vector_impl& RHS); + void swap(small_vector_impl& RHS) noexcept; /// add the specified range to the end of the small_vector. template > @@ -1073,7 +1073,7 @@ public: template void -small_vector_impl::swap(small_vector_impl& RHS) +small_vector_impl::swap(small_vector_impl& RHS) noexcept { if(this == &RHS) return; @@ -1486,7 +1486,7 @@ namespace std template inline void swap(rocprofiler::common::container::small_vector_impl& LHS, - rocprofiler::common::container::small_vector_impl& RHS) + rocprofiler::common::container::small_vector_impl& RHS) noexcept { LHS.swap(RHS); } @@ -1495,7 +1495,7 @@ swap(rocprofiler::common::container::small_vector_impl& LHS, template inline void swap(rocprofiler::common::container::small_vector& LHS, - rocprofiler::common::container::small_vector& RHS) + rocprofiler::common::container::small_vector& RHS) noexcept { LHS.swap(RHS); } diff --git a/projects/rocprofiler-sdk/source/lib/common/container/stable_vector.hpp b/projects/rocprofiler-sdk/source/lib/common/container/stable_vector.hpp index ca6449b5ad..4d30b9d3b8 100644 --- a/projects/rocprofiler-sdk/source/lib/common/container/stable_vector.hpp +++ b/projects/rocprofiler-sdk/source/lib/common/container/stable_vector.hpp @@ -206,9 +206,9 @@ public: } bool operator!=(const this_type& c) const { return !operator==(c); } - void swap(this_type& v) { std::swap(m_chunks, v.m_chunks); } + void swap(this_type& v) noexcept { std::swap(m_chunks, v.m_chunks); } - friend void swap(this_type& l, this_type& r) { l.swap(r); } + friend void swap(this_type& l, this_type& r) noexcept { l.swap(r); } reference front() { return m_chunks.front()->front(); } const_reference front() const { return front(); } diff --git a/projects/rocprofiler-sdk/source/lib/common/container/static_vector.hpp b/projects/rocprofiler-sdk/source/lib/common/container/static_vector.hpp index 15cfe6f529..ee8aa30800 100644 --- a/projects/rocprofiler-sdk/source/lib/common/container/static_vector.hpp +++ b/projects/rocprofiler-sdk/source/lib/common/container/static_vector.hpp @@ -100,9 +100,9 @@ struct static_vector auto* data() { return m_data.data(); } const auto* data() const { return m_data.data(); } - void swap(this_type& _v); + void swap(this_type& _v) noexcept; - friend void swap(this_type& _lhs, this_type& _rhs) { _lhs.swap(_rhs); } + friend void swap(this_type& _lhs, this_type& _rhs) noexcept { _lhs.swap(_rhs); } private: void update_size(size_t); @@ -172,7 +172,7 @@ static_vector::clear() template void -static_vector::swap(this_type& _v) +static_vector::swap(this_type& _v) noexcept { if constexpr(AtomicSizeV) { diff --git a/projects/rocprofiler-sdk/source/lib/common/units.hpp b/projects/rocprofiler-sdk/source/lib/common/units.hpp index 99d10898bb..34b9b54995 100644 --- a/projects/rocprofiler-sdk/source/lib/common/units.hpp +++ b/projects/rocprofiler-sdk/source/lib/common/units.hpp @@ -24,6 +24,8 @@ #include "lib/common/environment.hpp" +#include + #include #include #include @@ -212,8 +214,7 @@ get_memory_unit(std::string _unit) } } - std::cerr << "Warning!! No memory unit matching \"" << _unit << "\". Using default..." - << std::endl; + LOG(WARNING) << "Warning!! No memory unit matching \"" << _unit << "\". Using default...\n"; return return_type{"MB", units::megabyte}; } @@ -249,8 +250,7 @@ get_timing_unit(std::string _unit) } } - std::cerr << "Warning!! No timing unit matching \"" << _unit << "\". Using default..." - << std::endl; + LOG(WARNING) << "Warning!! No timing unit matching \"" << _unit << "\". Using default...\n"; return return_type{"sec", units::sec}; } @@ -280,8 +280,7 @@ get_frequncy_unit(std::string _unit) } } - std::cerr << "Warning!! No frequency unit matching \"" << _unit << "\". Using default..." - << std::endl; + LOG(WARNING) << "Warning!! No frequency unit matching \"" << _unit << "\". Using default...\n"; return return_type{"MHz", units::megahertz}; } @@ -316,8 +315,7 @@ get_power_unit(const std::string& _unit) } } - std::cerr << "Warning!! No power unit matching \"" << _unit << "\". Using default..." - << std::endl; + LOG(WARNING) << "Warning!! No power unit matching \"" << _unit << "\". Using default...\n"; return return_type{"watts", units::watt}; } diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/parser/correlation.hpp b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/parser/correlation.hpp index d0a14f49a6..8669e04ad2 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/parser/correlation.hpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/parser/correlation.hpp @@ -28,6 +28,8 @@ #include #include +#include + #include "lib/rocprofiler-sdk/pc_sampling/parser/translation.hpp" template <> @@ -258,8 +260,8 @@ _parse_buffer(generic_sample_t* buffer, break; } default: - std::cerr << "Index " << index << " - Invalid sample type: " << buffer[index].type - << std::endl; + LOG(WARNING) << "Index " << index + << " - Invalid sample type: " << buffer[index].type << "\n"; return PCSAMPLE_STATUS_INVALID_SAMPLE; } }