Change ThreadArbitrationPolicy enum type to int32_t

Change ThreadArbitrationPolicy::NotPresent value to -1
Update initial values to ThreadArbitrationPolicy::NotPresent

Related-To: NEO-6728

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2022-03-07 17:00:26 +00:00
committed by Compute-Runtime-Automation
parent c612480f16
commit 80b520bc9b
46 changed files with 109 additions and 108 deletions

View File

@@ -77,7 +77,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenOverrideThreadArbitrationPoli
flushTask(commandStreamReceiver);
EXPECT_EQ(ThreadArbitrationPolicy::RoundRobin,
static_cast<uint32_t>(commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value);
}
HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingTaskThenTaskCountIsIncremented) {
@@ -1315,7 +1315,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDispatchFlagsWhenCallFlushTas
dispatchFlags,
*pDevice);
EXPECT_EQ(dispatchFlags.threadArbitrationPolicy, static_cast<uint32_t>(mockCsr->streamProperties.stateComputeMode.threadArbitrationPolicy.value));
EXPECT_EQ(dispatchFlags.threadArbitrationPolicy, mockCsr->streamProperties.stateComputeMode.threadArbitrationPolicy.value);
}
class CommandStreamReceiverFlushTaskMemoryCompressionTests : public UltCommandStreamReceiverTest,

View File

@@ -423,7 +423,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests,
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenDefaultCommandStreamReceiverThenRoundRobinPolicyIsSelected) {
auto pCommandStreamReceiver = new MockCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
pDevice->resetCommandStreamReceiver(pCommandStreamReceiver);
EXPECT_EQ(static_cast<uint32_t>(-1), pCommandStreamReceiver->peekThreadArbitrationPolicy());
EXPECT_EQ(ThreadArbitrationPolicy::NotPresent, pCommandStreamReceiver->peekThreadArbitrationPolicy());
flushTask(*pCommandStreamReceiver);
EXPECT_EQ(HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy(), pCommandStreamReceiver->peekThreadArbitrationPolicy());

View File

@@ -670,19 +670,19 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenEnqueueWithoutArbitrationPoli
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
auto &csrThreadArbitrationPolicy = commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value;
uint32_t sentThreadArbitrationPolicy = ThreadArbitrationPolicy::RoundRobinAfterDependency;
int32_t sentThreadArbitrationPolicy = ThreadArbitrationPolicy::RoundRobinAfterDependency;
flushTaskFlags.threadArbitrationPolicy = sentThreadArbitrationPolicy;
flushTask(commandStreamReceiver);
EXPECT_EQ(static_cast<uint32_t>(csrThreadArbitrationPolicy), sentThreadArbitrationPolicy);
EXPECT_EQ(csrThreadArbitrationPolicy, sentThreadArbitrationPolicy);
flushTaskFlags.threadArbitrationPolicy = ThreadArbitrationPolicy::NotPresent;
flushTask(commandStreamReceiver);
EXPECT_EQ(static_cast<uint32_t>(csrThreadArbitrationPolicy), sentThreadArbitrationPolicy);
EXPECT_EQ(csrThreadArbitrationPolicy, sentThreadArbitrationPolicy);
}
struct PreambleThreadArbitrationMatcher {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -11,7 +11,7 @@
#include <stdint.h>
namespace NEO {
uint32_t getNewKernelArbitrationPolicy(uint32_t policy) {
int32_t getNewKernelArbitrationPolicy(uint32_t policy) {
if (policy == CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL) {
return ThreadArbitrationPolicy::RoundRobin;
} else if (policy == CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_OLDEST_FIRST_INTEL) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -7,5 +7,5 @@
#include <stdint.h>
namespace NEO {
uint32_t getNewKernelArbitrationPolicy(uint32_t policy);
int32_t getNewKernelArbitrationPolicy(uint32_t policy);
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2020 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -12,14 +12,14 @@
namespace NEO {
TEST(ThreadArbitrationPolicy, givenClKrenelExecThreadArbitrationPolicyWhenGetNewKernelArbitrationPolicyIsCalledThenExpectedThreadArbitrationPolicyIsReturned) {
uint32_t retVal = ThreadArbitrationPolicy::getNewKernelArbitrationPolicy(CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL);
EXPECT_EQ(retVal, static_cast<uint32_t>(ThreadArbitrationPolicy::RoundRobin));
int32_t retVal = ThreadArbitrationPolicy::getNewKernelArbitrationPolicy(CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL);
EXPECT_EQ(retVal, ThreadArbitrationPolicy::RoundRobin);
retVal = ThreadArbitrationPolicy::getNewKernelArbitrationPolicy(CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_OLDEST_FIRST_INTEL);
EXPECT_EQ(retVal, static_cast<uint32_t>(ThreadArbitrationPolicy::AgeBased));
EXPECT_EQ(retVal, ThreadArbitrationPolicy::AgeBased);
retVal = ThreadArbitrationPolicy::getNewKernelArbitrationPolicy(CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_AFTER_DEPENDENCY_ROUND_ROBIN_INTEL);
EXPECT_EQ(retVal, static_cast<uint32_t>(ThreadArbitrationPolicy::RoundRobinAfterDependency));
uint32_t randomValue = -1;
EXPECT_EQ(retVal, ThreadArbitrationPolicy::RoundRobinAfterDependency);
uint32_t randomValue = 0xFFFFu;
retVal = ThreadArbitrationPolicy::getNewKernelArbitrationPolicy(randomValue);
EXPECT_EQ(retVal, static_cast<uint32_t>(ThreadArbitrationPolicy::NotPresent));
EXPECT_EQ(retVal, ThreadArbitrationPolicy::NotPresent);
}
} // namespace NEO