Files
compute-runtime/unit_tests/linux/drm_wrap.h
Jablonski, Mateusz 807586aafd Linux: discover devices in DeviceFactory::getDevices
Related-To: NEO-4208
Change-Id: Ia4405745d1ae22f03ce344a92f2b664ef6e1b957
Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
2020-02-10 15:53:37 +01:00

27 lines
620 B
C++

/*
* Copyright (C) 2019-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "core/os_interface/linux/drm_neo.h"
#include "drm/i915_drm.h"
class DrmWrap : public NEO::Drm {
public:
static NEO::Drm *createDrm(RootDeviceEnvironment &rootDeviceEnvironment) {
auto hwDeviceId = Drm::discoverDevices();
if (hwDeviceId != nullptr) {
return NEO::Drm::create(std::move(hwDeviceId), rootDeviceEnvironment);
}
return nullptr;
}
static void closeDevice(int32_t deviceOrdinal) {
NEO::Drm::closeDevice(deviceOrdinal);
};
};