Files
compute-runtime/unit_tests/linux/drm_wrap.h
Jablonski, Mateusz 624b418756 Return vector of HwDeviceIds from OSInterface::discoverDevices
Resolves: NEO-4310
Related-To: NEO-4208
Change-Id: Ib4ce27a18a860214b76505f6e122666c86207783
Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
2020-02-18 09:12:12 +01:00

25 lines
570 B
C++

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