From 79cdf69efe62a359cb098037b950998fe1f6141b Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Thu, 25 Sep 2025 02:39:51 +0200 Subject: [PATCH] Revert "fix: disable support for deprecated patchtokens format" This reverts commit 506d5837dfaac64fe0c70e71960ca95c6c441ce7. Signed-off-by: Compute-Runtime-Validation --- .../unit_test/api/cl_build_program_tests.inl | 4 ++-- .../unit_test/program/program_data_tests.cpp | 18 +++++++++--------- .../test/unit_test/program/program_tests.cpp | 6 +++--- .../device_binary_formats.h | 3 +-- .../device_binary_formats_tests.cpp | 6 +++--- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/opencl/test/unit_test/api/cl_build_program_tests.inl b/opencl/test/unit_test/api/cl_build_program_tests.inl index 9d959399a5..a9e22a4e93 100644 --- a/opencl/test/unit_test/api/cl_build_program_tests.inl +++ b/opencl/test/unit_test/api/cl_build_program_tests.inl @@ -242,7 +242,7 @@ TEST_F(ClBuildProgramTests, GivenProgramCreatedFromBinaryWhenBuildProgramWithOpt EXPECT_EQ(CL_SUCCESS, retVal); } -TEST_F(ClBuildProgramTests, GivenSpirAsInputWhenCreatingProgramFromBinaryThenProgramBuildFails) { +TEST_F(ClBuildProgramTests, GivenSpirAsInputWhenCreatingProgramFromBinaryThenProgramBuildSucceeds) { cl_program pProgram = nullptr; cl_int binaryStatus = CL_SUCCESS; unsigned char llvm[16] = "BC\xc0\xde_unique"; @@ -280,7 +280,7 @@ TEST_F(ClBuildProgramTests, GivenSpirAsInputWhenCreatingProgramFromBinaryThenPro nullptr); setIgcDebugVars(prevDebugVars); - EXPECT_EQ(CL_INVALID_BINARY, retVal); + EXPECT_EQ(CL_SUCCESS, retVal); retVal = clReleaseProgram(pProgram); EXPECT_EQ(CL_SUCCESS, retVal); diff --git a/opencl/test/unit_test/program/program_data_tests.cpp b/opencl/test/unit_test/program/program_data_tests.cpp index 18fd44a794..097b8022ac 100644 --- a/opencl/test/unit_test/program/program_data_tests.cpp +++ b/opencl/test/unit_test/program/program_data_tests.cpp @@ -179,11 +179,11 @@ void ProgramDataTestBase::buildAndDecodeProgramPatchList() { using ProgramDataTest = ProgramDataTestBase; -TEST_F(ProgramDataTest, DISABLED_GivenEmptyProgramBinaryHeaderWhenBuildingAndDecodingThenSuccessIsReturned) { +TEST_F(ProgramDataTest, GivenEmptyProgramBinaryHeaderWhenBuildingAndDecodingThenSuccessIsReturned) { buildAndDecodeProgramPatchList(); } -TEST_F(ProgramDataTest, DISABLED_WhenAllocatingConstantMemorySurfaceThenUnderlyingBufferIsSetCorrectly) { +TEST_F(ProgramDataTest, WhenAllocatingConstantMemorySurfaceThenUnderlyingBufferIsSetCorrectly) { auto constSize = setupConstantAllocation(); @@ -195,7 +195,7 @@ TEST_F(ProgramDataTest, DISABLED_WhenAllocatingConstantMemorySurfaceThenUnderlyi EXPECT_EQ(0, memcmp(constValue, surface->getUnderlyingBuffer(), constSize)); } -TEST_F(ProgramDataTest, DISABLED_givenProgramWhenAllocatingConstantMemorySurfaceThenProperDeviceBitfieldIsPassed) { +TEST_F(ProgramDataTest, givenProgramWhenAllocatingConstantMemorySurfaceThenProperDeviceBitfieldIsPassed) { auto executionEnvironment = pClDevice->getExecutionEnvironment(); auto memoryManager = new MockMemoryManager(*executionEnvironment); @@ -497,7 +497,7 @@ TEST_F(ProgramDataBindlessTest, givenBindlessKernelAndGlobalVariablesMemorySurfa EXPECT_EQ(nullptr, ssInHeap.heapAllocation); } -TEST_F(ProgramDataTest, DISABLED_givenConstantAllocationThatIsInUseByGpuWhenProgramIsBeingDestroyedThenItIsAddedToTemporaryAllocationList) { +TEST_F(ProgramDataTest, givenConstantAllocationThatIsInUseByGpuWhenProgramIsBeingDestroyedThenItIsAddedToTemporaryAllocationList) { setupConstantAllocation(); @@ -517,7 +517,7 @@ TEST_F(ProgramDataTest, DISABLED_givenConstantAllocationThatIsInUseByGpuWhenProg EXPECT_EQ(constantSurface, csr.getDeferredAllocations().peekHead()); } -TEST_F(ProgramDataTest, DISABLED_givenGlobalAllocationThatIsInUseByGpuWhenProgramIsBeingDestroyedThenItIsAddedToTemporaryAllocationList) { +TEST_F(ProgramDataTest, givenGlobalAllocationThatIsInUseByGpuWhenProgramIsBeingDestroyedThenItIsAddedToTemporaryAllocationList) { setupGlobalAllocation(); buildAndDecodeProgramPatchList(); @@ -536,7 +536,7 @@ TEST_F(ProgramDataTest, DISABLED_givenGlobalAllocationThatIsInUseByGpuWhenProgra EXPECT_EQ(globalSurface, csr.getDeferredAllocations().peekHead()); } -TEST_F(ProgramDataTest, DISABLED_GivenDeviceForcing32BitMessagesWhenConstAllocationIsPresentInProgramBinariesThen32BitStorageIsAllocated) { +TEST_F(ProgramDataTest, GivenDeviceForcing32BitMessagesWhenConstAllocationIsPresentInProgramBinariesThen32BitStorageIsAllocated) { auto constSize = setupConstantAllocation(); this->pContext->getDevice(0)->getMemoryManager()->setForce32BitAllocations(true); @@ -552,7 +552,7 @@ TEST_F(ProgramDataTest, DISABLED_GivenDeviceForcing32BitMessagesWhenConstAllocat } } -TEST_F(ProgramDataTest, DISABLED_WhenAllocatingGlobalMemorySurfaceThenUnderlyingBufferIsSetCorrectly) { +TEST_F(ProgramDataTest, WhenAllocatingGlobalMemorySurfaceThenUnderlyingBufferIsSetCorrectly) { auto globalSize = setupGlobalAllocation(); buildAndDecodeProgramPatchList(); auto surface = pProgram->getGlobalSurface(pContext->getDevice(0)->getRootDeviceIndex()); @@ -561,7 +561,7 @@ TEST_F(ProgramDataTest, DISABLED_WhenAllocatingGlobalMemorySurfaceThenUnderlying EXPECT_EQ(0, memcmp(globalValue, surface->getUnderlyingBuffer(), globalSize)); } -TEST_F(ProgramDataTest, DISABLED_givenProgramWhenAllocatingGlobalMemorySurfaceThenProperDeviceBitfieldIsPassed) { +TEST_F(ProgramDataTest, givenProgramWhenAllocatingGlobalMemorySurfaceThenProperDeviceBitfieldIsPassed) { auto executionEnvironment = pClDevice->getExecutionEnvironment(); auto memoryManager = new MockMemoryManager(*executionEnvironment); @@ -577,7 +577,7 @@ TEST_F(ProgramDataTest, DISABLED_givenProgramWhenAllocatingGlobalMemorySurfaceTh std::swap(memoryManagerBackup, executionEnvironment->memoryManager); } -TEST_F(ProgramDataTest, DISABLED_Given32BitDeviceWhenGlobalMemorySurfaceIsPresentThenItHas32BitStorage) { +TEST_F(ProgramDataTest, Given32BitDeviceWhenGlobalMemorySurfaceIsPresentThenItHas32BitStorage) { char globalValue[] = "55667788"; size_t globalSize = strlen(globalValue) + 1; this->pContext->getDevice(0)->getMemoryManager()->setForce32BitAllocations(true); diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index 38b554f799..e315f45746 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -2096,7 +2096,7 @@ TEST_F(ProgramTests, whenCreatingFromZebinThenDontAppendEnableZebinFlagToBuildOp EXPECT_STREQ(expectedOptions, program->options.c_str()); } -TEST_F(ProgramTests, DISABLED_givenProgramFromGenBinaryWhenSLMSizeIsBiggerThenDeviceLimitThenPrintDebugMsgAndReturnError) { +TEST_F(ProgramTests, givenProgramFromGenBinaryWhenSLMSizeIsBiggerThenDeviceLimitThenPrintDebugMsgAndReturnError) { DebugManagerStateRestore dbgRestorer; debugManager.flags.PrintDebugMessages.set(true); @@ -2121,7 +2121,7 @@ TEST_F(ProgramTests, DISABLED_givenProgramFromGenBinaryWhenSLMSizeIsBiggerThenDe EXPECT_EQ(expectedOutput, output); } -TEST_F(ProgramTests, DISABLED_givenExistingConstantSurfacesWhenProcessGenBinaryThenCleanupTheSurfaceOnlyForSpecificDevice) { +TEST_F(ProgramTests, givenExistingConstantSurfacesWhenProcessGenBinaryThenCleanupTheSurfaceOnlyForSpecificDevice) { PatchTokensTestData::ValidProgramWithKernelUsingSlm patchtokensProgram; auto program = std::make_unique(nullptr, false, toClDeviceVector(*pClDevice)); @@ -2149,7 +2149,7 @@ TEST_F(ProgramTests, DISABLED_givenExistingConstantSurfacesWhenProcessGenBinaryT EXPECT_EQ(CL_SUCCESS, retVal); } -TEST_F(ProgramTests, DISABLED_givenExistingGlobalSurfacesWhenProcessGenBinaryThenCleanupTheSurfaceOnlyForSpecificDevice) { +TEST_F(ProgramTests, givenExistingGlobalSurfacesWhenProcessGenBinaryThenCleanupTheSurfaceOnlyForSpecificDevice) { PatchTokensTestData::ValidProgramWithKernelUsingSlm patchtokensProgram; auto program = std::make_unique(nullptr, false, toClDeviceVector(*pClDevice)); diff --git a/shared/source/device_binary_format/device_binary_formats.h b/shared/source/device_binary_format/device_binary_formats.h index c5547e09d7..7ee4f4aac8 100644 --- a/shared/source/device_binary_format/device_binary_formats.h +++ b/shared/source/device_binary_format/device_binary_formats.h @@ -198,8 +198,7 @@ inline std::pair decodeSingleDeviceBinary(Progr ret.first = decodeSingleDeviceBinary(dst, src, outErrReason, outWarning, gfxCoreHelper); } else if (isDeviceBinaryFormat(src.deviceBinary)) { ret.second = DeviceBinaryFormat::patchtokens; - ret.first = DecodeError::invalidBinary; - outErrReason = "Deprecated format - patchtokens"; + ret.first = decodeSingleDeviceBinary(dst, src, outErrReason, outWarning, gfxCoreHelper); } else if (isDeviceBinaryFormat(src.deviceBinary)) { ret.second = DeviceBinaryFormat::archive; ret.first = decodeSingleDeviceBinary(dst, src, outErrReason, outWarning, gfxCoreHelper); diff --git a/shared/test/unit_test/device_binary_format/device_binary_formats_tests.cpp b/shared/test/unit_test/device_binary_format/device_binary_formats_tests.cpp index 8684e610bf..5cede960bd 100644 --- a/shared/test/unit_test/device_binary_format/device_binary_formats_tests.cpp +++ b/shared/test/unit_test/device_binary_format/device_binary_formats_tests.cpp @@ -289,7 +289,7 @@ TEST(DecodeSingleDeviceBinary, GivenUnknownFormatThenReturnFalse) { EXPECT_STREQ("Unknown format", decodeErrors.c_str()); } -TEST(DecodeSingleDeviceBinary, GivenPatchTokensFormatThenDecodingFails) { +TEST(DecodeSingleDeviceBinary, GivenPatchTokensFormatThenDecodingSucceeds) { NEO::MockExecutionEnvironment mockExecutionEnvironment{}; auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); PatchTokensTestData::ValidEmptyProgram patchtokensProgram; @@ -302,10 +302,10 @@ TEST(DecodeSingleDeviceBinary, GivenPatchTokensFormatThenDecodingFails) { NEO::DecodeError status; NEO::DeviceBinaryFormat format; std::tie(status, format) = NEO::decodeSingleDeviceBinary(programInfo, bin, decodeErrors, decodeWarnings, gfxCoreHelper); - EXPECT_EQ(NEO::DecodeError::invalidBinary, status); + EXPECT_EQ(NEO::DecodeError::success, status); EXPECT_EQ(NEO::DeviceBinaryFormat::patchtokens, format); EXPECT_TRUE(decodeWarnings.empty()); - EXPECT_STREQ("Deprecated format - patchtokens", decodeErrors.c_str()); + EXPECT_TRUE(decodeErrors.empty()); } TEST(DecodeSingleDeviceBinary, GivenZebinFormatThenDecodingSucceeds) {