From ea7ccd0660a4fa0425c6f217baed6609dd536727 Mon Sep 17 00:00:00 2001 From: "Galantsev, Dmitrii" Date: Thu, 13 Mar 2025 06:44:11 +0000 Subject: [PATCH] Fix diagnostic example and allow building Change-Id: Icc85e8018a11b66d1190fa910151acb79cd17b83 Signed-off-by: Galantsev, Dmitrii --- CMakeLists.txt | 7 +++++++ example/CMakeLists.txt | 1 - example/diagnostic_example.cc | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ac608a174..975464b96d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,9 @@ option(BUILD_RVS "Build targets for librdc_rvs.so" ON) # When cmake -DBUILD_TESTS=off, it will not build RDC tests. option(BUILD_TESTS "Build test suite" OFF) +# When cmake -DBUILD_EXAMPLES=off, it will not build RDC examples +option(BUILD_EXAMPLES "Build examples" OFF) + # Enable shared libraries for gtest option(BUILD_SHARED_LIBS "Build shared library (.so) or not." ON) @@ -316,6 +319,10 @@ endif() # Folders for both standalone and embedded add_subdirectory("rdc_libs") +if(BUILD_EXAMPLES) + add_subdirectory("example") +endif() + # Export the package for use from the build-tree # (this registers the build-tree with a global CMake-registry) export(PACKAGE rdc) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 68ebb9bb83..01fe13d8c2 100755 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -76,7 +76,6 @@ set(CMAKE_LIBRARY_PATH find_package(rdc CONFIG REQUIRED) - message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") message(" Cmake Example ") message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") diff --git a/example/diagnostic_example.cc b/example/diagnostic_example.cc index 9acd7bc65d..340c450255 100644 --- a/example/diagnostic_example.cc +++ b/example/diagnostic_example.cc @@ -36,7 +36,7 @@ static std::string get_test_name(rdc_diag_test_cases_t test_case) { {RDC_DIAG_COMPUTE_QUEUE, "Compute Queue ready"}, {RDC_DIAG_SYS_MEM_CHECK, "System memory check"}, {RDC_DIAG_NODE_TOPOLOGY, "Node topology check"}, - {RDC_DIAG_RVS_TEST, "RVS check"}, + {RDC_DIAG_RVS_GST_TEST, "RVS check"}, {RDC_DIAG_GPU_PARAMETERS, "GPU parameters check"}, {RDC_DIAG_TEST_LAST, "Unknown"}}; @@ -103,7 +103,7 @@ int main(int, char**) { // (2) start to run short diagnostic. rdc_diag_response_t response; - result = rdc_diagnostic_run(rdc_handle, group_id, RDC_DIAG_LVL_SHORT, nullptr, 0, &response); + result = rdc_diagnostic_run(rdc_handle, group_id, RDC_DIAG_LVL_SHORT, nullptr, 0, &response, nullptr); if (result != RDC_ST_OK) { std::cout << "Error run RDC_DIAG_LVL_SHORT diagnostic. Return: " << rdc_status_string(result);