Skip to content

Commit ae05e05

Browse files
fix: remove not needed WA for printf buffer
Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent 3186e17 commit ae05e05

File tree

2 files changed

+0
-72
lines changed

2 files changed

+0
-72
lines changed

shared/source/device_binary_format/zebin/zeinfo_decoder.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ DecodeError decodeZeInfoFunctions(ProgramInfo &dst, Yaml::YamlParser &parser, co
523523

524524
DecodeError decodeZeInfoKernels(ProgramInfo &dst, Yaml::YamlParser &parser, const ZeInfoSections &zeInfoSections, std::string &outErrReason, std::string &outWarning, const Types::Version &srcZeInfoVersion) {
525525
if (zeInfoSections.kernels.size() > 0) {
526-
bool programHasConstStringSectionForPrintf = dst.globalStrings.size > 0;
527526

528527
for (const auto &kernelNd : parser.createChildrenRange(*zeInfoSections.kernels[0])) {
529528
auto kernelInfo = std::make_unique<KernelInfo>();
@@ -532,12 +531,6 @@ DecodeError decodeZeInfoKernels(ProgramInfo &dst, Yaml::YamlParser &parser, cons
532531
return zeInfoErr;
533532
}
534533

535-
if (dst.indirectAccessBufferMajorVersion == 2 &&
536-
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs &&
537-
programHasConstStringSectionForPrintf) {
538-
kernelInfo->kernelDescriptor.kernelAttributes.flags.usesPrintf = true;
539-
}
540-
541534
dst.kernelInfos.push_back(kernelInfo.release());
542535
}
543536
}

shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -6118,71 +6118,6 @@ class IntelGTNotesFixture : public ::testing::Test {
61186118
ZebinTestData::ValidEmptyProgram<> zebin;
61196119
};
61206120

6121-
TEST_F(IntelGTNotesFixture, GivenIabVersion2NoPrintfAttributeInZeInfoAndConstDataStringsSectionWhenDecodingBinaryThenKernelsWithIabRequiredHasFlagUsesPrintfSetToTrue) {
6122-
NEO::MockExecutionEnvironment mockExecutionEnvironment{};
6123-
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::GfxCoreHelper>();
6124-
std::string zeinfo = std::string("version :\'") + versionToString(Zebin::ZeInfo::zeInfoDecoderVersion) + R"===('
6125-
kernels:
6126-
- name : some_kernel
6127-
execution_env :
6128-
simd_size : 8
6129-
require_iab: true
6130-
- name : some_other_kernel
6131-
execution_env :
6132-
simd_size : 32
6133-
)===";
6134-
6135-
uint8_t kernelIsa[8]{0U};
6136-
ZebinTestData::ValidEmptyProgram zebin;
6137-
zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo);
6138-
zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef<const uint8_t>::fromAny(zeinfo.data(), zeinfo.size()));
6139-
zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {kernelIsa, sizeof(kernelIsa)});
6140-
zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_other_kernel", {kernelIsa, sizeof(kernelIsa)});
6141-
6142-
const uint8_t data[] = {'H', 'e', 'l', 'l', 'o', '!'};
6143-
zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::dataConstString, data);
6144-
6145-
const uint32_t indirectAccessBufferMajorVersion = 2u;
6146-
6147-
{
6148-
NEO::Elf::ElfNoteSection elfNoteSection;
6149-
6150-
elfNoteSection.type = Zebin::Elf::IntelGTSectionType::indirectAccessBufferMajorVersion;
6151-
elfNoteSection.descSize = sizeof(uint32_t);
6152-
elfNoteSection.nameSize = 8u;
6153-
6154-
std::vector<uint8_t *> descData;
6155-
uint8_t indirectAccessBufferData[4];
6156-
memcpy_s(indirectAccessBufferData, 4, &indirectAccessBufferMajorVersion, 4);
6157-
descData.push_back(indirectAccessBufferData);
6158-
6159-
const auto sectionDataSize = sizeof(NEO::Elf::ElfNoteSection) + elfNoteSection.nameSize + elfNoteSection.descSize;
6160-
6161-
auto noteIntelGTSectionData = std::make_unique<uint8_t[]>(sectionDataSize);
6162-
memcpy_s(noteIntelGTSectionData.get(), sizeof(NEO::Elf::ElfNoteSection), &elfNoteSection, sizeof(NEO::Elf::ElfNoteSection));
6163-
auto offset = sizeof(NEO::Elf::ElfNoteSection);
6164-
memcpy_s(reinterpret_cast<char *>(ptrOffset(noteIntelGTSectionData.get(), offset)), elfNoteSection.nameSize, Zebin::Elf::intelGTNoteOwnerName.str().c_str(), elfNoteSection.nameSize);
6165-
offset += elfNoteSection.nameSize;
6166-
memcpy_s(ptrOffset(noteIntelGTSectionData.get(), offset), elfNoteSection.descSize, descData[0], elfNoteSection.descSize);
6167-
zebin.appendSection(NEO::Elf::SHT_NOTE, Zebin::Elf::SectionNames::noteIntelGT, ArrayRef<uint8_t>::fromAny(noteIntelGTSectionData.get(), sectionDataSize));
6168-
}
6169-
6170-
NEO::ProgramInfo programInfo;
6171-
NEO::SingleDeviceBinary singleBinary;
6172-
singleBinary.deviceBinary = zebin.storage;
6173-
singleBinary.generatorFeatureVersions.indirectAccessBuffer = 2;
6174-
std::string errors;
6175-
std::string warnings;
6176-
auto error = NEO::decodeSingleDeviceBinary<NEO::DeviceBinaryFormat::zebin>(programInfo, singleBinary, errors, warnings, gfxCoreHelper);
6177-
EXPECT_EQ(NEO::DecodeError::success, error);
6178-
EXPECT_TRUE(warnings.empty()) << warnings;
6179-
EXPECT_TRUE(errors.empty()) << errors;
6180-
6181-
ASSERT_EQ(2u, programInfo.kernelInfos.size());
6182-
EXPECT_TRUE(programInfo.kernelInfos[0]->kernelDescriptor.kernelAttributes.flags.usesPrintf);
6183-
EXPECT_FALSE(programInfo.kernelInfos[1]->kernelDescriptor.kernelAttributes.flags.usesPrintf);
6184-
}
6185-
61866121
TEST_F(IntelGTNotesFixture, WhenGettingIntelGTNotesGivenValidIntelGTNotesSectionThenReturnsIntelGTNotes) {
61876122
std::vector<NEO::Elf::ElfNoteSection> elfNoteSections;
61886123
size_t numNotes = 5;

0 commit comments

Comments
 (0)