Skip to content

build: add spmm, execution_context and thread_trace to parent build lists - #602

Open
dezhenlu wants to merge 2 commits into
ROCm:amd-stagingfrom
dezhenlu:build-wire-missing-examples
Open

dezhenlu wants to merge 2 commits into
ROCm:amd-stagingfrom
dezhenlu:build-wire-missing-examples

Conversation

@dezhenlu

Copy link
Copy Markdown

This is a repost of #588, which is no longer visible. It is rebased onto the current default branch.

Motivation

rocSPARSE/level_3/spmm, HIP-Basic/execution_context and rocProfiler-SDK/thread_trace each have their own CMakeLists.txt and Makefile, but the parent directory doesn't list them. So the top-level builds and CI skip them. spmm is missing from both parent files. The other two are missing only from the parent Makefile.

Technical Details

This adds the missing entries, in the same alphabetical position the neighbouring entries use:

  • Libraries/rocSPARSE/level_3/CMakeLists.txt: add_subdirectory(spmm) between sddmm and spsm
  • Libraries/rocSPARSE/level_3/Makefile: spmm between sddmm and spsm
  • HIP-Basic/Makefile: execution_context between events and gpu_arch, outside the CUDA-only and HIP-only blocks, as in HIP-Basic/CMakeLists.txt. Its own Makefile already handles both runtimes.
  • Libraries/rocProfiler-SDK/Makefile: thread_trace after pc_sampling. CMake already builds and tests it unconditionally on Linux, and its Makefile links the same libraries as the CMake target.

No workflow or skip manifest changes. CI builds from these lists, and none of the three examples is in skip_manifest.py.

How I found it

I was reading the rocSPARSE level 3 examples and noticed that spmm has a README entry and VS projects but no line in the parent CMakeLists.txt. git log shows it came in with #102 next to sddmm and spsm, which were added to both parent files while spmm wasn't. I then wrote a small script that walks the tree and reports every directory with its own CMakeLists.txt or Makefile that the parent doesn't reference. Apart from the three that are commented out in their parent CMakeLists.txt with a comment saying why (mv_objdetect, opencv_orb, groupedgemm_get_all_algos_ext), these three were the only hits.

Where this can show up in practice

If someone builds the examples from the top level with CMake or Make, they don't get these three binaries, and ctest/make test don't run them. CI has never compiled spmm on Linux, and the Visual Studio workflow, which does have projects for it, is currently disabled. So right now a rocSPARSE API change that broke spmm wouldn't show up in any CI job. I don't have a report from someone who ran into this. This is my reading of the build files.

The second commit lists the .cpp sources explicitly in the thread_trace and code_object_isa_decode Makefiles. Since #571 moved the Makefiles to amdclang++, $^ also passes rocprofiler_utils.hpp to the compiler, and clang rejects that with -o ("cannot specify -o when generating multiple output files"). pc_sampling already lists its sources this way.

Test Plan

Without a ROCm install (macOS, arm64):

  • make -n in each of the three parent directories, before and after: all and test now also enter spmm, execution_context and thread_trace respectively, and nothing else changes.
  • The tree walk script, run again: the only directories still unreferenced are the three commented-out ones above.
  • spmm/main.cpp, -fsyntax-only with the flags from its Makefile (c++ -std=c++17 -Wall -Wextra -D__HIP_PLATFORM_AMD__) against the rocSPARSE headers from rocm-libraries and the HIP headers from rocm-systems at today's heads. The headers those libraries generate at build time (rocsparse-config.h, rocsparse-version.h, rocsparse-export.h, hip/hip_version.h) were stubbed. sddmm, spsm and csrmm were checked the same way for comparison.
  • Read spmm/main.cpp against the rocsparse_spmm header docs: it calls the buffer size, preprocess and compute stages in the documented order.

Test Result

  • make -n: one new target per directory, as listed above.
  • Tree walk: only the three commented-out entries remain.
  • Syntax check: spmm and the three comparison examples have no errors and no warnings.

Not run: a CMake configure or any build against a real ROCm install, and none of the examples were run on a GPU. I don't have AMD hardware, so the CI run here will be the first Linux build and make test run of spmm.

Added/Updated documentation?

  • Yes
  • No, does not apply to this PR.

Included Visual Studio files?

  • Yes
  • No, does not apply to this PR. (spmm already has VS projects. This PR only touches the Linux CMake and Make lists and doesn't add VS projects for the other two.)

Submission Checklist

  • New examples contain proper CMake and Make files. (No new examples; the three existing ones already have both.)
  • I have updated relevant CI workflows and the new examples are being built and tested in CI. (No workflow change needed; CI picks them up from these lists.)
  • Check and guard against unsupported ASICs if relevant dependent libraries have limited support.
  • Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

rocSPARSE level_3 spmm was never added to the parent CMakeLists.txt and
Makefile, and HIP-Basic execution_context and rocProfiler-SDK
thread_trace are listed in the parent CMakeLists.txt but not in the
parent Makefile. Add them next to their neighbours.

Signed-off-by: Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
…code Makefiles

$^ also passed rocprofiler_utils.hpp to the compiler, which clang
rejects with -o ("cannot specify -o when generating multiple output
files"). List the .cpp files instead, as pc_sampling does.

Signed-off-by: Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
@dezhenlu
dezhenlu requested a review from a team as a code owner November 28, 2026 10:50
@dezhenlu

Copy link
Copy Markdown
Author

I only noticed after opening this that #597 already wires up the same three examples (spmm, execution_context, thread_trace) and also covers MIVisionX. The first commit here duplicates that, so please go with #597 for the parent lists.

The second commit isn't covered there. Since #571 the thread_trace and code_object_isa_decode Makefiles pass $^ to amdclang++, which includes rocprofiler_utils.hpp, and clang rejects that together with -o ("cannot specify -o when generating multiple output files"). Once thread_trace is in the parent Makefile, a top-level make will hit this. If that's useful, I can drop the first commit so this PR only carries the Makefile source-list fix, or close it if you'd rather fold the fix into #597.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant