Skip to content

User controllable and automatic constant memory placement#363

Open
PMQ9 wants to merge 9 commits intoRust-GPU:mainfrom
PMQ9:user_controllable_and_automatic_constant_memory_placement
Open

User controllable and automatic constant memory placement#363
PMQ9 wants to merge 9 commits intoRust-GPU:mainfrom
PMQ9:user_controllable_and_automatic_constant_memory_placement

Conversation

@PMQ9
Copy link
Contributor

@PMQ9 PMQ9 commented Feb 19, 2026

Implement some ideas for this issue: #218

Add explicit memory placement

Add methods allowing users to explicitly place:

  • static(s)
  • crate(s)
  • specific static(s) in a crate

in constant or global memory.

Add constant memory space overspill automatic handling

use_constant_memory_space = false by default

  • All statics will go to global memory
  • User can use the method above to explicitly place specific static(s) or crate(s) to constant memory
  • No auto-packing, no overflow warnings (user is responsible for ensuring what they want to place in constant memory actually fits)

if use_constant_memory_space = true

  • All eligible statics (immutable, freeze) automatically try to go to constant memory
  • Calculates the total size of all the statics that the user explicitly wants to place in constant memory, reserve some space for that
    • If the reserve space is larger than constant memory, throw a warning
  • The remaining statics: auto-packing kicks in, first-come-first-served, overflow spills to global with warnings
  • User can specify static(s) or crate(s) that they want to put in global, these will be exclude from automatic packing

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

Comments