clang-18 warning fixes (part 1) (#785)
* clang-18 warning fixes (part 1)
* format fixes
* More format fixes
* More format fixes
[ROCm/rocprofiler-sdk commit: c668028781]
Αυτή η υποβολή περιλαμβάνεται σε:
υποβλήθηκε από
GitHub
γονέας
360595c82e
υποβολή
a81a453940
@@ -50,12 +50,12 @@ public:
|
||||
static_assert(std::is_arithmetic<Tp>::value, "only supports arithmetic types");
|
||||
|
||||
public:
|
||||
inline statistics() = default;
|
||||
inline ~statistics() = default;
|
||||
inline statistics(const statistics&) = default;
|
||||
inline statistics(statistics&&) noexcept = default;
|
||||
inline statistics& operator=(const statistics&) = default;
|
||||
inline statistics& operator=(statistics&&) noexcept = default;
|
||||
statistics() = default;
|
||||
~statistics() = default;
|
||||
statistics(const statistics&) = default;
|
||||
statistics(statistics&&) noexcept = default;
|
||||
statistics& operator=(const statistics&) = default;
|
||||
statistics& operator=(statistics&&) noexcept = default;
|
||||
|
||||
explicit statistics(value_type val)
|
||||
: m_cnt(1)
|
||||
@@ -77,13 +77,13 @@ public:
|
||||
|
||||
public:
|
||||
// Accumulated values
|
||||
inline int64_t get_count() const { return m_cnt; }
|
||||
inline value_type get_min() const { return m_min; }
|
||||
inline value_type get_max() const { return m_max; }
|
||||
inline value_type get_sum() const { return m_sum; }
|
||||
inline value_type get_sqr() const { return m_sqr; }
|
||||
inline float_type get_mean() const { return static_cast<float_type>(m_sum) / m_cnt; }
|
||||
inline float_type get_variance() const
|
||||
int64_t get_count() const { return m_cnt; }
|
||||
value_type get_min() const { return m_min; }
|
||||
value_type get_max() const { return m_max; }
|
||||
value_type get_sum() const { return m_sum; }
|
||||
value_type get_sqr() const { return m_sqr; }
|
||||
float_type get_mean() const { return static_cast<float_type>(m_sum) / m_cnt; }
|
||||
float_type get_variance() const
|
||||
{
|
||||
if(m_cnt < 2) return (m_sum - m_sum);
|
||||
|
||||
@@ -92,10 +92,10 @@ public:
|
||||
return (_sum_of_squared_samples - _sum_squared_mean) / static_cast<float_type>(m_cnt - 1);
|
||||
}
|
||||
|
||||
inline float_type get_stddev() const { return ::std::sqrt(::std::abs(get_variance())); }
|
||||
float_type get_stddev() const { return ::std::sqrt(::std::abs(get_variance())); }
|
||||
|
||||
// Modifications
|
||||
inline void reset()
|
||||
void reset()
|
||||
{
|
||||
m_cnt = 0;
|
||||
m_sum = value_type{};
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
|
||||
public:
|
||||
// Operators (value_type)
|
||||
inline statistics& operator+=(value_type val)
|
||||
statistics& operator+=(value_type val)
|
||||
{
|
||||
if(m_cnt == 0)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline statistics& operator-=(value_type val)
|
||||
statistics& operator-=(value_type val)
|
||||
{
|
||||
if(m_cnt > 1) --m_cnt;
|
||||
m_sum -= val;
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline statistics& operator*=(value_type val)
|
||||
statistics& operator*=(value_type val)
|
||||
{
|
||||
m_sum *= val;
|
||||
m_sqr *= (val * val);
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline statistics& operator/=(value_type val)
|
||||
statistics& operator/=(value_type val)
|
||||
{
|
||||
m_sum /= val;
|
||||
m_sqr /= (val * val);
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
|
||||
public:
|
||||
// Operators (this_type)
|
||||
inline statistics& operator+=(const statistics& rhs)
|
||||
statistics& operator+=(const statistics& rhs)
|
||||
{
|
||||
if(m_cnt == 0)
|
||||
{
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
}
|
||||
|
||||
// Operators (this_type)
|
||||
inline statistics& operator-=(const statistics& rhs)
|
||||
statistics& operator-=(const statistics& rhs)
|
||||
{
|
||||
if(m_cnt > 0)
|
||||
{
|
||||
|
||||
@@ -698,7 +698,7 @@ write_ring_buffer(Tb* _v, buffer_type_t type)
|
||||
ptr = _tmp_buf->request(false);
|
||||
CHECK(ptr != nullptr);
|
||||
}
|
||||
*ptr = std::move(*reinterpret_cast<Tb*>(_v));
|
||||
*ptr = std::move(*_v);
|
||||
}
|
||||
|
||||
template <typename Tp>
|
||||
|
||||
@@ -39,7 +39,7 @@ hsa_ven_amd_aqlprofile_id_query_t
|
||||
get_query_info(rocprofiler_agent_id_t agent, const counters::Metric& metric)
|
||||
{
|
||||
auto aql_agent = *CHECK_NOTNULL(rocprofiler::agent::get_aql_agent(agent));
|
||||
aqlprofile_pmc_profile_t profile{.agent = aql_agent};
|
||||
aqlprofile_pmc_profile_t profile = {.agent = aql_agent};
|
||||
hsa_ven_amd_aqlprofile_id_query_t query = {metric.block().c_str(), 0, 0};
|
||||
if(aqlprofile_get_pmc_info(&profile, AQLPROFILE_INFO_BLOCK_ID, &query) != HSA_STATUS_SUCCESS)
|
||||
{
|
||||
|
||||
@@ -103,8 +103,8 @@ findDeviceMetrics(const rocprofiler_agent_t& agent, const std::unordered_set<std
|
||||
hsa_ven_amd_aqlprofile_id_query_t
|
||||
v1_get_query_info(hsa_agent_t agent, const counters::Metric& metric)
|
||||
{
|
||||
hsa_ven_amd_aqlprofile_profile_t profile{.agent = agent};
|
||||
hsa_ven_amd_aqlprofile_id_query_t query = {metric.block().c_str(), 0, 0};
|
||||
hsa_ven_amd_aqlprofile_profile_t profile = {.agent = agent};
|
||||
hsa_ven_amd_aqlprofile_id_query_t query = {metric.block().c_str(), 0, 0};
|
||||
if(hsa_ven_amd_aqlprofile_get_info(&profile, HSA_VEN_AMD_AQLPROFILE_INFO_BLOCK_ID, &query) !=
|
||||
HSA_STATUS_SUCCESS)
|
||||
{
|
||||
|
||||
+1
-1
@@ -901,7 +901,7 @@ struct poll_kfd_t
|
||||
active = true;
|
||||
}
|
||||
|
||||
inline static auto get_event_id(const std::string_view& strn)
|
||||
static auto get_event_id(const std::string_view& strn)
|
||||
{
|
||||
uint32_t event_id{std::numeric_limits<uint32_t>::max()};
|
||||
std::sscanf(strn.data(), "%x ", &event_id);
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user