Update(DeviceProxy): Dynamically Determine Memory Allocation Size & Remove Compile-Time size Calculations (#48)

* Update(DeviceProxy): Dynamically Determine Memory Allocation Size & Remove Compile-Time size Calculations

- Modified the Device proxy class to determine memory allocation size at runtime.
- Updated all classes that include the Device proxy to use dynamic memory allocation.
- Removed compile-time memory size calculations.
- Ensured the allocated number of backend queue data structures matches the number of RO device contexts.
This commit is contained in:
Avinash Kethineedi
2025-02-24 15:11:46 -06:00
committed by GitHub
parent 487e5b7d0f
commit eb5a38e806
23 changed files with 302 additions and 118 deletions
+9 -1
View File
@@ -36,10 +36,18 @@ class HdpProxy {
/*
* Placement new the memory which is allocated by proxy_
*/
HdpProxy() {
HdpProxy(size_t num_elems = 1) : proxy_{num_elems} {
new (proxy_.get()) HdpPolicy();
}
HdpProxy(const HdpProxy& other) = delete;
HdpProxy& operator=(const HdpProxy& other) = delete;
HdpProxy(HdpProxy&& other) = default;
HdpProxy& operator=(HdpProxy&& other) = default;
/*
* Since placement new is called in the constructor, then
* delete must be called manually.