Repository navigation
fix: add CPU memory space detection - #79
Merged
Merged
Conversation
Add the missing GetMemorySpace specialization for the CPU device. CPU memory is classified as host memory.
Ziminli
self-requested a review
October 15, 2026 06:02
Ziminli
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the missing
GetMemorySpace<Device::Type::kCpu>specialization insrc/devices/cpu/device_.h.The CPU device currently lacks this specialization, which can cause undefined reference errors when CPU execution paths use
GetMemorySpace<kCpu>.This change completes the CPU memory-space interface by returning
MemorySpace::kHost.Changes
GetMemorySpace<kCpu>specialization.MemorySpace::kHost.src/devices/cpu/device_.h, without modifying public APIs or communication algorithms.Platform and Backend Affected
Platform
Backend
The implementation is device-level and is not inherently tied to a specific communication backend. OpenMPI is the validated configuration.
Performance Impact
No performance impact is expected because this change provides a missing memory-space specialization without modifying existing communication algorithms.
Benchmark: N/A.
Known Issues & Future Work
Test Results
Test Environment
masterBuild configuration:
Test Execution
Executed the official
scripts/run_examples.pytest suite using the CPU-only OpenMPI configuration.Results:
Passed examples:
mpi/all_reducempi/all_gathermpi/reducempi/all_to_allmpi/reduce_scattermpi/scattermpi/broadcastmpi/gathermpi/send_recvThe Broadcast example also passed all three scenarios:
All selected examples completed successfully.
Per-example test logs were generated by the official test harness and will be provided as an archive in a follow-up PR comment.
Test Involved Platform
Test Involved Backend
Checklist
Title, Branch, and Commits
fix/naming convention.fixup!,squash!, orwipcommits remain.Scope and Design
General Code Hygiene
C++ Specific
clang-format-16has not been run because it is unavailable in the current environment.Python Specific
Testing
Build, CI, and Tooling
Documentation
Security and Safety
run_20261014_121207.zip