SWDEV-465041 - Add support for user events with DD (#321)
* SWDEV-465041 - Add support for user events with DD User events can be replaced with HSA signals. Add the interface to allocate HSA signal for user events and update the status on CL_COMPLETE. Force pinned path with DD to avoid blocking calls. Pinned memory can be released only when the command is complete. Simplify device enqueue path to use generic kernel arg buffer and signals * Fix notifyCmdQueue() logic for OCL * Avoid blocking calls in OCL with DD * Add event destruciton in a case of the failure.
This commit is contained in:
committed by
GitHub
parent
dc34af61d7
commit
2305f8ae56
@@ -3464,6 +3464,25 @@ void Device::ReleaseGlobalSignal(void* signal) const {
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Device::CreateUserEvent(amd::UserEvent* event) const {
|
||||
std::unique_ptr<ProfilingSignal> signal(new ProfilingSignal());
|
||||
if ((signal == nullptr) ||
|
||||
(HSA_STATUS_SUCCESS != hsa_signal_create(0, 0, nullptr, &signal->signal_))) {
|
||||
return false;
|
||||
}
|
||||
hsa_signal_silent_store_relaxed(signal->signal_, kInitSignalValueOne);
|
||||
event->SetHwEvent(signal.release());
|
||||
return true;
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
void Device::SetUserEvent(amd::UserEvent* event) const {
|
||||
auto signal = reinterpret_cast<ProfilingSignal*>(event->HwEvent());
|
||||
assert(signal != nullptr && "Can't have user event without hw event!");
|
||||
hsa_signal_silent_store_relaxed(signal->signal_, 0);
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
bool Device::IsValidAllocation(const void* dev_ptr, size_t size, hsa_amd_pointer_info_t* ptr_info) {
|
||||
// Query ptr type to see if it's a HMM allocation
|
||||
|
||||
Reference in New Issue
Block a user