Skip to content

Commit 6f62a78

Browse files
Revert "Check IndirectStatelessCount from igc"
This reverts commit 5e62df4. Signed-off-by: Compute-Runtime-Validation <[email protected]>
1 parent f2c4231 commit 6f62a78

File tree

12 files changed

+18
-77
lines changed

12 files changed

+18
-77
lines changed

level_zero/core/source/kernel/kernel_imp.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,7 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
851851

852852
kernelHasIndirectAccess = kernelDescriptor.kernelAttributes.hasNonKernelArgLoad ||
853853
kernelDescriptor.kernelAttributes.hasNonKernelArgStore ||
854-
kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic ||
855-
getImmutableData()->getKernelInfo()->hasIndirectStatelessAccess;
854+
kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic;
856855

857856
if (this->usesRayTracing()) {
858857
if (this->getImmutableData()->getDescriptor().payloadMappings.implicitArgs.rtDispatchGlobals.pointerSize > 0) {
@@ -979,7 +978,9 @@ Kernel *Kernel::create(uint32_t productFamily, Module *module,
979978
}
980979

981980
bool KernelImp::hasIndirectAllocationsAllowed() const {
982-
return kernelHasIndirectAccess && unifiedMemoryControls.anyIndirectAllocationsAllowed();
981+
return (unifiedMemoryControls.indirectDeviceAllocationsAllowed ||
982+
unifiedMemoryControls.indirectHostAllocationsAllowed ||
983+
unifiedMemoryControls.indirectSharedAllocationsAllowed);
983984
}
984985

985986
uint32_t KernelImp::getSlmTotalSize() const {

level_zero/core/source/kernel/kernel_imp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ struct KernelImp : Kernel {
139139
return ZE_RESULT_SUCCESS;
140140
}
141141

142-
bool hasIndirectAccess() const {
142+
bool hasIndirectAccess() {
143143
return kernelHasIndirectAccess;
144144
}
145145

level_zero/core/test/unit_tests/fixtures/module_fixture.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,13 @@ struct ModuleFixture : public DeviceFixture {
224224
module.reset(Module::create(device, &moduleDesc, moduleBuildLog, type));
225225
}
226226

227-
void createKernel(bool kernelHasIndirectAccess = false) {
227+
void createKernel() {
228228
ze_kernel_desc_t desc = {};
229229
desc.pKernelName = kernelName.c_str();
230230

231231
kernel = std::make_unique<WhiteBox<::L0::Kernel>>();
232232
kernel->module = module.get();
233233
kernel->initialize(&desc);
234-
kernel->kernelHasIndirectAccess = kernelHasIndirectAccess;
235234
}
236235

237236
void TearDown() {

level_zero/core/test/unit_tests/mocks/mock_kernel.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ struct WhiteBox<::L0::Kernel> : public ::L0::KernelImp {
4545
using ::L0::KernelImp::crossThreadData;
4646
using ::L0::KernelImp::crossThreadDataSize;
4747
using ::L0::KernelImp::groupSize;
48-
using ::L0::KernelImp::kernelHasIndirectAccess;
4948
using ::L0::KernelImp::kernelImmData;
5049
using ::L0::KernelImp::kernelRequiresGenerationOfLocalIdsByRuntime;
5150
using ::L0::KernelImp::module;

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace ult {
2626
using CommandListAppendLaunchKernel = Test<ModuleFixture>;
2727

2828
HWTEST_F(CommandListAppendLaunchKernel, givenKernelWithIndirectAllocationsAllowedThenCommandListReturnsExpectedIndirectAllocationsAllowed) {
29-
createKernel(true);
29+
createKernel();
3030
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
3131
kernel->unifiedMemoryControls.indirectSharedAllocationsAllowed = true;
3232
kernel->unifiedMemoryControls.indirectHostAllocationsAllowed = true;

level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ HWTEST_F(CommandQueueIndirectAllocations, givenCommandQueueWhenExecutingCommandL
784784
auto gpuAlloc = device->getDriverHandle()->getSvmAllocsManager()->getSVMAllocs()->get(deviceAlloc)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex());
785785
ASSERT_NE(nullptr, gpuAlloc);
786786

787-
createKernel(true);
787+
createKernel();
788788
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
789789
EXPECT_TRUE(kernel->getUnifiedMemoryControls().indirectDeviceAllocationsAllowed);
790790

@@ -843,7 +843,7 @@ HWTEST_F(CommandQueueIndirectAllocations, givenDebugModeToTreatIndirectAllocatio
843843
auto gpuAlloc = device->getDriverHandle()->getSvmAllocsManager()->getSVMAllocs()->get(deviceAlloc)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex());
844844
ASSERT_NE(nullptr, gpuAlloc);
845845

846-
createKernel(true);
846+
createKernel();
847847
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
848848
EXPECT_TRUE(kernel->getUnifiedMemoryControls().indirectDeviceAllocationsAllowed);
849849

@@ -903,7 +903,6 @@ HWTEST_F(CommandQueueIndirectAllocations, givenDeviceThatSupportsSubmittingIndir
903903

904904
createKernel();
905905
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
906-
kernel->kernelHasIndirectAccess = true;
907906
EXPECT_TRUE(kernel->getUnifiedMemoryControls().indirectDeviceAllocationsAllowed);
908907

909908
ze_group_count_t groupCount{1, 1, 1};
@@ -966,7 +965,6 @@ HWTEST_F(CommandQueueIndirectAllocations, givenDeviceThatSupportsSubmittingIndir
966965

967966
createKernel();
968967
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
969-
kernel->kernelHasIndirectAccess = true;
970968
EXPECT_TRUE(kernel->getUnifiedMemoryControls().indirectDeviceAllocationsAllowed);
971969

972970
static_cast<MockMemoryManager *>(driverHandle.get()->getMemoryManager())->overrideAllocateAsPackReturn = 1u;

level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,6 @@ TEST_F(KernelIndirectPropertiesFromIGCTests, whenInitializingKernelWithNoKernelL
827827
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgLoad = false;
828828
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgStore = false;
829829
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgAtomic = false;
830-
module->mockKernelImmData->mockKernelInfo->hasIndirectStatelessAccess = false;
831830

832831
kernel->initialize(&desc);
833832

@@ -856,7 +855,6 @@ TEST_F(KernelIndirectPropertiesFromIGCTests, whenInitializingKernelWithKernelLoa
856855
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgLoad = true;
857856
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgStore = false;
858857
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgAtomic = false;
859-
module->mockKernelImmData->mockKernelInfo->hasIndirectStatelessAccess = false;
860858

861859
kernel->initialize(&desc);
862860

@@ -873,7 +871,6 @@ TEST_F(KernelIndirectPropertiesFromIGCTests, whenInitializingKernelWithKernelLoa
873871
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgLoad = false;
874872
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgStore = true;
875873
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgAtomic = false;
876-
module->mockKernelImmData->mockKernelInfo->hasIndirectStatelessAccess = false;
877874

878875
kernel->initialize(&desc);
879876

@@ -890,24 +887,6 @@ TEST_F(KernelIndirectPropertiesFromIGCTests, whenInitializingKernelWithKernelLoa
890887
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgLoad = false;
891888
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgStore = false;
892889
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgAtomic = true;
893-
module->mockKernelImmData->mockKernelInfo->hasIndirectStatelessAccess = false;
894-
895-
kernel->initialize(&desc);
896-
897-
EXPECT_TRUE(kernel->hasIndirectAccess());
898-
}
899-
900-
{
901-
std::unique_ptr<ModuleImmutableDataFixture::MockKernel> kernel;
902-
kernel = std::make_unique<ModuleImmutableDataFixture::MockKernel>(module.get());
903-
904-
ze_kernel_desc_t desc = {};
905-
desc.pKernelName = kernelName.c_str();
906-
907-
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgLoad = false;
908-
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgStore = false;
909-
module->mockKernelImmData->mockKernelDescriptor->kernelAttributes.hasNonKernelArgAtomic = false;
910-
module->mockKernelImmData->mockKernelInfo->hasIndirectStatelessAccess = true;
911890

912891
kernel->initialize(&desc);
913892

opencl/source/kernel/kernel.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ cl_int Kernel::initialize() {
259259

260260
this->kernelHasIndirectAccess |= kernelInfo.kernelDescriptor.kernelAttributes.hasNonKernelArgLoad ||
261261
kernelInfo.kernelDescriptor.kernelAttributes.hasNonKernelArgStore ||
262-
kernelInfo.kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic ||
263-
kernelInfo.hasIndirectStatelessAccess;
262+
kernelInfo.kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic;
264263

265264
provideInitializationHints();
266265
// resolve the new kernel info to account for kernel handlers
@@ -1233,7 +1232,10 @@ void Kernel::makeResident(CommandStreamReceiver &commandStreamReceiver) {
12331232
}
12341233

12351234
gtpinNotifyMakeResident(this, &commandStreamReceiver);
1236-
if (kernelHasIndirectAccess && unifiedMemoryControls.anyIndirectAllocationsAllowed()) {
1235+
1236+
if (unifiedMemoryControls.indirectDeviceAllocationsAllowed ||
1237+
unifiedMemoryControls.indirectHostAllocationsAllowed ||
1238+
unifiedMemoryControls.indirectSharedAllocationsAllowed) {
12371239
this->getContext().getSVMAllocsManager()->makeInternalAllocationsResident(commandStreamReceiver, unifiedMemoryControls.generateMask());
12381240
}
12391241
}

opencl/test/unit_test/kernel/kernel_tests.cpp

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,13 +1543,12 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenclSetKernelExecInfoWithUnifiedMemor
15431543
EXPECT_FALSE(mockKernel.mockKernel->unifiedMemoryControls.indirectSharedAllocationsAllowed);
15441544
}
15451545

1546-
HWTEST_F(KernelResidencyTest, givenKernelWithNoKernelArgLoadNorKernelArgStoreNorKernelArgAtomicNorHasIndirectStatelessAccessThenKernelHasIndirectAccessIsSetToFalse) {
1546+
HWTEST_F(KernelResidencyTest, givenKernelWithNoKernelArgLoadNorKernelArgStoreNorKernelArgAtomicThenKernelHasIndirectAccessIsSetToFalse) {
15471547
auto pKernelInfo = std::make_unique<KernelInfo>();
15481548
pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 1;
15491549
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgLoad = false;
15501550
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgStore = false;
15511551
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic = false;
1552-
pKernelInfo->hasIndirectStatelessAccess = false;
15531552

15541553
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
15551554
commandStreamReceiver.storeMakeResidentAllocations = true;
@@ -1575,7 +1574,6 @@ HWTEST_F(KernelResidencyTest, givenKernelWithNoKernelArgLoadThenKernelHasIndirec
15751574
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgLoad = true;
15761575
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgStore = false;
15771576
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic = false;
1578-
pKernelInfo->hasIndirectStatelessAccess = false;
15791577

15801578
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
15811579
commandStreamReceiver.storeMakeResidentAllocations = true;
@@ -1601,7 +1599,6 @@ HWTEST_F(KernelResidencyTest, givenKernelWithNoKernelArgStoreThenKernelHasIndire
16011599
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgLoad = false;
16021600
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgStore = true;
16031601
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic = false;
1604-
pKernelInfo->hasIndirectStatelessAccess = false;
16051602

16061603
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
16071604
commandStreamReceiver.storeMakeResidentAllocations = true;
@@ -1627,33 +1624,6 @@ HWTEST_F(KernelResidencyTest, givenKernelWithNoKernelArgAtomicThenKernelHasIndir
16271624
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgLoad = false;
16281625
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgStore = false;
16291626
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic = true;
1630-
pKernelInfo->hasIndirectStatelessAccess = false;
1631-
1632-
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
1633-
commandStreamReceiver.storeMakeResidentAllocations = true;
1634-
1635-
auto memoryManager = commandStreamReceiver.getMemoryManager();
1636-
pKernelInfo->kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize});
1637-
1638-
MockProgram program(toClDeviceVector(*pClDevice));
1639-
MockContext ctx;
1640-
program.setContext(&ctx);
1641-
program.buildInfos[pDevice->getRootDeviceIndex()].globalSurface = new MockGraphicsAllocation();
1642-
std::unique_ptr<MockKernel> pKernel(new MockKernel(&program, *pKernelInfo, *pClDevice));
1643-
ASSERT_EQ(CL_SUCCESS, pKernel->initialize());
1644-
1645-
EXPECT_TRUE(pKernel->getHasIndirectAccess());
1646-
1647-
memoryManager->freeGraphicsMemory(pKernelInfo->kernelAllocation);
1648-
}
1649-
1650-
HWTEST_F(KernelResidencyTest, givenKernelWithhasIndirectStatelessAccessThenKernelHasIndirectAccessIsSetToTrue) {
1651-
auto pKernelInfo = std::make_unique<KernelInfo>();
1652-
pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 1;
1653-
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgLoad = false;
1654-
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgStore = false;
1655-
pKernelInfo->kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic = false;
1656-
pKernelInfo->hasIndirectStatelessAccess = true;
16571627

16581628
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
16591629
commandStreamReceiver.storeMakeResidentAllocations = true;

shared/source/device_binary_format/zebin_decoder.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,6 @@ DecodeError readZeInfoExperimentalProperties(const NEO::Yaml::YamlParser &parser
317317
ConstStringRef context,
318318
std::string &outErrReason, std::string &outWarning) {
319319
bool validExperimentalProperty = true;
320-
outExperimentalProperties.hasNonKernelArgLoad = true;
321-
outExperimentalProperties.hasNonKernelArgStore = true;
322-
outExperimentalProperties.hasNonKernelArgAtomic = true;
323320
for (const auto &experimentalPropertyNd : parser.createChildrenRange(node)) {
324321
for (const auto &experimentalPropertyMemberNd : parser.createChildrenRange(experimentalPropertyNd)) {
325322
auto key = parser.readKey(experimentalPropertyMemberNd);

0 commit comments

Comments
 (0)