Skip to content

Conversation

@pvelesko
Copy link
Collaborator

  • SPVRegister: tolerate duplicate variable registration for identical (Ptr, Name) pairs
  • CHIPBackend: restore invariant in Device::getOrCreateModule, remove early null return
  • CHIPBindings: remove unreliable runtime fallback with address-range heuristics
  • HipGlobalVariables: maintain original COMDAT exclusion logic (reverted from initial approach)
  • TestTemplatedConstantMemcpy: add device-side validation kernel to verify actual data visibility

Fixes: #977

@pvelesko pvelesko marked this pull request as draft October 22, 2025 08:10
@pvelesko pvelesko force-pushed the fix-977 branch 2 times, most recently from 472bc6e to 5551551 Compare October 22, 2025 12:55
@pvelesko pvelesko added in-progress Work still in progress and removed in-progress Work still in progress labels Oct 31, 2025
- Introduced TestTemplatedConstantMemcpy.hip to reproduce Issue #977.
- The test verifies the behavior of hipMemcpyToSymbol with templated constant memory.
- Updated CMakeLists.txt to include the new test in the build process.
- SPVRegister: tolerate duplicate variable registration for identical (Ptr, Name) pairs
- CHIPBackend: restore invariant in Device::getOrCreateModule, remove early null return
- CHIPBindings: remove unreliable runtime fallback with address-range heuristics
- HipGlobalVariables: maintain original COMDAT exclusion logic (reverted from initial approach)
- TestTemplatedConstantMemcpy: add device-side validation kernel to verify actual data visibility

Fixes: #977
Replace malloc + placement new with std::unique_ptr for synthetic
SPVVariable objects created for device-only variables (e.g., templated
__constant__ variables). The static vector now stores unique_ptr which
ensures proper destruction of std::string members and memory deallocation
when the program exits.
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.

CHIP-SPV Error 13: hipMemcpyToSymbol with templated __constant__ memory fails

2 participants