mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Add getLastCounter() to EuThread
Related-To: NEO-6447 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
371358c8c7
commit
7a2c5e28c1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -151,6 +151,10 @@ class EuThread {
|
||||
|
||||
uint64_t getMemoryHandle() const { return memoryHandle; }
|
||||
|
||||
uint8_t getLastCounter() const {
|
||||
return systemRoutineCounter;
|
||||
}
|
||||
|
||||
public:
|
||||
static constexpr uint64_t invalidHandle = std::numeric_limits<uint64_t>::max();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -231,5 +231,17 @@ TEST(EuThread, GivenThreadStateStoppedWhenVerifyingStopWithEvenCounterBiggerByMo
|
||||
EXPECT_TRUE(euThread.isRunning());
|
||||
}
|
||||
|
||||
TEST(EuThread, GivenEuThreadWhenGettingLastCounterThenCorrectValueIsReturned) {
|
||||
ze_device_thread_t devThread = {3, 4, 5, 6};
|
||||
EuThread::ThreadId threadId(0, devThread);
|
||||
EuThread euThread(threadId);
|
||||
|
||||
EXPECT_EQ(0u, euThread.getLastCounter());
|
||||
euThread.verifyStopped(1);
|
||||
EXPECT_EQ(1u, euThread.getLastCounter());
|
||||
euThread.verifyStopped(9);
|
||||
EXPECT_EQ(9u, euThread.getLastCounter());
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
||||
|
||||
Reference in New Issue
Block a user