Skip to content

Commit 6d53bd5

Browse files
luluu9Compute-Runtime-Automation
authored andcommitted
test: expect local id generation depending on kernel flag
Related-To: NEO-10014 Signed-off-by: Naklicki, Mateusz <[email protected]>
1 parent e0ccf22 commit 6d53bd5

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

opencl/test/unit_test/aub_tests/command_queue/aub_inline_data_local_id_tests_xehp_and_later.cpp

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/*
2-
* Copyright (C) 2022-2023 Intel Corporation
2+
* Copyright (C) 2022-2024 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "shared/source/command_container/command_encoder.h"
99
#include "shared/source/helpers/array_count.h"
10+
#include "shared/source/helpers/hw_walk_order.h"
1011
#include "shared/test/common/cmd_parse/hw_parse.h"
1112
#include "shared/test/common/helpers/debug_manager_state_restore.h"
1213
#include "shared/test/common/test_macros/hw_test.h"
@@ -382,21 +383,24 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubHwLocalIdsTest, givenNonPowOf2LocalW
382383
EXPECT_NE(hwParser.itorWalker, hwParser.cmdList.end());
383384

384385
auto walker = genCmdCast<DefaultWalkerType *>(*hwParser.itorWalker);
385-
386-
auto localId = kernels[2]->getKernelInfo().kernelDescriptor.kernelAttributes.localId;
387-
uint32_t expectedEmitLocal = 0;
388-
if (localId[0]) {
389-
expectedEmitLocal |= (1 << 0);
390-
}
391-
if (localId[1]) {
392-
expectedEmitLocal |= (1 << 1);
393-
}
394-
if (localId[2]) {
395-
expectedEmitLocal |= (1 << 2);
386+
if (kernels[2]->getKernelInfo().kernelDescriptor.kernelAttributes.flags.requiresWorkgroupWalkOrder) {
387+
EXPECT_EQ(0u, walker->getGenerateLocalId());
388+
} else {
389+
auto localId = kernels[2]->getKernelInfo().kernelDescriptor.kernelAttributes.localId;
390+
uint32_t expectedEmitLocal = 0;
391+
if (localId[0]) {
392+
expectedEmitLocal |= (1 << 0);
393+
}
394+
if (localId[1]) {
395+
expectedEmitLocal |= (1 << 1);
396+
}
397+
if (localId[2]) {
398+
expectedEmitLocal |= (1 << 2);
399+
}
400+
EXPECT_EQ(expectedEmitLocal, walker->getEmitLocalId());
401+
EXPECT_EQ(1u, walker->getGenerateLocalId());
402+
EXPECT_EQ(4u, walker->getWalkOrder());
396403
}
397-
EXPECT_EQ(expectedEmitLocal, walker->getEmitLocalId());
398-
EXPECT_EQ(1u, walker->getGenerateLocalId());
399-
EXPECT_EQ(4u, walker->getWalkOrder());
400404

401405
pCmdQ->flush();
402406

@@ -424,8 +428,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubHwLocalIdsWithSubgroupsTest, givenKe
424428
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
425429

426430
cl_uint workDim = 1;
427-
size_t globalWorkSize[3] = {200, 1, 1};
428-
size_t localWorkSize[3] = {200, 1, 1};
431+
size_t globalWorkSize[3] = {256, 1, 1};
432+
size_t localWorkSize[3] = {256, 1, 1};
429433

430434
auto retVal = pCmdQ->enqueueKernel(
431435
kernels[9].get(),
@@ -458,11 +462,13 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubHwLocalIdsWithSubgroupsTest, givenKe
458462
}
459463
EXPECT_EQ(expectedEmitLocal, walker->getEmitLocalId());
460464
EXPECT_EQ(1u, walker->getGenerateLocalId());
461-
EXPECT_EQ(4u, walker->getWalkOrder());
465+
for (size_t i = 0; i < 3; i++) {
466+
EXPECT_EQ(kernels[9]->getKernelInfo().kernelDescriptor.kernelAttributes.workgroupWalkOrder[i], HwWalkOrderHelper::compatibleDimensionOrders[walker->getWalkOrder()][i]);
467+
}
462468

463469
pCmdQ->finish();
464470

465-
// we expect sequence of local ids from 0..199
471+
// we expect sequence of local ids from 0..256
466472
auto expectedMemory = reinterpret_cast<uint32_t *>(variables[0].expectedMemory);
467473
auto currentWorkItem = 0u;
468474

0 commit comments

Comments
 (0)