SWDEV-492563 - Fix Ocl issues

1. Fix LDSSize type to be uint32_t.
2. Prevent clWaitForEvents running on complete events whose
   HostQueue have been destructed.

Change-Id: I829e915f56b37db2ba76bb876c9656166534f154
This commit is contained in:
Tao Sang
2024-10-23 10:32:46 -04:00
committed by Tao Sang
orang tua e23ff0520b
melakukan 82dff9a67d
2 mengubah file dengan 7 tambahan dan 3 penghapusan
+5 -2
Melihat File
@@ -94,14 +94,17 @@ RUNTIME_ENTRY(cl_int, clWaitForEvents, (cl_uint num_events, const cl_event* even
}
// Make sure all the events are associated with the same context
const amd::Context* context = &as_amd(event)->context();
amd::Event* amdEvent = as_amd(event);
if (amdEvent->status() == CL_COMPLETE) continue;
const amd::Context* context = &amdEvent->context();
if (prevContext != NULL && prevContext != context) {
return CL_INVALID_CONTEXT;
}
prevContext = context;
// Flush the command queues associated with event1...eventN
amd::HostQueue* queue = as_amd(event)->command().queue();
amd::HostQueue* queue = amdEvent->command().queue();
if (queue != NULL && prevQueue != queue) {
queue->flush();
}
+2 -1
Melihat File
@@ -441,7 +441,8 @@ hsa_kernel_dispatch_packet_t* HSAILKernel::loadArguments(
WriteAqlArgAt(hidden_arguments, gpu.hsaQueueMem()->vmAddress(), it.size_, it.offset_);
break;
case amd::KernelParameterDescriptor::HiddenDynamicLdsSize:
WriteAqlArgAt(hidden_arguments, ldsAddress - ldsSize(), it.size_, it.offset_);
WriteAqlArgAt(hidden_arguments, static_cast<uint32_t>(ldsAddress - ldsSize()),
it.size_, it.offset_);
break;
}
}