mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 17:29:14 +08:00
Include files are now grouped and sorted in following order: 1. Header file of the class the current file implements 2. Project files 3. Third party files 4. Standard library Change-Id: If31af05652184169f7fee1d7ad08f1b2ed602cf0 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/command_stream/preemption.h"
|
|
#include "runtime/helpers/hw_helper.h"
|
|
#include "runtime/os_interface/linux/os_context_linux.h"
|
|
#include "runtime/os_interface/linux/os_interface.h"
|
|
#include "unit_tests/os_interface/linux/drm_mock.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
namespace OCLRT {
|
|
|
|
TEST(OsInterfaceTest, GivenLinuxWhenare64kbPagesEnabledThenFalse) {
|
|
EXPECT_FALSE(OSInterface::are64kbPagesEnabled());
|
|
}
|
|
|
|
TEST(OsInterfaceTest, GivenLinuxOsInterfaceWhenDeviceHandleQueriedthenZeroIsReturned) {
|
|
OSInterface osInterface;
|
|
EXPECT_EQ(0u, osInterface.getDeviceHandle());
|
|
}
|
|
|
|
TEST(OsContextTest, givenDrmWhenOsContextIsCreatedThenImplIsAvailable) {
|
|
DrmMock drmMock;
|
|
OSInterface osInterface;
|
|
osInterface.get()->setDrm(&drmMock);
|
|
|
|
auto osContext = std::make_unique<OsContext>(&osInterface, 0u, 1, HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances()[0], PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]));
|
|
EXPECT_NE(nullptr, osContext->get());
|
|
}
|
|
} // namespace OCLRT
|