From f0e8d11ed07d262ff3e9fc0d835c89f68dcc33ff Mon Sep 17 00:00:00 2001 From: Benjamin Welton Date: Tue, 28 May 2024 17:01:50 -0700 Subject: [PATCH] Build fixes for clang-18 (#880) Fixes unnecessary inline and ambiguous conditional return. [ROCm/rocprofiler-sdk commit: 00f31e593cdd72d018a1b95d85cc3178e2e30200] --- .../lib/rocprofiler-sdk/pc_sampling/ioctl/ioctl_adapter.cpp | 6 +++--- .../source/lib/rocprofiler-sdk/pc_sampling/utils.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/ioctl/ioctl_adapter.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/ioctl/ioctl_adapter.cpp index 29ac12b3d1..580833d6ed 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/ioctl/ioctl_adapter.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/ioctl/ioctl_adapter.cpp @@ -168,9 +168,9 @@ ioctl_query_pc_sampling_capabilities(uint32_t kfd_gpu_id, } *size = args.num_sample_info; - return (ret == -ENOSPC) ? ROCPROFILER_IOCTL_STATUS_BUFFER_TOO_SMALL - : (ret != 0) ? ROCPROFILER_IOCTL_STATUS_ERROR - : ROCPROFILER_IOCTL_STATUS_SUCCESS; + if(ret == -ENOSPC) return ROCPROFILER_IOCTL_STATUS_BUFFER_TOO_SMALL; + + return ret != 0 ? ROCPROFILER_IOCTL_STATUS_ERROR : ROCPROFILER_IOCTL_STATUS_SUCCESS; } rocprofiler_status_t diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/utils.hpp b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/utils.hpp index baabebb33c..4cfd40f9d3 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/utils.hpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/utils.hpp @@ -41,14 +41,14 @@ get_matching_hsa_pcs_method(rocprofiler_pc_sampling_method_t method); hsa_ven_amd_pcs_units_t get_matching_hsa_pcs_units(rocprofiler_pc_sampling_unit_t unit); -inline constexpr size_t +constexpr size_t get_hsa_pcs_latency() { // TODO: Check with David about the default value in the hsa-runtime return 1000; } -inline constexpr size_t +constexpr size_t get_hsa_pcs_buffer_size() { // TODO: Find the minimum size of all buffers and use that.