From 914a1f980f423f3bd2b40b912f637be06ca195b3 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Tue, 21 Nov 2023 11:01:52 +0000 Subject: [PATCH] fix: don't return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE from linking module https://github.com/intel/compute-runtime/issues/692 Signed-off-by: Mateusz Jablonski --- level_zero/core/source/module/module_imp.cpp | 3 +-- level_zero/core/test/unit_tests/sources/module/test_module.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index dd8769f3bd..0f6985936f 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -1421,12 +1421,11 @@ ze_result_t ModuleImp::performDynamicLink(uint32_t numModules, } } if (numPatchedSymbols != moduleId->unresolvedExternalsInfo.size()) { + driverHandle->clearErrorDescription(); if (functionSymbolExportEnabledCounter == 0) { driverHandle->setErrorDescription("Dynamic Link Not Supported Without Compiler flag %s\n", BuildOptions::enableLibraryCompile.str().c_str()); PRINT_DEBUG_STRING(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Dynamic Link Not Supported Without Compiler flag %s\n", BuildOptions::enableLibraryCompile.str().c_str()); - return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; } - driverHandle->clearErrorDescription(); return ZE_RESULT_ERROR_MODULE_LINK_FAILURE; } moduleId->copyPatchedSegments(isaSegmentsForPatching); diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index 7694911ef3..463ef8510c 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -2042,7 +2042,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolsNotPresentInAnoth std::string emptyString = ""; zeDriverGetLastErrorDescription(device->getDriverHandle(), &pStr); EXPECT_NE(0, strcmp(pStr, emptyString.c_str())); - EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, res); + EXPECT_EQ(ZE_RESULT_ERROR_MODULE_LINK_FAILURE, res); size_t buildLogSize; zeModuleBuildLogGetString(dynLinkLog, &buildLogSize, nullptr); EXPECT_GT(static_cast(buildLogSize), 0);