Enable Mid-Thread preemption for Gen9

Change-Id: Iacec1c8fa899d4fbf0cbb9cc292990546871ca6a
This commit is contained in:
Zdanowicz, Zbigniew
2018-01-12 14:18:53 +01:00
committed by sys_ocldev
parent 8ee2c54a50
commit 474b6a2a23
29 changed files with 243 additions and 61 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -27,6 +27,7 @@
#include "runtime/helpers/get_info.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "unit_tests/mocks/mock_device.h"
#include "unit_tests/mocks/mock_context.h"
#include "unit_tests/mocks/mock_command_queue.h"
@@ -109,14 +110,10 @@ TEST(ApiOsTest, notSupportedApiList) {
}
TEST(DeviceOsTest, DeviceCreationFailMidThreadPreemption) {
HardwareInfo *hwInfo = const_cast<HardwareInfo *>(*platformDevices);
auto defaultPreemption = hwInfo->capabilityTable.defaultPreemptionMode;
hwInfo->capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread;
auto pDevice = Device::create<OCLRT::FailDeviceAfterOne>(hwInfo);
DebugManagerStateRestore dbgRestore;
DebugManager.flags.ForcePreemptionMode.set(static_cast<int32_t>(PreemptionMode::MidThread));
auto pDevice = Device::create<OCLRT::FailDeviceAfterOne>(nullptr);
EXPECT_THAT(pDevice, nullptr);
hwInfo->capabilityTable.defaultPreemptionMode = defaultPreemption;
}
} // namespace OCLRT