rocr: Update Driver queue-related APIs
Update the user-mode driver queue APIs to leverage KMT types. Move queue-related calls to the core::Driver API.
This commit is contained in:
committed by
Gutierrez, Tony
parent
b3c48cc68c
commit
e03d44d742
@@ -353,11 +353,49 @@ hsa_status_t KfdDriver::FreeMemory(void *mem, size_t size) {
|
||||
return FreeKfdMemory(mem, size) ? HSA_STATUS_SUCCESS : HSA_STATUS_ERROR;
|
||||
}
|
||||
|
||||
hsa_status_t KfdDriver::CreateQueue(core::Queue &queue) const {
|
||||
hsa_status_t KfdDriver::CreateQueue(uint32_t node_id, HSA_QUEUE_TYPE type, uint32_t queue_pct,
|
||||
HSA_QUEUE_PRIORITY priority, uint32_t sdma_engine_id,
|
||||
void* queue_addr, uint64_t queue_size_bytes, HsaEvent* event,
|
||||
HsaQueueResource& queue_resource) const {
|
||||
if (HSAKMT_CALL(hsaKmtCreateQueueExt(node_id, type, queue_pct, priority, sdma_engine_id,
|
||||
queue_addr, queue_size_bytes, event, &queue_resource)) !=
|
||||
HSAKMT_STATUS_SUCCESS) {
|
||||
return HSA_STATUS_ERROR_OUT_OF_RESOURCES;
|
||||
}
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
hsa_status_t KfdDriver::DestroyQueue(core::Queue &queue) const {
|
||||
hsa_status_t KfdDriver::DestroyQueue(HSA_QUEUEID queue_id) const {
|
||||
if (HSAKMT_CALL(hsaKmtDestroyQueue(queue_id)) != HSAKMT_STATUS_SUCCESS) {
|
||||
return HSA_STATUS_ERROR;
|
||||
}
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
hsa_status_t KfdDriver::UpdateQueue(HSA_QUEUEID queue_id, uint32_t queue_pct,
|
||||
HSA_QUEUE_PRIORITY priority, void* queue_addr,
|
||||
uint64_t queue_size, HsaEvent* event) const {
|
||||
if (HSAKMT_CALL(hsaKmtUpdateQueue(queue_id, queue_pct, priority, queue_addr, queue_size,
|
||||
event)) != HSAKMT_STATUS_SUCCESS) {
|
||||
return HSA_STATUS_ERROR;
|
||||
}
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
hsa_status_t KfdDriver::SetQueueCUMask(HSA_QUEUEID queue_id, uint32_t cu_mask_count,
|
||||
uint32_t* queue_cu_mask) const {
|
||||
if (HSAKMT_CALL(hsaKmtSetQueueCUMask(queue_id, cu_mask_count, queue_cu_mask)) !=
|
||||
HSAKMT_STATUS_SUCCESS) {
|
||||
return HSA_STATUS_ERROR;
|
||||
}
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
hsa_status_t KfdDriver::AllocQueueGWS(HSA_QUEUEID queue_id, uint32_t num_gws,
|
||||
uint32_t* first_gws) const {
|
||||
if (HSAKMT_CALL(hsaKmtAllocQueueGWS(queue_id, num_gws, first_gws)) != HSAKMT_STATUS_SUCCESS) {
|
||||
return HSA_STATUS_ERROR;
|
||||
}
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user