mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
fix: reset patched scratch per thread size values after command list reset
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f40449b3e8
commit
0ad5316f53
@@ -122,6 +122,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::reset() {
|
||||
commandListPreemptionMode = device->getDevicePreemptionMode();
|
||||
commandListPerThreadScratchSize[0] = 0u;
|
||||
commandListPerThreadScratchSize[1] = 0u;
|
||||
commandListPatchedPerThreadScratchSize[0] = 0u;
|
||||
commandListPatchedPerThreadScratchSize[1] = 0u;
|
||||
requiredStreamState.resetState();
|
||||
finalStreamState.resetState();
|
||||
containsAnyKernel = false;
|
||||
|
||||
@@ -1533,6 +1533,9 @@ void CommandListScratchPatchFixtureInit::testScratchGrowingPatching() {
|
||||
result = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false, nullptr, 0, nullptr);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_EQ(0x40u, commandList->getCommandListPatchedPerThreadScratchSize(0));
|
||||
EXPECT_EQ(0u, commandList->getCommandListPatchedPerThreadScratchSize(1));
|
||||
|
||||
auto scratchAddress = scratchController->getScratchPatchAddress();
|
||||
auto fullScratchAddress = surfaceHeapGpuBase + scratchAddress;
|
||||
|
||||
@@ -1543,6 +1546,10 @@ void CommandListScratchPatchFixtureInit::testScratchGrowingPatching() {
|
||||
EXPECT_EQ(fullScratchAddress, scratchInlineValue);
|
||||
|
||||
commandList->reset();
|
||||
|
||||
EXPECT_EQ(0u, commandList->getCommandListPatchedPerThreadScratchSize(0));
|
||||
EXPECT_EQ(0u, commandList->getCommandListPatchedPerThreadScratchSize(1));
|
||||
|
||||
mockKernelImmData->kernelDescriptor->kernelAttributes.perThreadScratchSize[1] = 0x40;
|
||||
|
||||
usedBefore = cmdListStream->getUsed();
|
||||
@@ -1563,9 +1570,15 @@ void CommandListScratchPatchFixtureInit::testScratchGrowingPatching() {
|
||||
result = commandList->close();
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
// simulate slot 0 is already patched - to check slot 1 change is detected
|
||||
commandList->setCommandListPatchedPerThreadScratchSize(0, 0x40);
|
||||
|
||||
result = commandQueue->executeCommandLists(1, &commandListHandle, nullptr, false, nullptr, 0, nullptr);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_EQ(0x40u, commandList->getCommandListPatchedPerThreadScratchSize(0));
|
||||
EXPECT_EQ(0x40u, commandList->getCommandListPatchedPerThreadScratchSize(1));
|
||||
|
||||
scratchAddress = scratchController->getScratchPatchAddress();
|
||||
auto fullScratchSlot1Address = surfaceHeapGpuBase + scratchAddress;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user