mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
Compute-Runtime-Automation

parent
c612480f16
commit
80b520bc9b
@ -604,7 +604,7 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenClSetKernelExecInfoAlreadySe
|
||||
nullptr,
|
||||
nullptr);
|
||||
EXPECT_EQ(getNewKernelArbitrationPolicy(euThreadSetting),
|
||||
static_cast<uint32_t>(pDevice->getUltCommandStreamReceiver<FamilyType>().streamProperties.stateComputeMode.threadArbitrationPolicy.value));
|
||||
pDevice->getUltCommandStreamReceiver<FamilyType>().streamProperties.stateComputeMode.threadArbitrationPolicy.value);
|
||||
|
||||
mockCmdQ->release();
|
||||
}
|
||||
@ -640,7 +640,7 @@ HWTEST_F(EnqueueHandlerTest, givenEnqueueHandlerWhenNotSupportedPolicyChangeThen
|
||||
nullptr,
|
||||
nullptr);
|
||||
EXPECT_NE(getNewKernelArbitrationPolicy(euThreadSetting),
|
||||
static_cast<uint32_t>(pDevice->getUltCommandStreamReceiver<FamilyType>().streamProperties.stateComputeMode.threadArbitrationPolicy.value));
|
||||
pDevice->getUltCommandStreamReceiver<FamilyType>().streamProperties.stateComputeMode.threadArbitrationPolicy.value);
|
||||
EXPECT_EQ(0, pDevice->getUltCommandStreamReceiver<FamilyType>().streamProperties.stateComputeMode.threadArbitrationPolicy.value);
|
||||
|
||||
mockCmdQ->release();
|
||||
|
@ -760,7 +760,7 @@ HWTEST_F(EnqueueKernelTests, whenEnqueueingKernelThenCsrCorrectlySetsRequiredThr
|
||||
nullptr);
|
||||
pCommandQueue->flush();
|
||||
EXPECT_EQ(HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy(),
|
||||
static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
|
||||
csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value);
|
||||
|
||||
pCommandQueue->enqueueKernel(
|
||||
mockKernelWithInternalsWithIfpNotRequired.mockKernel,
|
||||
@ -773,7 +773,7 @@ HWTEST_F(EnqueueKernelTests, whenEnqueueingKernelThenCsrCorrectlySetsRequiredThr
|
||||
nullptr);
|
||||
pCommandQueue->flush();
|
||||
EXPECT_EQ(ThreadArbitrationPolicy::AgeBased,
|
||||
static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
|
||||
csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value);
|
||||
|
||||
pCommandQueue->enqueueKernel(
|
||||
mockKernelWithInternalsWithIfpRequired.mockKernel,
|
||||
@ -786,7 +786,7 @@ HWTEST_F(EnqueueKernelTests, whenEnqueueingKernelThenCsrCorrectlySetsRequiredThr
|
||||
nullptr);
|
||||
pCommandQueue->flush();
|
||||
EXPECT_EQ(HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy(),
|
||||
static_cast<uint32_t>(csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
|
||||
csr.streamProperties.stateComputeMode.threadArbitrationPolicy.value);
|
||||
}
|
||||
|
||||
typedef HelloWorldFixture<HelloWorldFixtureFactory> EnqueueKernelFixture;
|
||||
|
@ -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,
|
||||
|
@ -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());
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -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
|
@ -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
|
@ -29,7 +29,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ThreadArbitrationXeHPAndLater, givenPolicyWhenThrea
|
||||
PreambleHelper<FamilyType>::programThreadArbitration(&cs, ThreadArbitrationPolicy::RoundRobin);
|
||||
|
||||
EXPECT_EQ(0u, cs.getUsed());
|
||||
EXPECT_EQ(0u, HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy());
|
||||
EXPECT_EQ(ThreadArbitrationPolicy::AgeBased, HwHelperHw<FamilyType>::get().getDefaultThreadArbitrationPolicy());
|
||||
}
|
||||
|
||||
using ProgramPipelineXeHPAndLater = PreambleFixture;
|
||||
|
@ -223,8 +223,8 @@ HWTEST_F(HwInfoConfigTest, givenVariousValuesWhenGettingAubStreamSteppingFromHwR
|
||||
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override {
|
||||
return returnedStepping;
|
||||
}
|
||||
std::vector<uint32_t> getKernelSupportedThreadArbitrationPolicies() override {
|
||||
return std::vector<uint32_t>();
|
||||
std::vector<int32_t> getKernelSupportedThreadArbitrationPolicies() override {
|
||||
return {};
|
||||
}
|
||||
uint32_t returnedStepping = 0;
|
||||
};
|
||||
|
@ -48,7 +48,7 @@ PVCTEST_F(PvcCommandStreamReceiverFlushTaskTests, givenOverrideThreadArbitration
|
||||
|
||||
flushTask(commandStreamReceiver);
|
||||
EXPECT_EQ(ThreadArbitrationPolicy::RoundRobin,
|
||||
static_cast<uint32_t>(commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
|
||||
commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value);
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcCommandStreamReceiverFlushTaskTests, givenNotExistPolicyWhenFlushingThenDefaultPolicyIsProgrammed) {
|
||||
@ -58,12 +58,12 @@ PVCTEST_F(PvcCommandStreamReceiverFlushTaskTests, givenNotExistPolicyWhenFlushin
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
|
||||
uint32_t notExistPolicy = -2;
|
||||
int32_t notExistPolicy = -2;
|
||||
flushTaskFlags.threadArbitrationPolicy = notExistPolicy;
|
||||
|
||||
flushTask(commandStreamReceiver);
|
||||
|
||||
EXPECT_EQ(notExistPolicy, static_cast<uint32_t>(commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value));
|
||||
EXPECT_EQ(notExistPolicy, commandStreamReceiver.streamProperties.stateComputeMode.threadArbitrationPolicy.value);
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcCommandStreamReceiverFlushTaskTests, givenRevisionBAndAboveWhenLastSpecialPipelineSelectModeIsTrueAndFlushTaskIsCalledThenDontReprogramPipelineSelect) {
|
||||
|
Reference in New Issue
Block a user