Extend ExecutePM4() to accept completion signal and fences

ExecutePM4() function can optionally accept extra arguments for
acquire fence scope, release fence scope andcompletion signal. When
a completion signal is provided, ExecutePM4() does not wait for the
commands to complete.

Change-Id: Ib2a433b7bce1cb6260be8b76fe902335bd5dfada
This commit is contained in:
David Yat Sin
2023-08-30 17:31:13 +00:00
parent d7adc94e3f
commit 721e56ef5c
5 changed files with 59 additions and 22 deletions
+18 -2
View File
@@ -346,8 +346,24 @@ class Queue : public Checked<0xFA3906A679F9DB49>, private LocalQueue {
/// @return hsa_status_t
virtual hsa_status_t GetCUMasking(uint32_t num_cu_mask_count, uint32_t* cu_mask) = 0;
// @brief Submits a block of PM4 and waits until it has been executed.
virtual void ExecutePM4(uint32_t* cmd_data, size_t cmd_size_b) = 0;
/// @brief Submits a block of PM4.
///
/// @param cmd_data pointer to command buffer
///
/// @param cmd_size_b command buffer size in bytes
///
/// @param acquireFence acquire-fence type
///
/// @param releaseFence acquire-fence type
///
/// @param signal optional wait signal
///
/// if @p signal is provided, function will return without waiting for commands to be executed
/// if @p signal is NULL, waits until commands have been executed.
virtual void ExecutePM4(uint32_t* cmd_data, size_t cmd_size_b,
hsa_fence_scope_t acquireFence = HSA_FENCE_SCOPE_NONE,
hsa_fence_scope_t releaseFence = HSA_FENCE_SCOPE_NONE,
hsa_signal_t* signal = NULL) = 0;
virtual void SetProfiling(bool enabled) {
AMD_HSA_BITS_SET(amd_queue_.queue_properties, AMD_QUEUE_PROPERTIES_ENABLE_PROFILING,