mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
Add implicit scaling tests
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4a7f4ec944
commit
6b862b60ca
47
shared/test/unit_test/encoders/test_implicit_scaling.cpp
Normal file
47
shared/test/unit_test/encoders/test_implicit_scaling.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/fixtures/implicit_scaling_fixture.h"
|
||||
|
||||
TEST_F(ImplicitScalingTests, givenMultiTileDeviceWhenApiAndOsSupportThenFeatureEnabled) {
|
||||
EXPECT_TRUE(ImplicitScalingHelper::isImplicitScalingEnabled(twoTile, true));
|
||||
}
|
||||
|
||||
TEST_F(ImplicitScalingTests, givenSingleTileDeviceWhenApiAndOsSupportThenFeatureDisabled) {
|
||||
EXPECT_FALSE(ImplicitScalingHelper::isImplicitScalingEnabled(singleTile, true));
|
||||
}
|
||||
|
||||
TEST_F(ImplicitScalingTests, givenMultiTileAndPreconditionFalseWhenApiAndOsSupportThenFeatureDisabled) {
|
||||
EXPECT_FALSE(ImplicitScalingHelper::isImplicitScalingEnabled(twoTile, false));
|
||||
}
|
||||
|
||||
TEST_F(ImplicitScalingTests, givenMultiTileAndOsSupportWhenApiDisabledThenFeatureDisabled) {
|
||||
ImplicitScaling::apiSupport = false;
|
||||
EXPECT_FALSE(ImplicitScalingHelper::isImplicitScalingEnabled(twoTile, true));
|
||||
}
|
||||
|
||||
TEST_F(ImplicitScalingTests, givenMultiTileAndApiSupportWhenOsDisabledThenFeatureDisabled) {
|
||||
OSInterface::osEnableLocalMemory = false;
|
||||
EXPECT_FALSE(ImplicitScalingHelper::isImplicitScalingEnabled(twoTile, true));
|
||||
}
|
||||
|
||||
TEST_F(ImplicitScalingTests, givenSingleTileApiDisabledWhenOsSupportAndForcedOnThenFeatureEnabled) {
|
||||
DebugManager.flags.EnableWalkerPartition.set(1);
|
||||
ImplicitScaling::apiSupport = false;
|
||||
EXPECT_TRUE(ImplicitScalingHelper::isImplicitScalingEnabled(singleTile, false));
|
||||
}
|
||||
|
||||
TEST_F(ImplicitScalingTests, givenMultiTileApiAndOsSupportEnabledWhenForcedOffThenFeatureDisabled) {
|
||||
DebugManager.flags.EnableWalkerPartition.set(0);
|
||||
EXPECT_FALSE(ImplicitScalingHelper::isImplicitScalingEnabled(twoTile, true));
|
||||
}
|
||||
|
||||
TEST_F(ImplicitScalingTests, givenMultiTileApiEnabledWhenOsSupportOffAndForcedOnThenFeatureDisabled) {
|
||||
DebugManager.flags.EnableWalkerPartition.set(1);
|
||||
OSInterface::osEnableLocalMemory = false;
|
||||
EXPECT_FALSE(ImplicitScalingHelper::isImplicitScalingEnabled(twoTile, true));
|
||||
}
|
||||
Reference in New Issue
Block a user