rocr: Increase queue size for co-op queues

Increase queue-size for co-op queues to 16K to improve performance on
some workloads

Change-Id: I4d3bf0ecbd30ebb648b68d9c5fdabadc670a386c
Этот коммит содержится в:
David Yat Sin
2024-09-05 17:50:49 +00:00
родитель 3cb25e5236
Коммит 924e11ba7f
2 изменённых файлов: 11 добавлений и 8 удалений
+4 -5
Просмотреть файл
@@ -464,15 +464,14 @@ class GpuAgent : public GpuAgentInt {
static const uint32_t maxAqlSize_ = 0x20000; // 8MB max
// @brief Create an internal queue allowing tools to be notified.
core::Queue* CreateInterceptibleQueue() {
return CreateInterceptibleQueue(core::Queue::DefaultErrorHandler, nullptr);
core::Queue* CreateInterceptibleQueue(const uint32_t size = 0) {
return CreateInterceptibleQueue(core::Queue::DefaultErrorHandler, nullptr, size);
}
// @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),
void* data);
core::Queue* CreateInterceptibleQueue(void (*callback)(hsa_status_t status, hsa_queue_t* source, void* data),
void* data, const uint32_t size);
// @brief Create SDMA blit object.
//
+7 -3
Просмотреть файл
@@ -716,10 +716,13 @@ hsa_status_t GpuAgent::VisitRegion(
core::Queue* GpuAgent::CreateInterceptibleQueue(void (*callback)(hsa_status_t status,
hsa_queue_t* source, void* data),
void* data) {
void* data, const uint32_t in_size) {
// Disabled intercept of internal queues pending tools updates.
core::Queue* queue = nullptr;
QueueCreate(minAqlSize_, HSA_QUEUE_TYPE_MULTI, callback, data, 0, 0, &queue);
uint32_t size = std::max(in_size, minAqlSize_);
size = std::min(size, maxAqlSize_);
QueueCreate(size, HSA_QUEUE_TYPE_MULTI, callback, data, 0, 0, &queue);
if (queue != nullptr)
core::Runtime::runtime_singleton_->InternalQueueCreateNotify(core::Queue::Convert(queue),
this->public_handle());
@@ -894,7 +897,8 @@ void GpuAgent::InitDma() {
void GpuAgent::InitGWS() {
gws_queue_.queue_.reset([this]() {
if (properties_.NumGws == 0) return (core::Queue*)nullptr;
std::unique_ptr<core::Queue> queue(CreateInterceptibleQueue());
const uint32_t defaultGWSQueueSize = 0x4000; // 16KB
std::unique_ptr<core::Queue> queue(CreateInterceptibleQueue(defaultGWSQueueSize));
if (queue == nullptr)
throw AMD::hsa_exception(HSA_STATUS_ERROR_OUT_OF_RESOURCES,
"Internal queue creation failed.");