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:
committed by
GitHub
parent
487e5b7d0f
commit
eb5a38e806
@@ -33,8 +33,22 @@ Queue::Queue() {
|
||||
}
|
||||
}
|
||||
|
||||
Queue::Queue(size_t max_queues, size_t max_wg_size, size_t queue_size)
|
||||
: max_queues_{max_queues},
|
||||
max_wg_size_{max_wg_size},
|
||||
queue_size_{queue_size},
|
||||
queue_proxy_{max_queues, queue_size},
|
||||
queue_desc_proxy_{max_queues, max_wg_size} {
|
||||
|
||||
gpu_queue = true;
|
||||
char *value{nullptr};
|
||||
if ((value = getenv("RO_NET_CPU_QUEUE")) != nullptr) {
|
||||
gpu_queue = false;
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t Queue::get_read_index(uint64_t queue_index) {
|
||||
return descriptor(queue_index)->read_index % QUEUE_SIZE;
|
||||
return descriptor(queue_index)->read_index % queue_size_;
|
||||
}
|
||||
|
||||
void Queue::increment_read_index(uint64_t queue_index) {
|
||||
@@ -92,7 +106,7 @@ void Queue::notify(int blockId, int threadId) {
|
||||
}
|
||||
|
||||
uint64_t Queue::size() {
|
||||
return QUEUE_SIZE;
|
||||
return queue_size_;
|
||||
}
|
||||
|
||||
__host__ __device__ queue_desc_t* Queue::descriptor(uint64_t index) {
|
||||
|
||||
Reference in New Issue
Block a user