mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
[fix] correct fence not ready value
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8d834202af
commit
4ef879867c
@@ -12,6 +12,9 @@
|
||||
#include "level_zero/core/source/cmdqueue/cmdqueue_imp.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace FenceDefinition {
|
||||
static constexpr TaskCountType fenceNotReady = NEO::CompletionStamp::notReady;
|
||||
} // namespace FenceDefinition
|
||||
|
||||
Fence *Fence::create(CommandQueueImp *cmdQueue, const ze_fence_desc_t *desc) {
|
||||
auto fence = new Fence(cmdQueue);
|
||||
@@ -39,7 +42,7 @@ ze_result_t Fence::reset(bool signaled) {
|
||||
if (signaled) {
|
||||
taskCount = 0;
|
||||
} else {
|
||||
taskCount = std::numeric_limits<uint32_t>::max();
|
||||
taskCount = FenceDefinition::fenceNotReady;
|
||||
}
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
@@ -54,7 +57,7 @@ ze_result_t Fence::hostSynchronize(uint64_t timeout) {
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
if (std::numeric_limits<uint32_t>::max() == taskCount) {
|
||||
if (FenceDefinition::fenceNotReady == taskCount) {
|
||||
return ZE_RESULT_NOT_READY;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/built_ins/sip.h"
|
||||
#include "shared/source/helpers/completion_stamp.h"
|
||||
#include "shared/test/common/mocks/mock_command_stream_receiver.h"
|
||||
#include "shared/test/common/mocks/mock_csr.h"
|
||||
#include "shared/test/common/mocks/mock_driver_model.h"
|
||||
@@ -341,12 +342,12 @@ TEST_F(FenceTest, givenFenceWhenResettingThenTaskCountIsReset) {
|
||||
|
||||
auto fence = whiteboxCast(Fence::create(&cmdqueue, &desc));
|
||||
ASSERT_NE(fence, nullptr);
|
||||
EXPECT_EQ(std::numeric_limits<uint32_t>::max(), fence->taskCount);
|
||||
EXPECT_EQ(NEO::CompletionStamp::notReady, fence->taskCount);
|
||||
|
||||
fence->taskCount = 1;
|
||||
auto result = fence->reset(false);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(std::numeric_limits<uint32_t>::max(), fence->taskCount);
|
||||
EXPECT_EQ(NEO::CompletionStamp::notReady, fence->taskCount);
|
||||
|
||||
delete fence;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user