fix: Return Invalid Argument given the wrong module used in static link

Related-To: LOCI-4939

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
This commit is contained in:
Spruit, Neil R
2023-09-15 22:46:20 +00:00
committed by Compute-Runtime-Automation
parent 179abf00de
commit f901b26222
2 changed files with 2 additions and 2 deletions

View File

@@ -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 =

View File

@@ -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() {