2021-10-29 03:07:28 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-11-05 00:38:47 +08:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
|
|
|
#include "shared/test/common/helpers/variable_backup.h"
|
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
|
|
|
#include "shared/test/common/mocks/ult_device_factory.h"
|
2021-10-29 03:07:28 +08:00
|
|
|
|
|
|
|
#include "test.h"
|
|
|
|
|
|
|
|
using namespace NEO;
|
|
|
|
|
2021-11-05 00:38:47 +08:00
|
|
|
TEST(DeviceTest, whenBlitterOperationsSupportIsDisabledThenNoInternalCopyEngineIsReturned) {
|
|
|
|
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
|
|
|
|
defaultHwInfo->capabilityTable.blitterOperationsSupported = false;
|
2021-10-29 03:07:28 +08:00
|
|
|
|
2021-11-05 00:38:47 +08:00
|
|
|
UltDeviceFactory factory{1, 0};
|
|
|
|
EXPECT_EQ(nullptr, factory.rootDevices[0]->getInternalCopyEngine());
|
2021-10-29 03:07:28 +08:00
|
|
|
}
|
2021-11-09 01:03:15 +08:00
|
|
|
|
|
|
|
TEST(DeviceTest, givenBlitterOperationsDisabledWhenCreatingBlitterEngineThenAbort) {
|
|
|
|
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
|
|
|
|
defaultHwInfo->capabilityTable.blitterOperationsSupported = false;
|
|
|
|
|
|
|
|
UltDeviceFactory factory{1, 0};
|
|
|
|
EXPECT_THROW(factory.rootDevices[0]->createEngine(0, {aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular}), std::runtime_error);
|
|
|
|
EXPECT_THROW(factory.rootDevices[0]->createEngine(0, {aub_stream::EngineType::ENGINE_BCS, EngineUsage::Cooperative}), std::runtime_error);
|
|
|
|
EXPECT_THROW(factory.rootDevices[0]->createEngine(0, {aub_stream::EngineType::ENGINE_BCS, EngineUsage::Internal}), std::runtime_error);
|
|
|
|
EXPECT_THROW(factory.rootDevices[0]->createEngine(0, {aub_stream::EngineType::ENGINE_BCS, EngineUsage::LowPriority}), std::runtime_error);
|
|
|
|
}
|