SWDEV-545952 - API definitions for hipStreamSet/GetAttribute (#831)
Co-authored-by: Rahul Manocha <rmanocha@amd.com>
This commit is contained in:
@@ -41,7 +41,8 @@ HostQueue::HostQueue(Context& context, Device& device, cl_command_queue_properti
|
||||
lastEnqueueCommand_(nullptr),
|
||||
head_(nullptr),
|
||||
tail_(nullptr),
|
||||
isActive_(false) {
|
||||
isActive_(false),
|
||||
sync_policy_(amd::SyncPolicy::Auto) {
|
||||
if (GPU_FORCE_QUEUE_PROFILING) {
|
||||
properties().set(CL_QUEUE_PROFILING_ENABLE);
|
||||
}
|
||||
@@ -198,9 +199,10 @@ void HostQueue::finish(bool cpu_wait) {
|
||||
}
|
||||
command->enqueue();
|
||||
}
|
||||
|
||||
// Check HW status of the ROCcrl event. Note: not all ROCclr modes support HW status
|
||||
static constexpr bool kWaitCompletion = true;
|
||||
if (cpu_wait || !device().IsHwEventReady(command->event(), kWaitCompletion)) {
|
||||
if (cpu_wait || !device().IsHwEventReady(command->event(), kWaitCompletion, GetSyncPolicy())) {
|
||||
ClPrint(LOG_DEBUG, LOG_CMD,
|
||||
"No HW event or batch size is less than %zu, "
|
||||
"await command completion",
|
||||
|
||||
@@ -307,6 +307,13 @@ class HostQueue : public CommandQueue {
|
||||
return thread_.vdev()->getQueueID();
|
||||
}
|
||||
|
||||
//! Returns Synchronization Policy for the current stream
|
||||
amd::SyncPolicy GetSyncPolicy() const { return sync_policy_; }
|
||||
//! Set Synchronization Policy used by Queue
|
||||
void SetSyncPolicy(amd::SyncPolicy value) {
|
||||
sync_policy_ = value;
|
||||
}
|
||||
|
||||
private:
|
||||
Command* head_; //!< Head of the batch list
|
||||
Command* tail_; //!< Tail of the batch list
|
||||
@@ -315,6 +322,8 @@ private:
|
||||
//! True if this command queue is active
|
||||
bool isActive_;
|
||||
bool forceDestroy_ = false; //!< Destroy the queue in the current state
|
||||
|
||||
amd::SyncPolicy sync_policy_; //!< Used for controlling stream synchronization
|
||||
};
|
||||
|
||||
class DeviceQueue : public CommandQueue {
|
||||
|
||||
Reference in New Issue
Block a user