Linting workflow and clang-tidy fixes (#72)

* Update source/{bin,lib/{common,rocprofiler}}/CMakeLists.txt

- activate clang-tidy

* Update PTL submodule

- clang-tidy fixes

* Update .clang-tidy

- ignore performance-enum-size

* Update CI workflow

- update paths-ignore

* Add linting workflow

- runs clang-tidy

* Update cmake/rocprofiler_build_settings.cmake

- minor modification of flags not recognized by clang-tidy

* Update samples (all of them)

- rocprofiler-samples-build-flags target with -W -Wall -Wextra -Wshadow [-Werror]
- Link samples targets to rocprofiler-samples-build-flags if target exists
- Remove unused variable in main.cpp of api_{buffered,callback}_tracing
- Update samples/pc_sampling
  - single-user-multiple-agents.cpp ends up with unused function find_first_gpu_agent() error
  - change find_first_gpu_agent to return std::optional<rocprofiler_agent_t>
  - change usage after call to find_first_gpu_agent()
  - use find_first_gpu_agent() in single-user-multiple-agents.cpp to determine if there are any GPUs

* Update linting workflow

- fix path to run-ci.py script

* Update linting workflow

- install cmake

* Update common/container/stable_vector.hpp

- fix clang-tidy warning for readability-container-size-empty
This commit is contained in:
Jonathan R. Madsen
2023-09-21 14:35:20 -05:00
کامیت شده توسط GitHub
والد 8be4ca1a04
کامیت 34505943b2
19فایلهای تغییر یافته به همراه173 افزوده شده و 45 حذف شده
+6 -5
مشاهده پرونده
@@ -7,6 +7,7 @@
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <optional>
#include <string>
#include <string_view>
@@ -69,7 +70,7 @@ find_first_gpu_agent_impl(rocprofiler_agent_t** agents, size_t num_agents, void*
return ROCPROFILER_STATUS_ERROR;
}
static rocprofiler_agent_t
static std::optional<rocprofiler_agent_t>
find_first_gpu_agent()
{
// This function returns the first gpu agent it encounters.
@@ -77,10 +78,10 @@ find_first_gpu_agent()
// and return if the agent is MI200.
rocprofiler_agent_t gpu_agent;
ROCPROFILER_CALL(rocprofiler_query_available_agents(&find_first_gpu_agent_impl,
sizeof(rocprofiler_agent_t),
static_cast<void*>(&gpu_agent)),
"Could not query GPU agents");
auto status = rocprofiler_query_available_agents(
&find_first_gpu_agent_impl, sizeof(rocprofiler_agent_t), static_cast<void*>(&gpu_agent));
if(status != ROCPROFILER_STATUS_SUCCESS) return std::nullopt;
return gpu_agent;
}