mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 00:59:38 +08:00
Improving OS abstraction
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7bec5d5d3b
commit
0e9aa45e46
@@ -7,7 +7,8 @@
|
||||
|
||||
#include "shared/source/helpers/get_info.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/os_interface/windows/os_interface.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
#include "shared/source/utilities/api_intercept.h"
|
||||
|
||||
#include "opencl/source/api/api.h"
|
||||
@@ -27,7 +28,7 @@ ClDevice *pickDeviceWithAdapterLuid(Platform *platform, LUID adapterLuid) {
|
||||
ClDevice *deviceToReturn = nullptr;
|
||||
for (auto i = 0u; i < platform->getNumDevices(); i++) {
|
||||
auto device = platform->getClDevice(i);
|
||||
if (device->getRootDeviceEnvironment().osInterface->get()->getWddm()->verifyAdapterLuid(adapterLuid)) {
|
||||
if (device->getRootDeviceEnvironment().osInterface->getDriverModel()->as<Wddm>()->verifyAdapterLuid(adapterLuid)) {
|
||||
deviceToReturn = device;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/os_interface/windows/os_interface.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/windows/os_time_win.h"
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
|
||||
namespace NEO {
|
||||
/////////////////////////////////////////////////////
|
||||
@@ -18,14 +19,14 @@ namespace NEO {
|
||||
/////////////////////////////////////////////////////
|
||||
std::unique_ptr<PerformanceCounters> PerformanceCounters::create(Device *device) {
|
||||
auto counter = std::make_unique<PerformanceCountersWin>();
|
||||
auto osInterface = device->getOSTime()->getOSInterface()->get();
|
||||
auto wddm = device->getOSTime()->getOSInterface()->getDriverModel()->as<Wddm>();
|
||||
auto gen = device->getHardwareInfo().platform.eRenderCoreFamily;
|
||||
auto &hwHelper = HwHelper::get(gen);
|
||||
UNRECOVERABLE_IF(counter == nullptr);
|
||||
|
||||
counter->clientData.Windows.Adapter = reinterpret_cast<void *>(static_cast<UINT_PTR>(osInterface->getAdapterHandle()));
|
||||
counter->clientData.Windows.Device = reinterpret_cast<void *>(static_cast<UINT_PTR>(osInterface->getDeviceHandle()));
|
||||
counter->clientData.Windows.Escape = osInterface->getEscapeHandle();
|
||||
counter->clientData.Windows.Adapter = reinterpret_cast<void *>(static_cast<UINT_PTR>(wddm->getAdapter()));
|
||||
counter->clientData.Windows.Device = reinterpret_cast<void *>(static_cast<UINT_PTR>(wddm->getDeviceHandle()));
|
||||
counter->clientData.Windows.Escape = wddm->getEscapeHandle();
|
||||
counter->clientData.Windows.KmdInstrumentationEnabled = device->getHardwareInfo().capabilityTable.instrumentationEnabled;
|
||||
counter->contextData.ClientData = &counter->clientData;
|
||||
counter->clientType.Gen = static_cast<MetricsLibraryApi::ClientGen>(hwHelper.getMetricsLibraryGenId());
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
#include "shared/source/os_interface/windows/gdi_interface.h"
|
||||
#include "shared/source/os_interface/windows/os_context_win.h"
|
||||
#include "shared/source/os_interface/windows/os_interface.h"
|
||||
#include "shared/source/os_interface/windows/wddm_memory_manager.h"
|
||||
|
||||
namespace NEO {
|
||||
@@ -43,7 +42,7 @@ WddmCommandStreamReceiver<GfxFamily>::WddmCommandStreamReceiver(ExecutionEnviron
|
||||
: BaseClass(executionEnvironment, rootDeviceIndex, deviceBitfield) {
|
||||
|
||||
notifyAubCaptureImpl = DeviceCallbacks<GfxFamily>::notifyAubCapture;
|
||||
this->wddm = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->get()->getWddm();
|
||||
this->wddm = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->getDriverModel()->as<Wddm>();
|
||||
|
||||
PreemptionMode preemptionMode = PreemptionHelper::getDefaultPreemptionMode(this->peekHwInfo());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user