Add hsa_amd_queue_set_priority extension function

Controls dispatch and wavefront scheduling arbitration across quees.

Change-Id: I498f4898b544f79b8fb8514bf7e789ca9da29462
This commit is contained in:
Jay Cornwall
2018-06-19 14:00:46 -05:00
parent 6df6ef778d
commit e388a23344
12 changed files with 111 additions and 4 deletions
+1
View File
@@ -171,6 +171,7 @@ struct AmdExtTable {
decltype(hsa_amd_register_system_event_handler)* hsa_amd_register_system_event_handler_fn;
decltype(hsa_amd_queue_intercept_create)* hsa_amd_queue_intercept_create_fn;
decltype(hsa_amd_queue_intercept_register)* hsa_amd_queue_intercept_register_fn;
decltype(hsa_amd_queue_set_priority)* hsa_amd_queue_set_priority_fn;
};
// Table to export HSA Core Runtime Apis
+37
View File
@@ -1697,6 +1697,43 @@ typedef hsa_status_t (*hsa_amd_system_event_callback_t)(const hsa_amd_event_t* e
hsa_status_t hsa_amd_register_system_event_handler(hsa_amd_system_event_callback_t callback,
void* data);
/**
* @brief Per-queue dispatch and wavefront scheduling priority.
*/
typedef enum hsa_amd_queue_priority_s {
/*
Below normal/high priority compute and all graphics
*/
HSA_AMD_QUEUE_PRIORITY_LOW = 0,
/*
Above low priority compute, below high priority compute and all graphics
*/
HSA_AMD_QUEUE_PRIORITY_NORMAL = 1,
/*
Above low/normal priority compute and all graphics
*/
HSA_AMD_QUEUE_PRIORITY_HIGH = 2,
} hsa_amd_queue_priority_t;
/**
* @brief Modifies the dispatch and wavefront scheduling prioirty for a
* given compute queue. The default is HSA_AMD_QUEUE_PRIORITY_NORMAL.
*
* @param[in] queue Compute queue to apply new priority to.
*
* @param[in] priority Priority to associate with queue.
*
* @retval HSA_STATUS_SUCCESS if priority was changed successfully.
*
* @retval HSA_STATUS_ERROR_INVALID_QUEUE if queue is not a valid
* compute queue handle.
*
* @retval HSA_STATUS_ERROR_INVALID_ARGUMENT if priority is not a valid
* value from hsa_amd_queue_priority_t.
*/
hsa_status_t HSA_API hsa_amd_queue_set_priority(hsa_queue_t* queue,
hsa_amd_queue_priority_t priority);
#ifdef __cplusplus
} // end extern "C" block
#endif