Use dedicated using type for TaskCount

Related-To: NEO-7155

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2022-11-22 13:53:59 +00:00
committed by Compute-Runtime-Automation
parent 3f962bf3e8
commit 4b42b066f8
146 changed files with 568 additions and 529 deletions

View File

@@ -983,7 +983,7 @@ void CommandQueueHw<gfxCoreFamily>::dispatchTaskCountPostSyncByMiFlushDw(
}
uint64_t postSyncAddress = this->csr->getTagAllocation()->getGpuAddress();
uint32_t postSyncData = this->csr->peekTaskCount() + 1;
TaskCountType postSyncData = this->csr->peekTaskCount() + 1;
const auto &hwInfo = this->device->getHwInfo();
NEO::MiFlushArgs args;
@@ -1003,7 +1003,7 @@ void CommandQueueHw<gfxCoreFamily>::dispatchTaskCountPostSyncRegular(
}
uint64_t postSyncAddress = this->csr->getTagAllocation()->getGpuAddress();
uint32_t postSyncData = this->csr->peekTaskCount() + 1;
TaskCountType postSyncData = this->csr->peekTaskCount() + 1;
const auto &hwInfo = this->device->getHwInfo();
NEO::PipeControlArgs args;

View File

@@ -10,6 +10,7 @@
#include "shared/source/command_container/cmdcontainer.h"
#include "shared/source/command_stream/linear_stream.h"
#include "shared/source/command_stream/submission_status.h"
#include "shared/source/command_stream/task_count_helper.h"
#include "shared/source/command_stream/wait_status.h"
#include "shared/source/helpers/completion_stamp.h"
@@ -46,16 +47,16 @@ struct CommandQueueImp : public CommandQueue {
return buffers[bufferUse];
}
void setCurrentFlushStamp(uint32_t taskCount, NEO::FlushStamp flushStamp) {
void setCurrentFlushStamp(TaskCountType taskCount, NEO::FlushStamp flushStamp) {
flushId[bufferUse] = std::make_pair(taskCount, flushStamp);
}
std::pair<uint32_t, NEO::FlushStamp> &getCurrentFlushStamp() {
std::pair<TaskCountType, NEO::FlushStamp> &getCurrentFlushStamp() {
return flushId[bufferUse];
}
private:
NEO::GraphicsAllocation *buffers[BUFFER_ALLOCATION::COUNT];
std::pair<uint32_t, NEO::FlushStamp> flushId[BUFFER_ALLOCATION::COUNT];
std::pair<TaskCountType, NEO::FlushStamp> flushId[BUFFER_ALLOCATION::COUNT];
BUFFER_ALLOCATION bufferUse = BUFFER_ALLOCATION::FIRST;
};
static constexpr size_t defaultQueueCmdBufferSize = 128 * MemoryConstants::kiloByte;
@@ -76,7 +77,7 @@ struct CommandQueueImp : public CommandQueue {
Device *getDevice() { return device; }
uint32_t getTaskCount() { return taskCount; }
TaskCountType getTaskCount() { return taskCount; }
NEO::CommandStreamReceiver *getCsr() { return csr; }
@@ -105,7 +106,7 @@ struct CommandQueueImp : public CommandQueue {
NEO::CommandStreamReceiver *csr = nullptr;
NEO::LinearStream commandStream{};
std::atomic<uint32_t> taskCount{0};
std::atomic<TaskCountType> taskCount{0};
bool useKmdWaitFunction = false;
};

View File

@@ -7,6 +7,8 @@
#pragma once
#include "shared/source/command_stream/task_count_helper.h"
#include <level_zero/ze_api.h>
#include <chrono>
@@ -39,7 +41,7 @@ struct Fence : _ze_fence_handle_t {
std::chrono::microseconds gpuHangCheckPeriod{500'000};
CommandQueueImp *cmdQueue;
uint32_t taskCount = 0;
TaskCountType taskCount = 0;
};
} // namespace L0

View File

@@ -109,7 +109,7 @@ HWTEST_F(CommandQueueCreate, givenGpuHangOnSecondReserveWhenReservingLinearStrea
auto firstAllocation = commandQueue->commandStream.getGraphicsAllocation();
EXPECT_EQ(firstAllocation, commandQueue->buffers.getCurrentBufferAllocation());
uint32_t currentTaskCount = 33u;
TaskCountType currentTaskCount = 33u;
auto &csr = neoDevice->getUltCommandStreamReceiver<FamilyType>();
csr.latestWaitForCompletionWithTimeoutTaskCount = currentTaskCount;
csr.waitForTaskCountWithKmdNotifyFallbackReturnValue = WaitStatus::Ready;
@@ -150,7 +150,7 @@ HWTEST_F(CommandQueueCreate, whenReserveLinearStreamThenBufferAllocationSwitched
auto firstAllocation = commandQueue->commandStream.getGraphicsAllocation();
EXPECT_EQ(firstAllocation, commandQueue->buffers.getCurrentBufferAllocation());
uint32_t currentTaskCount = 33u;
TaskCountType currentTaskCount = 33u;
auto &csr = neoDevice->getUltCommandStreamReceiver<FamilyType>();
csr.latestWaitForCompletionWithTimeoutTaskCount = currentTaskCount;
@@ -624,8 +624,8 @@ HWTEST_F(CommandQueueCreate, givenContainerWithAllocationsWhenResidencyContainer
false,
returnValue));
ResidencyContainer container;
uint32_t peekTaskCountBefore = commandQueue->csr->peekTaskCount();
uint32_t flushedTaskCountBefore = commandQueue->csr->peekLatestFlushedTaskCount();
TaskCountType peekTaskCountBefore = commandQueue->csr->peekTaskCount();
TaskCountType flushedTaskCountBefore = commandQueue->csr->peekLatestFlushedTaskCount();
NEO::SubmissionStatus ret = commandQueue->submitBatchBuffer(0, container, nullptr, false);
EXPECT_EQ(csr->makeResidentCalledTimes, 0u);
EXPECT_EQ(ret, NEO::SubmissionStatus::SUCCESS);
@@ -649,8 +649,8 @@ HWTEST_F(CommandQueueCreate, givenCommandStreamReceiverFailsThenSubmitBatchBuffe
false,
returnValue));
ResidencyContainer container;
uint32_t peekTaskCountBefore = commandQueue->csr->peekTaskCount();
uint32_t flushedTaskCountBefore = commandQueue->csr->peekLatestFlushedTaskCount();
TaskCountType peekTaskCountBefore = commandQueue->csr->peekTaskCount();
TaskCountType flushedTaskCountBefore = commandQueue->csr->peekLatestFlushedTaskCount();
NEO::SubmissionStatus ret = commandQueue->submitBatchBuffer(0, container, nullptr, false);
EXPECT_EQ(ret, NEO::SubmissionStatus::FAILED);
EXPECT_EQ(peekTaskCountBefore, commandQueue->csr->peekTaskCount());
@@ -1263,7 +1263,7 @@ HWTEST2_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenWaitForCompl
auto commandList = new CommandListCoreFamily<gfxCoreFamily>();
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
auto commandListHandle = commandList->toHandle();
uint32_t flushedTaskCountPrior = csr->peekTaskCount();
TaskCountType flushedTaskCountPrior = csr->peekTaskCount();
csr->setLatestFlushedTaskCount(flushedTaskCountPrior);
auto res = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, res);
@@ -1902,7 +1902,7 @@ TEST_F(CommandQueueCreate, givenCreatedCommandQueueWhenGettingTrackingFlagsThenD
struct SVMAllocsManagerMock : public NEO::SVMAllocsManager {
using SVMAllocsManager::mtxForIndirectAccess;
SVMAllocsManagerMock(MemoryManager *memoryManager) : NEO::SVMAllocsManager(memoryManager, false) {}
void makeIndirectAllocationsResident(CommandStreamReceiver &commandStreamReceiver, uint32_t taskCount) override {
void makeIndirectAllocationsResident(CommandStreamReceiver &commandStreamReceiver, TaskCountType taskCount) override {
makeIndirectAllocationsResidentCalledTimes++;
}
void addInternalAllocationsToResidencyContainer(uint32_t rootDeviceIndex,

View File

@@ -143,23 +143,23 @@ struct SynchronizeCsr : public NEO::UltCommandStreamReceiver<GfxFamily> {
SynchronizeCsr(const NEO::ExecutionEnvironment &executionEnvironment, const DeviceBitfield deviceBitfield)
: NEO::UltCommandStreamReceiver<GfxFamily>(const_cast<NEO::ExecutionEnvironment &>(executionEnvironment), 0, deviceBitfield) {
CommandStreamReceiver::tagAddress = &tagAddressData[0];
memset(const_cast<uint32_t *>(CommandStreamReceiver::tagAddress), 0xFFFFFFFF, tagSize * sizeof(uint32_t));
memset(const_cast<TagAddressType *>(CommandStreamReceiver::tagAddress), 0xFFFFFFFF, tagSize * sizeof(uint32_t));
}
WaitStatus waitForCompletionWithTimeout(const WaitParams &params, uint32_t taskCountToWait) override {
WaitStatus waitForCompletionWithTimeout(const WaitParams &params, TaskCountType taskCountToWait) override {
enableTimeoutSet = params.enableTimeout;
waitForComplitionCalledTimes++;
partitionCountSet = this->activePartitions;
return waitForCompletionWithTimeoutResult;
}
WaitStatus waitForTaskCountWithKmdNotifyFallback(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool quickKmdSleep, NEO::QueueThrottle throttle) override {
WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait, bool quickKmdSleep, NEO::QueueThrottle throttle) override {
waitForTaskCountWithKmdNotifyFallbackCalled++;
return NEO::UltCommandStreamReceiver<GfxFamily>::waitForTaskCountWithKmdNotifyFallback(taskCountToWait, flushStampToWait, quickKmdSleep, throttle);
}
static constexpr size_t tagSize = 128;
static volatile uint32_t tagAddressData[tagSize];
static volatile TagAddressType tagAddressData[tagSize];
uint32_t waitForComplitionCalledTimes = 0;
uint32_t waitForTaskCountWithKmdNotifyFallbackCalled = 0;
uint32_t partitionCountSet = 0;
@@ -168,7 +168,7 @@ struct SynchronizeCsr : public NEO::UltCommandStreamReceiver<GfxFamily> {
};
template <typename GfxFamily>
volatile uint32_t SynchronizeCsr<GfxFamily>::tagAddressData[SynchronizeCsr<GfxFamily>::tagSize];
volatile TagAddressType SynchronizeCsr<GfxFamily>::tagAddressData[SynchronizeCsr<GfxFamily>::tagSize];
HWTEST_F(CommandQueueSynchronizeTest, givenCallToSynchronizeThenCorrectEnableTimeoutAndTimeoutValuesAreUsed) {
auto csr = std::unique_ptr<SynchronizeCsr<FamilyType>>(new SynchronizeCsr<FamilyType>(*device->getNEODevice()->getExecutionEnvironment(),
@@ -301,7 +301,7 @@ HWTEST2_F(MultiTileCommandQueueSynchronizeTest, givenMultiplePartitionCountWhenC
csr->createPreemptionAllocation();
}
EXPECT_NE(0u, csr->getPostSyncWriteOffset());
volatile uint32_t *tagAddress = csr->getTagAddress();
volatile TagAddressType *tagAddress = csr->getTagAddress();
for (uint32_t i = 0; i < 2; i++) {
*tagAddress = 0xFF;
tagAddress = ptrOffset(tagAddress, csr->getPostSyncWriteOffset());
@@ -341,7 +341,7 @@ HWTEST2_F(MultiTileCommandQueueSynchronizeTest, givenCsrHasMultipleActivePartiti
csr->createPreemptionAllocation();
}
EXPECT_NE(0u, csr->getPostSyncWriteOffset());
volatile uint32_t *tagAddress = csr->getTagAddress();
volatile TagAddressType *tagAddress = csr->getTagAddress();
for (uint32_t i = 0; i < 2; i++) {
*tagAddress = 0xFF;
tagAddress = ptrOffset(tagAddress, csr->getPostSyncWriteOffset());
@@ -402,7 +402,7 @@ struct TestCmdQueueCsr : public NEO::UltCommandStreamReceiver<GfxFamily> {
: NEO::UltCommandStreamReceiver<GfxFamily>(const_cast<NEO::ExecutionEnvironment &>(executionEnvironment), 0, deviceBitfield) {
}
ADDMETHOD_NOBASE(waitForCompletionWithTimeout, NEO::WaitStatus, NEO::WaitStatus::NotReady, (const WaitParams &params, uint32_t taskCountToWait));
ADDMETHOD_NOBASE(waitForCompletionWithTimeout, NEO::WaitStatus, NEO::WaitStatus::NotReady, (const WaitParams &params, TaskCountType taskCountToWait));
};
HWTEST_F(CommandQueueSynchronizeTest, givenSinglePartitionCountWhenWaitFunctionFailsThenReturnNotReady) {
@@ -490,7 +490,7 @@ HWTEST_F(CommandQueueSynchronizeTest, givenSynchronousCommandQueueWhenTagUpdateF
auto pipeControls = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
size_t pipeControlsPostSyncNumber = 0u;
uint32_t expectedData = commandQueue->getCsr()->peekTaskCount();
TaskCountType expectedData = commandQueue->getCsr()->peekTaskCount();
for (size_t i = 0; i < pipeControls.size(); i++) {
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(*pipeControls[i]);
if (pipeControl->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
@@ -792,7 +792,7 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceThenP
uint32_t scratchSlot,
uint32_t requiredPerThreadScratchSize,
uint32_t requiredPerThreadPrivateScratchSize,
uint32_t currentTaskCount,
TaskCountType currentTaskCount,
OsContext &osContext,
bool &stateBaseAddressDirty,
bool &vfeStateDirty) override {
@@ -855,7 +855,7 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceAndHe
uint32_t scratchSlot,
uint32_t requiredPerThreadScratchSize,
uint32_t requiredPerThreadPrivateScratchSize,
uint32_t currentTaskCount,
TaskCountType currentTaskCount,
OsContext &osContext,
bool &stateBaseAddressDirty,
bool &vfeStateDirty) override {
@@ -908,7 +908,7 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenBindlessEnabledThenHand
void programBindlessSurfaceStateForScratch(BindlessHeapsHelper *heapsHelper,
uint32_t requiredPerThreadScratchSize,
uint32_t requiredPerThreadPrivateScratchSize,
uint32_t currentTaskCount,
TaskCountType currentTaskCount,
OsContext &osContext,
bool &stateBaseAddressDirty,
bool &vfeStateDirty,

View File

@@ -34,8 +34,8 @@ using namespace std::chrono_literals;
namespace CpuIntrinsicsTests {
extern std::atomic<uint32_t> pauseCounter;
extern volatile uint32_t *pauseAddress;
extern uint32_t pauseValue;
extern volatile TagAddressType *pauseAddress;
extern TaskCountType pauseValue;
extern uint32_t pauseOffset;
extern std::function<void()> setupPauseAddress;
} // namespace CpuIntrinsicsTests
@@ -902,12 +902,12 @@ TEST_F(EventUsedPacketSignalSynchronizeTest, givenInfiniteTimeoutWhenWaitingForN
const size_t eventPacketSize = event->getSinglePacketSize();
const size_t eventCompletionOffset = event->getContextStartOffset();
VariableBackup<volatile uint32_t *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<uint32_t> backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED);
VariableBackup<volatile TagAddressType *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<TaskCountType> backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED);
VariableBackup<uint32_t> backupPauseOffset(&CpuIntrinsicsTests::pauseOffset);
VariableBackup<std::function<void()>> backupSetupPauseAddress(&CpuIntrinsicsTests::setupPauseAddress);
CpuIntrinsicsTests::pauseCounter = 0u;
CpuIntrinsicsTests::pauseAddress = static_cast<uint32_t *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
CpuIntrinsicsTests::pauseAddress = static_cast<TagAddressType *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
uint32_t *hostAddr = static_cast<uint32_t *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
for (uint32_t i = 0; i < packetsInUse; i++) {
@@ -917,7 +917,7 @@ TEST_F(EventUsedPacketSignalSynchronizeTest, givenInfiniteTimeoutWhenWaitingForN
CpuIntrinsicsTests::setupPauseAddress = [&]() {
if (CpuIntrinsicsTests::pauseCounter > 10) {
volatile uint32_t *nextPacket = CpuIntrinsicsTests::pauseAddress;
volatile TagAddressType *nextPacket = CpuIntrinsicsTests::pauseAddress;
for (uint32_t i = 0; i < packetsInUse; i++) {
*nextPacket = Event::STATE_SIGNALED;
nextPacket = ptrOffset(nextPacket, eventPacketSize);
@@ -938,12 +938,12 @@ TEST_F(EventUsedPacketSignalSynchronizeTest, givenInfiniteTimeoutWhenWaitingForO
const size_t eventPacketSize = event->getSinglePacketSize();
const size_t eventCompletionOffset = event->getContextEndOffset();
VariableBackup<volatile uint32_t *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<uint32_t> backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED);
VariableBackup<volatile TagAddressType *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<TaskCountType> backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED);
VariableBackup<uint32_t> backupPauseOffset(&CpuIntrinsicsTests::pauseOffset);
VariableBackup<std::function<void()>> backupSetupPauseAddress(&CpuIntrinsicsTests::setupPauseAddress);
CpuIntrinsicsTests::pauseCounter = 0u;
CpuIntrinsicsTests::pauseAddress = static_cast<uint32_t *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
CpuIntrinsicsTests::pauseAddress = static_cast<TagAddressType *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
uint32_t *hostAddr = static_cast<uint32_t *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
for (uint32_t i = 0; i < packetsInUse; i++) {
@@ -953,7 +953,7 @@ TEST_F(EventUsedPacketSignalSynchronizeTest, givenInfiniteTimeoutWhenWaitingForO
CpuIntrinsicsTests::setupPauseAddress = [&]() {
if (CpuIntrinsicsTests::pauseCounter > 10) {
volatile uint32_t *nextPacket = CpuIntrinsicsTests::pauseAddress;
volatile TagAddressType *nextPacket = CpuIntrinsicsTests::pauseAddress;
for (uint32_t i = 0; i < packetsInUse; i++) {
*nextPacket = Event::STATE_SIGNALED;
nextPacket = ptrOffset(nextPacket, eventPacketSize);
@@ -974,12 +974,12 @@ TEST_F(EventUsedPacketSignalSynchronizeTest, givenInfiniteTimeoutWhenWaitingForT
const size_t eventPacketSize = event->getSinglePacketSize();
const size_t eventCompletionOffset = event->getContextEndOffset();
VariableBackup<volatile uint32_t *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<uint32_t> backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED);
VariableBackup<volatile TagAddressType *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<TaskCountType> backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED);
VariableBackup<uint32_t> backupPauseOffset(&CpuIntrinsicsTests::pauseOffset);
VariableBackup<std::function<void()>> backupSetupPauseAddress(&CpuIntrinsicsTests::setupPauseAddress);
CpuIntrinsicsTests::pauseCounter = 0u;
CpuIntrinsicsTests::pauseAddress = static_cast<uint32_t *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
CpuIntrinsicsTests::pauseAddress = static_cast<TagAddressType *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
uint32_t *hostAddr = static_cast<uint32_t *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
for (uint32_t i = 0; i < packetsInUse; i++) {
@@ -989,7 +989,7 @@ TEST_F(EventUsedPacketSignalSynchronizeTest, givenInfiniteTimeoutWhenWaitingForT
CpuIntrinsicsTests::setupPauseAddress = [&]() {
if (CpuIntrinsicsTests::pauseCounter > 10) {
volatile uint32_t *nextPacket = CpuIntrinsicsTests::pauseAddress;
volatile TagAddressType *nextPacket = CpuIntrinsicsTests::pauseAddress;
for (uint32_t i = 0; i < packetsInUse; i++) {
*nextPacket = Event::STATE_SIGNALED;
nextPacket = ptrOffset(nextPacket, eventPacketSize);
@@ -2108,8 +2108,8 @@ HWTEST_F(EventTests,
constexpr uint32_t iterations = 5;
VariableBackup<volatile uint32_t *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<uint32_t> backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED);
VariableBackup<volatile TagAddressType *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<TaskCountType> backupPauseValue(&CpuIntrinsicsTests::pauseValue, Event::STATE_CLEARED);
VariableBackup<uint32_t> backupPauseOffset(&CpuIntrinsicsTests::pauseOffset);
VariableBackup<std::function<void()>> backupSetupPauseAddress(&CpuIntrinsicsTests::setupPauseAddress);
neoDevice->getUltCommandStreamReceiver<FamilyType>().commandStreamReceiverType = CommandStreamReceiverType::CSR_TBX;
@@ -2124,7 +2124,7 @@ HWTEST_F(EventTests,
if (event->isUsingContextEndOffset()) {
eventCompletionOffset = event->getContextEndOffset();
}
uint32_t *eventAddress = static_cast<uint32_t *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
TagAddressType *eventAddress = static_cast<TagAddressType *>(ptrOffset(event->getHostAddress(), eventCompletionOffset));
*eventAddress = Event::STATE_INITIAL;
CpuIntrinsicsTests::pauseCounter = 0u;
@@ -2132,7 +2132,7 @@ HWTEST_F(EventTests,
CpuIntrinsicsTests::setupPauseAddress = [&]() {
if (CpuIntrinsicsTests::pauseCounter >= iterations) {
volatile uint32_t *packet = CpuIntrinsicsTests::pauseAddress;
volatile TagAddressType *packet = CpuIntrinsicsTests::pauseAddress;
*packet = Event::STATE_SIGNALED;
}
};

View File

@@ -24,8 +24,8 @@ using namespace std::chrono_literals;
namespace CpuIntrinsicsTests {
extern std::atomic<uint32_t> pauseCounter;
extern volatile uint32_t *pauseAddress;
extern uint32_t pauseValue;
extern volatile TagAddressType *pauseAddress;
extern TaskCountType pauseValue;
extern uint32_t pauseOffset;
extern std::function<void()> setupPauseAddress;
} // namespace CpuIntrinsicsTests
@@ -247,14 +247,14 @@ TEST_F(FenceSynchronizeTest, givenInfiniteTimeoutWhenWaitingForFenceCompletionTh
fence->taskCount = 1;
VariableBackup<volatile uint32_t *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<uint32_t> backupPauseValue(&CpuIntrinsicsTests::pauseValue, 0);
VariableBackup<volatile TagAddressType *> backupPauseAddress(&CpuIntrinsicsTests::pauseAddress);
VariableBackup<TaskCountType> backupPauseValue(&CpuIntrinsicsTests::pauseValue, 0);
VariableBackup<uint32_t> backupPauseOffset(&CpuIntrinsicsTests::pauseOffset);
VariableBackup<std::function<void()>> backupSetupPauseAddress(&CpuIntrinsicsTests::setupPauseAddress);
CpuIntrinsicsTests::pauseCounter = 0u;
CpuIntrinsicsTests::pauseAddress = csr->getTagAddress();
volatile uint32_t *hostAddr = csr->getTagAddress();
volatile TagAddressType *hostAddr = csr->getTagAddress();
for (uint32_t i = 0; i < activePartitions; i++) {
*hostAddr = 0;
hostAddr = ptrOffset(hostAddr, postSyncOffset);
@@ -262,7 +262,7 @@ TEST_F(FenceSynchronizeTest, givenInfiniteTimeoutWhenWaitingForFenceCompletionTh
CpuIntrinsicsTests::setupPauseAddress = [&]() {
if (CpuIntrinsicsTests::pauseCounter > 10) {
volatile uint32_t *nextPacket = CpuIntrinsicsTests::pauseAddress;
volatile TagAddressType *nextPacket = CpuIntrinsicsTests::pauseAddress;
for (uint32_t i = 0; i < activePartitions; i++) {
*nextPacket = 1;
nextPacket = ptrOffset(nextPacket, postSyncOffset);

View File

@@ -2335,9 +2335,9 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
EXPECT_NE(nullptr, ptr1);
auto allocationData1 = svmManager->getSVMAlloc(ptr1);
uint32_t prevPeekTaskCount1 = allocationData1->gpuAllocations.getGraphicsAllocation(1u)->getTaskCount(csr0->getOsContext().getContextId());
TaskCountType prevPeekTaskCount1 = allocationData1->gpuAllocations.getGraphicsAllocation(1u)->getTaskCount(csr0->getOsContext().getContextId());
svmManager->prepareIndirectAllocationForDestruction(allocationData1);
uint32_t postPeekTaskCount1 = allocationData1->gpuAllocations.getGraphicsAllocation(1u)->getTaskCount(csr0->getOsContext().getContextId());
TaskCountType postPeekTaskCount1 = allocationData1->gpuAllocations.getGraphicsAllocation(1u)->getTaskCount(csr0->getOsContext().getContextId());
EXPECT_EQ(postPeekTaskCount1, prevPeekTaskCount1);