Correct queue minimum size enforcement.

Minimum queue size was not enforced at the Agent level.  Minimum
size should be one page to give unifority across all asics.

Change-Id: I26394f79458d09fbceb79fc8aaf495e2c26a8ff3


[ROCm/ROCR-Runtime commit: a6742209f7]
Cette révision appartient à :
Sean Keely
2022-01-16 08:24:50 -06:00
Parent 92f675889c
révision 0e96cb895f
3 fichiers modifiés avec 10 ajouts et 4 suppressions
+3 -2
Voir le fichier
@@ -336,7 +336,8 @@ class GpuAgent : public GpuAgentInt {
const std::function<void(void*)>& system_deallocator() const { return system_deallocator_; }
protected:
static const uint32_t minAqlSize_ = 0x1000; // 4KB min
// Sizes are in packets.
static const uint32_t minAqlSize_ = 0x40; // 4KB min
static const uint32_t maxAqlSize_ = 0x20000; // 8MB max
// @brief Create an internal queue allowing tools to be notified.
@@ -344,7 +345,7 @@ class GpuAgent : public GpuAgentInt {
return CreateInterceptibleQueue(core::Queue::DefaultErrorHandler, nullptr);
}
// @brief // @brief Create an internal queue, with a custom error handler, allowing tools to be
// @brief Create an internal queue, with a custom error handler, allowing tools to be
// notified.
core::Queue* CreateInterceptibleQueue(void (*callback)(hsa_status_t status, hsa_queue_t* source,
void* data),
+2 -2
Voir le fichier
@@ -671,8 +671,8 @@ void AqlQueue::AllocRegisteredRingBuffer(uint32_t queue_size_pkts) {
#endif
} else {
// Allocate storage for the ring buffer.
ring_buf_alloc_bytes_ = AlignUp(
queue_size_pkts * sizeof(core::AqlPacket), 4096);
ring_buf_alloc_bytes_ = queue_size_pkts * sizeof(core::AqlPacket);
assert(IsMultipleOf(ring_buf_alloc_bytes_, 4096) && "Ring buffer sizes must be 4KiB aligned.");
ring_buf_ = agent_->system_allocator()(
ring_buf_alloc_bytes_, 0x1000,
+5
Voir le fichier
@@ -1055,6 +1055,11 @@ hsa_status_t GpuAgent::QueueCreate(size_t size, hsa_queue_type32_t queue_type,
return HSA_STATUS_ERROR_OUT_OF_RESOURCES;
}
// Enforce min size
if (size < minAqlSize_) {
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}
// Allocate scratch memory
ScratchInfo scratch = {0};
if (private_segment_size == UINT_MAX) {