From f901b26222f3cefc163f30f2aca00ae97f4aa2ad Mon Sep 17 00:00:00 2001 From: "Spruit, Neil R" Date: Fri, 15 Sep 2023 22:46:20 +0000 Subject: [PATCH] fix: Return Invalid Argument given the wrong module used in static link Related-To: LOCI-4939 Signed-off-by: Spruit, Neil R --- level_zero/core/source/module/module_imp.cpp | 2 +- level_zero/core/test/unit_tests/sources/module/test_module.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index 90fef9a9dd..92e37d4778 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -585,7 +585,7 @@ inline ze_result_t ModuleImp::initializeTranslationUnit(const ze_module_desc_t * return ZE_RESULT_ERROR_INVALID_ARGUMENT; } if (desc->format != ZE_MODULE_FORMAT_IL_SPIRV) { - return ZE_RESULT_ERROR_INVALID_ENUMERATION; + return ZE_RESULT_ERROR_INVALID_ARGUMENT; } this->builtFromSPIRv = true; const ze_module_program_exp_desc_t *programExpDesc = 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 5c7b012024..13fb1e4c52 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 @@ -923,7 +923,7 @@ struct ModuleStaticLinkFixture : public DeviceFixture { module->translationUnit.reset(mockTranslationUnit); ze_result_t result = ZE_RESULT_SUCCESS; result = module->initialize(&combinedModuleDesc, neoDevice); - EXPECT_EQ(result, ZE_RESULT_ERROR_INVALID_ENUMERATION); + EXPECT_EQ(result, ZE_RESULT_ERROR_INVALID_ARGUMENT); module->destroy(); } void runExpDescFailureTest() {