Skip to content

Commit f9888db

Browse files
Revert "Check indirect access from igc"
This reverts commit e14c91f. Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
1 parent aadf424 commit f9888db

File tree

8 files changed

+13
-24
lines changed

8 files changed

+13
-24
lines changed

level_zero/core/source/kernel/kernel_imp.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ KernelImp::~KernelImp() {
238238
alignedFree(perThreadDataForWholeThreadGroup);
239239
}
240240
if (printfBuffer != nullptr) {
241-
// not allowed to call virtual function on destructor, so calling printOutput directly
241+
//not allowed to call virtual function on destructor, so calling printOutput directly
242242
PrintfHandler::printOutput(kernelImmData, this->printfBuffer, module->getDevice());
243243
module->getDevice()->getNEODevice()->getMemoryManager()->freeGraphicsMemory(printfBuffer);
244244
}
@@ -901,8 +901,7 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
901901

902902
kernelHasIndirectAccess = kernelDescriptor.kernelAttributes.hasNonKernelArgLoad ||
903903
kernelDescriptor.kernelAttributes.hasNonKernelArgStore ||
904-
kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic ||
905-
getImmutableData()->getKernelInfo()->hasIndirectStatelessAccess;
904+
kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic;
906905

907906
if (this->usesRayTracing()) {
908907
if (this->getImmutableData()->getDescriptor().payloadMappings.implicitArgs.rtDispatchGlobals.pointerSize > 0) {
@@ -1029,9 +1028,9 @@ Kernel *Kernel::create(uint32_t productFamily, Module *module,
10291028
}
10301029

10311030
bool KernelImp::hasIndirectAllocationsAllowed() const {
1032-
return this->kernelHasIndirectAccess && (unifiedMemoryControls.indirectDeviceAllocationsAllowed ||
1033-
unifiedMemoryControls.indirectHostAllocationsAllowed ||
1034-
unifiedMemoryControls.indirectSharedAllocationsAllowed);
1031+
return (unifiedMemoryControls.indirectDeviceAllocationsAllowed ||
1032+
unifiedMemoryControls.indirectHostAllocationsAllowed ||
1033+
unifiedMemoryControls.indirectSharedAllocationsAllowed);
10351034
}
10361035

10371036
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
@@ -148,7 +148,7 @@ struct KernelImp : Kernel {
148148

149149
ze_result_t getProfileInfo(zet_profile_properties_t *pProfileProperties) override;
150150

151-
bool hasIndirectAccess() const {
151+
bool hasIndirectAccess() {
152152
return kernelHasIndirectAccess;
153153
}
154154

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

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

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ using CommandListAppendLaunchKernel = Test<ModuleFixture>;
2929

3030
HWTEST_F(CommandListAppendLaunchKernel, givenKernelWithIndirectAllocationsAllowedThenCommandListReturnsExpectedIndirectAllocationsAllowed) {
3131
createKernel();
32-
kernel->kernelHasIndirectAccess = true;
3332
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
3433
kernel->unifiedMemoryControls.indirectSharedAllocationsAllowed = true;
3534
kernel->unifiedMemoryControls.indirectHostAllocationsAllowed = true;

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ HWTEST_F(CommandQueueIndirectAllocations, givenCommandQueueWhenExecutingCommandL
378378
ASSERT_NE(nullptr, gpuAlloc);
379379

380380
createKernel();
381-
kernel->kernelHasIndirectAccess = true;
382381
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
383382
EXPECT_TRUE(kernel->getUnifiedMemoryControls().indirectDeviceAllocationsAllowed);
384383

@@ -443,7 +442,6 @@ HWTEST_F(CommandQueueIndirectAllocations, givenDebugModeToTreatIndirectAllocatio
443442
ASSERT_NE(nullptr, gpuAlloc);
444443

445444
createKernel();
446-
kernel->kernelHasIndirectAccess = true;
447445
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
448446
EXPECT_TRUE(kernel->getUnifiedMemoryControls().indirectDeviceAllocationsAllowed);
449447

@@ -507,7 +505,6 @@ HWTEST_F(CommandQueueIndirectAllocations, givenDeviceThatSupportsSubmittingIndir
507505
ASSERT_NE(nullptr, gpuAlloc);
508506

509507
createKernel();
510-
kernel->kernelHasIndirectAccess = true;
511508
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
512509
EXPECT_TRUE(kernel->getUnifiedMemoryControls().indirectDeviceAllocationsAllowed);
513510

@@ -572,7 +569,6 @@ HWTEST_F(CommandQueueIndirectAllocations, givenDeviceThatSupportsSubmittingIndir
572569
ASSERT_NE(nullptr, gpuAlloc);
573570

574571
createKernel();
575-
kernel->kernelHasIndirectAccess = true;
576572
kernel->unifiedMemoryControls.indirectDeviceAllocationsAllowed = true;
577573
EXPECT_TRUE(kernel->getUnifiedMemoryControls().indirectDeviceAllocationsAllowed);
578574

opencl/source/kernel/kernel.cpp

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

259259
this->kernelHasIndirectAccess |= kernelInfo.kernelDescriptor.kernelAttributes.hasNonKernelArgLoad ||
260260
kernelInfo.kernelDescriptor.kernelAttributes.hasNonKernelArgStore ||
261-
kernelInfo.kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic ||
262-
kernelInfo.hasIndirectStatelessAccess;
261+
kernelInfo.kernelDescriptor.kernelAttributes.hasNonKernelArgAtomic;
263262

264263
provideInitializationHints();
265264
// resolve the new kernel info to account for kernel handlers
@@ -1252,9 +1251,9 @@ void Kernel::makeResident(CommandStreamReceiver &commandStreamReceiver) {
12521251

12531252
gtpinNotifyMakeResident(this, &commandStreamReceiver);
12541253

1255-
if (this->kernelHasIndirectAccess && (unifiedMemoryControls.indirectDeviceAllocationsAllowed ||
1256-
unifiedMemoryControls.indirectHostAllocationsAllowed ||
1257-
unifiedMemoryControls.indirectSharedAllocationsAllowed)) {
1254+
if (unifiedMemoryControls.indirectDeviceAllocationsAllowed ||
1255+
unifiedMemoryControls.indirectHostAllocationsAllowed ||
1256+
unifiedMemoryControls.indirectSharedAllocationsAllowed) {
12581257
this->getContext().getSVMAllocsManager()->makeInternalAllocationsResident(commandStreamReceiver, unifiedMemoryControls.generateMask());
12591258
}
12601259
}

shared/source/device_binary_format/zebin_decoder.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,6 @@ DecodeError readZeInfoExperimentalProperties(const NEO::Yaml::YamlParser &parser
326326
ConstStringRef context,
327327
std::string &outErrReason, std::string &outWarning) {
328328
bool validExperimentalProperty = true;
329-
outExperimentalProperties.hasNonKernelArgLoad = true;
330-
outExperimentalProperties.hasNonKernelArgStore = true;
331-
outExperimentalProperties.hasNonKernelArgAtomic = true;
332329
for (const auto &experimentalPropertyNd : parser.createChildrenRange(node)) {
333330
for (const auto &experimentalPropertyMemberNd : parser.createChildrenRange(experimentalPropertyNd)) {
334331
auto key = parser.readKey(experimentalPropertyMemberNd);

shared/source/kernel/kernel_descriptor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ struct KernelDescriptor {
151151
uint16_t numArgsToPatch = 0U;
152152
uint16_t numGrfRequired = 0U;
153153
uint8_t barrierCount = 0u;
154-
bool hasNonKernelArgLoad = false;
155-
bool hasNonKernelArgStore = false;
156-
bool hasNonKernelArgAtomic = false;
154+
bool hasNonKernelArgLoad = true;
155+
bool hasNonKernelArgStore = true;
156+
bool hasNonKernelArgAtomic = true;
157157

158158
AddressingMode bufferAddressingMode = BindfulAndStateless;
159159
AddressingMode imageAddressingMode = Bindful;

0 commit comments

Comments
 (0)