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
このコミットが含まれているのは:
Sean Keely
2022-01-16 08:24:50 -06:00
コミット a6742209f7
3個のファイルの変更10行の追加4行の削除
+3 -2
ファイルの表示
@@ -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
ファイルの表示
@@ -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
ファイルの表示
@@ -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) {