Add missing pollForCompletion on clEnqueueVerifyMemoryINTEL

Related-To: NEO-7618

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-03-02 10:49:50 +00:00
committed by Compute-Runtime-Automation
parent 7903617a44
commit 72ada8b41f
5 changed files with 53 additions and 1 deletions

View File

@@ -1,11 +1,12 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
* Copyright (C) 2019-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/common/mocks/mock_csr.h"
#include "shared/test/common/mocks/mock_os_context.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/extensions/public/cl_ext_private.h"
@@ -64,3 +65,38 @@ TEST_F(ClEnqueueVerifyMemoryIntelTests, givenNotEqualMemoryWhenCallingVerifyMemo
cl_int retval = clEnqueueVerifyMemoryINTEL(pCommandQueue, gpuAddress, &differentMemory, sizeof(differentMemory), comparisonMode);
EXPECT_EQ(CL_INVALID_VALUE, retval);
}
HWTEST_F(ClEnqueueVerifyMemoryIntelTests, givenActiveBcsEngineWhenCallingExpectMemoryThenPollForCompletionOnAllEngines) {
UltCommandStreamReceiver<FamilyType> ultCsrBcs0(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
UltCommandStreamReceiver<FamilyType> ultCsrBcs1(*pDevice->getExecutionEnvironment(), pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
MockOsContext osContext0(0, {{aub_stream::ENGINE_BCS, EngineUsage::Regular}, 0, PreemptionMode::Disabled, false, false});
MockOsContext osContext1(1, {{aub_stream::ENGINE_BCS1, EngineUsage::Regular}, 0, PreemptionMode::Disabled, false, false});
EngineControl engineControl[2] = {{&ultCsrBcs0, &osContext0}, {&ultCsrBcs1, &osContext1}};
pCommandQueue->bcsInitialized = true;
pCommandQueue->bcsEngines[EngineHelpers::getBcsIndex(aub_stream::ENGINE_BCS)] = &engineControl[0];
pCommandQueue->bcsEngines[EngineHelpers::getBcsIndex(aub_stream::ENGINE_BCS1)] = &engineControl[1];
pCommandQueue->bcsStates[0].engineType = aub_stream::ENGINE_BCS;
pCommandQueue->bcsStates[1].engineType = aub_stream::ENGINE_BCS1;
EXPECT_EQ(0u, ultCsrBcs0.pollForCompletionCalled);
EXPECT_EQ(0u, ultCsrBcs1.pollForCompletionCalled);
cl_int retval = clEnqueueVerifyMemoryINTEL(pCommandQueue, gpuAddress, expected, expectedSize, comparisonMode);
EXPECT_EQ(CL_SUCCESS, retval);
EXPECT_EQ(1u, ultCsrBcs0.pollForCompletionCalled);
EXPECT_EQ(1u, ultCsrBcs1.pollForCompletionCalled);
pCommandQueue->bcsEngines[EngineHelpers::getBcsIndex(aub_stream::ENGINE_BCS)]->commandStreamReceiver = nullptr;
pCommandQueue->bcsEngines[EngineHelpers::getBcsIndex(aub_stream::ENGINE_BCS1)]->commandStreamReceiver = nullptr;
pCommandQueue->bcsStates[0].engineType = aub_stream::NUM_ENGINES;
pCommandQueue->bcsStates[1].engineType = aub_stream::NUM_ENGINES;
pCommandQueue->bcsEngines[EngineHelpers::getBcsIndex(aub_stream::ENGINE_BCS)] = nullptr;
pCommandQueue->bcsEngines[EngineHelpers::getBcsIndex(aub_stream::ENGINE_BCS1)] = nullptr;
}