mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
fix: remove not needed WA for printf buffer
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3186e17a2d
commit
ae05e0551e
@@ -523,7 +523,6 @@ DecodeError decodeZeInfoFunctions(ProgramInfo &dst, Yaml::YamlParser &parser, co
|
||||
|
||||
DecodeError decodeZeInfoKernels(ProgramInfo &dst, Yaml::YamlParser &parser, const ZeInfoSections &zeInfoSections, std::string &outErrReason, std::string &outWarning, const Types::Version &srcZeInfoVersion) {
|
||||
if (zeInfoSections.kernels.size() > 0) {
|
||||
bool programHasConstStringSectionForPrintf = dst.globalStrings.size > 0;
|
||||
|
||||
for (const auto &kernelNd : parser.createChildrenRange(*zeInfoSections.kernels[0])) {
|
||||
auto kernelInfo = std::make_unique<KernelInfo>();
|
||||
@@ -532,12 +531,6 @@ DecodeError decodeZeInfoKernels(ProgramInfo &dst, Yaml::YamlParser &parser, cons
|
||||
return zeInfoErr;
|
||||
}
|
||||
|
||||
if (dst.indirectAccessBufferMajorVersion == 2 &&
|
||||
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs &&
|
||||
programHasConstStringSectionForPrintf) {
|
||||
kernelInfo->kernelDescriptor.kernelAttributes.flags.usesPrintf = true;
|
||||
}
|
||||
|
||||
dst.kernelInfos.push_back(kernelInfo.release());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6118,71 +6118,6 @@ class IntelGTNotesFixture : public ::testing::Test {
|
||||
ZebinTestData::ValidEmptyProgram<> zebin;
|
||||
};
|
||||
|
||||
TEST_F(IntelGTNotesFixture, GivenIabVersion2NoPrintfAttributeInZeInfoAndConstDataStringsSectionWhenDecodingBinaryThenKernelsWithIabRequiredHasFlagUsesPrintfSetToTrue) {
|
||||
NEO::MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::GfxCoreHelper>();
|
||||
std::string zeinfo = std::string("version :\'") + versionToString(Zebin::ZeInfo::zeInfoDecoderVersion) + R"===('
|
||||
kernels:
|
||||
- name : some_kernel
|
||||
execution_env :
|
||||
simd_size : 8
|
||||
require_iab: true
|
||||
- name : some_other_kernel
|
||||
execution_env :
|
||||
simd_size : 32
|
||||
)===";
|
||||
|
||||
uint8_t kernelIsa[8]{0U};
|
||||
ZebinTestData::ValidEmptyProgram zebin;
|
||||
zebin.removeSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo);
|
||||
zebin.appendSection(NEO::Zebin::Elf::SectionHeaderTypeZebin::SHT_ZEBIN_ZEINFO, NEO::Zebin::Elf::SectionNames::zeInfo, ArrayRef<const uint8_t>::fromAny(zeinfo.data(), zeinfo.size()));
|
||||
zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_kernel", {kernelIsa, sizeof(kernelIsa)});
|
||||
zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::textPrefix.str() + "some_other_kernel", {kernelIsa, sizeof(kernelIsa)});
|
||||
|
||||
const uint8_t data[] = {'H', 'e', 'l', 'l', 'o', '!'};
|
||||
zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Zebin::Elf::SectionNames::dataConstString, data);
|
||||
|
||||
const uint32_t indirectAccessBufferMajorVersion = 2u;
|
||||
|
||||
{
|
||||
NEO::Elf::ElfNoteSection elfNoteSection;
|
||||
|
||||
elfNoteSection.type = Zebin::Elf::IntelGTSectionType::indirectAccessBufferMajorVersion;
|
||||
elfNoteSection.descSize = sizeof(uint32_t);
|
||||
elfNoteSection.nameSize = 8u;
|
||||
|
||||
std::vector<uint8_t *> descData;
|
||||
uint8_t indirectAccessBufferData[4];
|
||||
memcpy_s(indirectAccessBufferData, 4, &indirectAccessBufferMajorVersion, 4);
|
||||
descData.push_back(indirectAccessBufferData);
|
||||
|
||||
const auto sectionDataSize = sizeof(NEO::Elf::ElfNoteSection) + elfNoteSection.nameSize + elfNoteSection.descSize;
|
||||
|
||||
auto noteIntelGTSectionData = std::make_unique<uint8_t[]>(sectionDataSize);
|
||||
memcpy_s(noteIntelGTSectionData.get(), sizeof(NEO::Elf::ElfNoteSection), &elfNoteSection, sizeof(NEO::Elf::ElfNoteSection));
|
||||
auto offset = sizeof(NEO::Elf::ElfNoteSection);
|
||||
memcpy_s(reinterpret_cast<char *>(ptrOffset(noteIntelGTSectionData.get(), offset)), elfNoteSection.nameSize, Zebin::Elf::intelGTNoteOwnerName.str().c_str(), elfNoteSection.nameSize);
|
||||
offset += elfNoteSection.nameSize;
|
||||
memcpy_s(ptrOffset(noteIntelGTSectionData.get(), offset), elfNoteSection.descSize, descData[0], elfNoteSection.descSize);
|
||||
zebin.appendSection(NEO::Elf::SHT_NOTE, Zebin::Elf::SectionNames::noteIntelGT, ArrayRef<uint8_t>::fromAny(noteIntelGTSectionData.get(), sectionDataSize));
|
||||
}
|
||||
|
||||
NEO::ProgramInfo programInfo;
|
||||
NEO::SingleDeviceBinary singleBinary;
|
||||
singleBinary.deviceBinary = zebin.storage;
|
||||
singleBinary.generatorFeatureVersions.indirectAccessBuffer = 2;
|
||||
std::string errors;
|
||||
std::string warnings;
|
||||
auto error = NEO::decodeSingleDeviceBinary<NEO::DeviceBinaryFormat::zebin>(programInfo, singleBinary, errors, warnings, gfxCoreHelper);
|
||||
EXPECT_EQ(NEO::DecodeError::success, error);
|
||||
EXPECT_TRUE(warnings.empty()) << warnings;
|
||||
EXPECT_TRUE(errors.empty()) << errors;
|
||||
|
||||
ASSERT_EQ(2u, programInfo.kernelInfos.size());
|
||||
EXPECT_TRUE(programInfo.kernelInfos[0]->kernelDescriptor.kernelAttributes.flags.usesPrintf);
|
||||
EXPECT_FALSE(programInfo.kernelInfos[1]->kernelDescriptor.kernelAttributes.flags.usesPrintf);
|
||||
}
|
||||
|
||||
TEST_F(IntelGTNotesFixture, WhenGettingIntelGTNotesGivenValidIntelGTNotesSectionThenReturnsIntelGTNotes) {
|
||||
std::vector<NEO::Elf::ElfNoteSection> elfNoteSections;
|
||||
size_t numNotes = 5;
|
||||
|
||||
Reference in New Issue
Block a user