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.

[ROCm/rocshmem commit: eb5a38e806]
This commit is contained in:
Avinash Kethineedi
2025-02-24 15:11:46 -06:00
committed by GitHub
parent 95c4c0d428
commit 1831a1b33c
23 changed files with 302 additions and 118 deletions
@@ -486,9 +486,19 @@ std::string to_string(const ForwardList<TYPE, ALLOC>& list);
template <typename ALLOC, typename TYPE>
class ForwardListProxy {
using ProxyT = DeviceProxy<ALLOC, ForwardList<TYPE, ALLOC>, 1>;
using ProxyT = DeviceProxy<ALLOC, ForwardList<TYPE, ALLOC>>;
public:
ForwardList(size_t num_elems = 1) : proxy_{num_elems} {}
ForwardList(const ForwardList& other) = delete;
ForwardList& operator=(const ForwardList& other) = delete;
ForwardList(ForwardList&& other) = default;
ForwardList& operator=(ForwardList&& other) = default;
__host__ __device__ ForwardList<TYPE, ALLOC>* get() { return proxy_.get(); }
private:
+11 -1
View File
@@ -262,7 +262,17 @@ class FreeListProxy {
public:
__host__ __device__ FreeListT* get() { return proxy_.get(); }
FreeListProxy() { new (proxy_.get()) FreeListT(); }
FreeListProxy(size_t num_elems = 1) : proxy_{num_elems} {
new (proxy_.get()) FreeListT();
}
FreeListProxy(const FreeListProxy& other) = delete;
FreeListProxy& operator=(const FreeListProxy& other) = delete;
FreeListProxy(FreeListProxy&& other) = default;
FreeListProxy& operator=(FreeListProxy&& other) = default;
~FreeListProxy() {
auto free_list = proxy_.get();