SWDEV-232428 - Push hostcall implementation to the device layer

This change unifies the hostcall implementation for all the backends,
by pushing the common logic to the device layer. This is done by
replacing the use of hsa_signal_t with device::Signal (a light wrapper
around it).

Change-Id: I7b6fca7930b5a0b199da5d85e2e048354cc04e7b
Tá an tiomantas seo le fáil i:
Vladislav Sytchenko tiomanta 2021-02-16 17:19:57 -05:00
1 tuismitheoir c65be06c4c
tiomantas 671778bdd3
13 comhad athraithe
+234 -31

Níor tháinig aon chomhaid le do chuardach

+7 -2
Féach ar an gComhad
@@ -32,17 +32,18 @@
#include "vdi_common.hpp"
#include "device/comgrctx.hpp"
#include "device/devhostcall.hpp"
#include "device/rocm/rocdevice.hpp"
#include "device/rocm/rocblit.hpp"
#include "device/rocm/rocvirtual.hpp"
#include "device/rocm/rocprogram.hpp"
#include "device/rocm/rocmemory.hpp"
#include "device/rocm/rocglinterop.hpp"
#include "device/rocm/rocsignal.hpp"
#ifdef WITH_AMDGPU_PRO
#include "pro/prodriver.hpp"
#endif
#include "platform/sampler.hpp"
#include "rochostcall.hpp"
#include <algorithm>
#include <cstring>
@@ -2677,7 +2678,7 @@ void* Device::getOrCreateHostcallBuffer(hsa_queue_t* queue, bool coop_queue,
} else {
coopHostcallBuffer_ = buffer;
}
if (!enableHostcalls(buffer, numPackets)) {
if (!enableHostcalls(*this, buffer, numPackets)) {
ClPrint(amd::LOG_ERROR, amd::LOG_QUEUE, "Failed to register hostcall buffer %p with listener",
buffer);
return nullptr;
@@ -2855,5 +2856,9 @@ void Device::getGlobalCUMask(std::string cuMaskStr) {
}
}
device::Signal* Device::createSignal() const {
return new roc::Signal();
}
} // namespace roc
#endif // WITHOUT_HSA_BACKEND