Merge commit '0ac913e64c988e6b9ea8e86d74292cdf44c5d255' into develop

This commit is contained in:
systems-assistant[bot]
2025-08-18 18:08:03 +00:00
64 ha cambiato i file con 2064 aggiunte e 458 eliminazioni
@@ -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);
}
@@ -72,20 +73,21 @@ bool HostQueue::terminate() {
if (lastCommand != nullptr) {
// Check if CPU batch wasn't flushed for completion with the last command
if (GetSubmissionBatch() != nullptr) {
auto command = new Marker(*this, false);
if (command != nullptr) {
ClPrint(LOG_DEBUG, LOG_CMD, "Marker queued to ensure finish");
command->enqueue();
lastCommand = command;
}
auto command = new Marker(*this, false);
if (command != nullptr) {
ClPrint(LOG_DEBUG, LOG_CMD, "Marker queued to ensure finish");
command->enqueue();
lastCommand->release();
lastCommand = command;
}
}
if (device_.gpu_error_ == CL_SUCCESS) {
lastCommand->awaitCompletion();
lastCommand->awaitCompletion();
}
// Note that if lastCommand isn't a marker, it may not be lastEnqueueCommand_ now
// after lastCommand->awaitCompletion() is called.
if (lastEnqueueCommand_ != nullptr) {
lastEnqueueCommand_ ->release(); // lastEnqueueCommand_ should be a marker
lastEnqueueCommand_->release(); // lastEnqueueCommand_ should be a marker
lastEnqueueCommand_ = nullptr;
}
lastCommand->release();
@@ -197,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",