diff --git a/shared/source/device_binary_format/patchtokens_decoder.cpp b/shared/source/device_binary_format/patchtokens_decoder.cpp index d12ad328b5..84b7f300b1 100644 --- a/shared/source/device_binary_format/patchtokens_decoder.cpp +++ b/shared/source/device_binary_format/patchtokens_decoder.cpp @@ -317,6 +317,9 @@ inline bool decodeToken(const SPatchItemHeader *token, KernelFromPatchtokens &ou out.unhandledTokens.push_back(token); break; } + case PATCH_TOKEN_INTERFACE_DESCRIPTOR_DATA: + PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "Ignored kernel-scope Patch Token: %d\n", token->Token); + break; case PATCH_TOKEN_SAMPLER_STATE_ARRAY: assignToken(out.tokens.samplerStateArray, token); break; diff --git a/shared/test/unit_test/device_binary_format/patchtokens_decoder_tests.cpp b/shared/test/unit_test/device_binary_format/patchtokens_decoder_tests.cpp index 8f3163a64c..975a421f5d 100644 --- a/shared/test/unit_test/device_binary_format/patchtokens_decoder_tests.cpp +++ b/shared/test/unit_test/device_binary_format/patchtokens_decoder_tests.cpp @@ -7,6 +7,7 @@ #include "shared/source/device_binary_format/patchtokens_decoder.h" #include "shared/source/helpers/hash.h" +#include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/test_macros/test.h" #include "patchtokens_tests.h" @@ -1210,3 +1211,27 @@ TEST(ProgramDecoder, GivenProgramWithMultipleKernelsWhenFailsToDecodeKernelThenD EXPECT_EQ(2U, decodedProgram.header->NumberOfKernels); EXPECT_EQ(1U, decodedProgram.kernels.size()); } + +TEST(ProgramDecoder, givenPatchTokenInterfaceDescriptorDataWhenFlagPrintDebugMessagesAndDecodeTokenThenRightMessagePrinted) { + using namespace iOpenCL; + DebugManagerStateRestore debugManagerStateRestore; + DebugManager.flags.PrintDebugMessages.set(true); + + std::vector storage; + storage.reserve(512); + auto kernelToEncode = PatchTokensTestData::ValidEmptyKernel::create(storage); + + auto patchListOffset = ptrDiff(kernelToEncode.blobs.patchList.begin(), storage.data()); + pushBackToken(PATCH_TOKEN_INTERFACE_DESCRIPTOR_DATA, storage); + + auto kernelHeader = reinterpret_cast(storage.data()); + kernelHeader->PatchListSize = static_cast(storage.size() - patchListOffset); + NEO::PatchTokenBinary::KernelFromPatchtokens decodedKernel; + testing::internal::CaptureStderr(); + bool decodeSuccess = NEO::PatchTokenBinary::decodeKernelFromPatchtokensBlob(storage, decodedKernel); + + std::string output = testing::internal::GetCapturedStderr(); + EXPECT_TRUE(decodeSuccess); + EXPECT_EQ(NEO::DecodeError::Success, decodedKernel.decodeStatus); + EXPECT_EQ("Ignored kernel-scope Patch Token: 21\n", output); +} \ No newline at end of file