diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 52467861..0f8c224e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -132,6 +132,29 @@ jobs: if-no-files-found: error retention-days: 5 + - name: Build RDC Examples + shell: bash + run: | + cd /opt/rocm/share/rdc/example + cmake -B build + make -C build -j $(nproc) + + - name: Test RDC Examples + shell: bash + run: | + cd /opt/rocm/share/rdc/example/build + for example in ./diagnostic ./fieldvalue ./jobstats ./rocprofiler; do + echo "Testing $example..." + echo 0 | $example + if [ $? -ne 0 ]; then + echo "Example $example failed!" + exit 1 + fi + done + echo "All examples ran successfully!" + + + test: needs: build runs-on: lstt @@ -178,4 +201,4 @@ jobs: exit 1 else echo "No missing libs found!" - fi + fi \ No newline at end of file diff --git a/example/diagnostic_example.cc b/example/diagnostic_example.cc index 9acd7bc6..f518d735 100644 --- a/example/diagnostic_example.cc +++ b/example/diagnostic_example.cc @@ -103,7 +103,8 @@ 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); + rdc_diag_callback_t callback; + result = rdc_diagnostic_run(rdc_handle, group_id, RDC_DIAG_LVL_SHORT, nullptr, 0, &response, &callback); if (result != RDC_ST_OK) { std::cout << "Error run RDC_DIAG_LVL_SHORT diagnostic. Return: " << rdc_status_string(result); diff --git a/example/rocprofiler_example.cc b/example/rocprofiler_example.cc index 48c69e94..98460559 100644 --- a/example/rocprofiler_example.cc +++ b/example/rocprofiler_example.cc @@ -128,8 +128,7 @@ int run() { field_ids.push_back(RDC_FI_GPU_MEMORY_USAGE); field_ids.push_back(RDC_FI_POWER_USAGE); // profiler metrics - field_ids.push_back(RDC_FI_PROF_MEAN_OCCUPANCY_PER_CU); - field_ids.push_back(RDC_FI_PROF_MEAN_OCCUPANCY_PER_ACTIVE_CU); + field_ids.push_back(RDC_FI_PROF_OCCUPANCY_PERCENT); field_ids.push_back(RDC_FI_PROF_ACTIVE_CYCLES); field_ids.push_back(RDC_FI_PROF_ACTIVE_WAVES); field_ids.push_back(RDC_FI_PROF_ELAPSED_CYCLES);