From 106d1bb4861ba8ea9e21fa2b8274c1ac85b41881 Mon Sep 17 00:00:00 2001 From: Jaroslaw Warchulski Date: Tue, 9 Dec 2025 16:00:52 +0000 Subject: [PATCH] refactor: cleanup includes Signed-off-by: Jaroslaw Warchulski --- level_zero/core/source/module/module_imp.cpp | 7 +- level_zero/core/source/module/module_imp.h | 5 +- .../core/test/unit_tests/mocks/mock_module.h | 48 +++++----- .../unit_tests/sources/module/test_module.cpp | 12 +-- opencl/source/kernel/kernel.cpp | 2 - opencl/source/program/program.cpp | 3 +- opencl/source/program/program.h | 19 ++-- .../cl_compiler_interface_tests.cpp | 4 +- .../test/unit_test/program/program_tests.cpp | 8 +- shared/source/built_ins/built_ins.cpp | 2 +- .../source/compiler_interface/CMakeLists.txt | 4 +- .../compiler_interface/compiler_interface.cpp | 74 +++++++-------- .../compiler_interface/compiler_interface.h | 37 ++++---- .../spec_const_values_map.h | 17 ++++ .../translation_error_code.h | 23 +++++ .../common/mocks/mock_compiler_interface.h | 18 ++-- .../mocks/mock_compiler_interface_spirv.cpp | 8 +- .../mocks/mock_compiler_interface_spirv.h | 6 +- shared/test/common/mocks/mock_compilers.h | 17 +++- shared/test/unit_test/built_ins/sip_tests.cpp | 4 +- .../compiler_cache_tests.cpp | 32 +++---- .../compiler_interface_tests.cpp | 92 +++++++++---------- 22 files changed, 249 insertions(+), 193 deletions(-) create mode 100644 shared/source/compiler_interface/spec_const_values_map.h create mode 100644 shared/source/compiler_interface/translation_error_code.h diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index f53f2af796..a91a4606da 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -8,6 +8,7 @@ #include "level_zero/core/source/module/module_imp.h" #include "shared/source/command_stream/command_stream_receiver.h" +#include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/compiler_interface/compiler_options.h" #include "shared/source/compiler_interface/compiler_options_extra.h" #include "shared/source/compiler_interface/compiler_warnings/compiler_warnings.h" @@ -198,7 +199,7 @@ bool ModuleTranslationUnit::processSpecConstantInfo(NEO::CompilerInterface *comp if (pConstants) { NEO::SpecConstantInfo specConstInfo; auto retVal = compilerInterface->getSpecConstantsInfo(*device->getNEODevice(), ArrayRef(input, inputSize), specConstInfo); - if (retVal != NEO::TranslationOutput::ErrorCode::success) { + if (retVal != NEO::TranslationErrorCode::success) { return false; } for (uint32_t i = 0; i < pConstants->numConstants; i++) { @@ -234,7 +235,7 @@ ze_result_t ModuleTranslationUnit::compileGenBinary(NEO::TranslationInput &input inputArgs.specializedValues = this->specConstantsValues; NEO::TranslationOutput compilerOuput = {}; - NEO::TranslationOutput::ErrorCode compilerErr; + NEO::TranslationErrorCode compilerErr; if (staticLink) { compilerErr = compilerInterface->link(*device->getNEODevice(), inputArgs, compilerOuput); @@ -245,7 +246,7 @@ ze_result_t ModuleTranslationUnit::compileGenBinary(NEO::TranslationInput &input this->updateBuildLog(compilerOuput.frontendCompilerLog); this->updateBuildLog(compilerOuput.backendCompilerLog); - if (NEO::TranslationOutput::ErrorCode::success != compilerErr) { + if (NEO::TranslationErrorCode::success != compilerErr) { driverHandle->clearErrorDescription(); return ZE_RESULT_ERROR_MODULE_BUILD_FAILURE; } diff --git a/level_zero/core/source/module/module_imp.h b/level_zero/core/source/module/module_imp.h index 4aabb5ccc0..e7f8be233c 100644 --- a/level_zero/core/source/module/module_imp.h +++ b/level_zero/core/source/module/module_imp.h @@ -7,14 +7,15 @@ #pragma once -#include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/compiler_interface/linker.h" +#include "shared/source/compiler_interface/spec_const_values_map.h" #include "shared/source/program/program_info.h" #include "level_zero/core/source/kernel/kernel.h" #include "level_zero/core/source/module/module.h" #include "neo_igfxfmid.h" +#include "ocl_igc_interface/code_type.h" #include #include @@ -23,8 +24,10 @@ namespace NEO { struct KernelDescriptor; struct MetadataGeneration; +struct TranslationInput; class SharedPoolAllocation; class Device; +class CompilerInterface; namespace Zebin::Debug { struct Segments; diff --git a/level_zero/core/test/unit_tests/mocks/mock_module.h b/level_zero/core/test/unit_tests/mocks/mock_module.h index 92cacd73b2..bd3f00817e 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_module.h +++ b/level_zero/core/test/unit_tests/mocks/mock_module.h @@ -157,9 +157,9 @@ struct MockModule : public L0::ModuleImp { }; struct MockCompilerInterface : public NEO::CompilerInterface { - NEO::TranslationOutput::ErrorCode build(const NEO::Device &device, - const NEO::TranslationInput &input, - NEO::TranslationOutput &output) override { + NEO::TranslationErrorCode build(const NEO::Device &device, + const NEO::TranslationInput &input, + NEO::TranslationOutput &output) override { receivedApiOptions = input.apiOptions.begin(); inputInternalOptions = input.internalOptions.begin(); @@ -167,18 +167,18 @@ struct MockCompilerInterface : public NEO::CompilerInterface { cachingPassed = input.allowCaching; if (failBuild) { - return NEO::TranslationOutput::ErrorCode::buildFailure; + return NEO::TranslationErrorCode::buildFailure; } - return NEO::TranslationOutput::ErrorCode::success; + return NEO::TranslationErrorCode::success; } - NEO::TranslationOutput::ErrorCode link(const NEO::Device &device, - const NEO::TranslationInput &input, - NEO::TranslationOutput &output) override { + NEO::TranslationErrorCode link(const NEO::Device &device, + const NEO::TranslationInput &input, + NEO::TranslationOutput &output) override { receivedApiOptions = input.apiOptions.begin(); inputInternalOptions = input.internalOptions.begin(); - return NEO::TranslationOutput::ErrorCode::success; + return NEO::TranslationErrorCode::success; } std::string receivedApiOptions; @@ -190,32 +190,32 @@ template struct MockCompilerInterfaceWithSpecConstants : public NEO::CompilerInterface { MockCompilerInterfaceWithSpecConstants(uint32_t moduleNumSpecConstants) : moduleNumSpecConstants(moduleNumSpecConstants) { } - NEO::TranslationOutput::ErrorCode build(const NEO::Device &device, - const NEO::TranslationInput &input, - NEO::TranslationOutput &output) override { + NEO::TranslationErrorCode build(const NEO::Device &device, + const NEO::TranslationInput &input, + NEO::TranslationOutput &output) override { EXPECT_EQ(moduleNumSpecConstants, input.specializedValues.size()); - return NEO::TranslationOutput::ErrorCode::success; + return NEO::TranslationErrorCode::success; } - NEO::TranslationOutput::ErrorCode link(const NEO::Device &device, - const NEO::TranslationInput &input, - NEO::TranslationOutput &output) override { + NEO::TranslationErrorCode link(const NEO::Device &device, + const NEO::TranslationInput &input, + NEO::TranslationOutput &output) override { EXPECT_EQ(moduleNumSpecConstants, input.specializedValues.size()); - return NEO::TranslationOutput::ErrorCode::success; + return NEO::TranslationErrorCode::success; } - NEO::TranslationOutput::ErrorCode getSpecConstantsInfo(const NEO::Device &device, - ArrayRef srcSpirV, NEO::SpecConstantInfo &output) override { + NEO::TranslationErrorCode getSpecConstantsInfo(const NEO::Device &device, + ArrayRef srcSpirV, NEO::SpecConstantInfo &output) override { output.idsBuffer.reset(new NEO::MockCIFBuffer()); output.sizesBuffer.reset(new NEO::MockCIFBuffer()); for (uint32_t i = 0; i < moduleNumSpecConstants; i++) { output.idsBuffer->PushBackRawCopy(moduleSpecConstantsIds[i]); output.sizesBuffer->PushBackRawCopy(moduleSpecConstantsSizes[i]); } - return NEO::TranslationOutput::ErrorCode::success; + return NEO::TranslationErrorCode::success; } uint32_t moduleNumSpecConstants = 0u; const std::vector moduleSpecConstantsIds{2, 0, 1, 3, 5, 4}; @@ -226,11 +226,11 @@ struct MockCompilerInterfaceWithSpecConstants : public NEO::CompilerInterface { }; struct MockCompilerInterfaceLinkFailure : public NEO::CompilerInterface { - NEO::TranslationOutput::ErrorCode link(const NEO::Device &device, - const NEO::TranslationInput &input, - NEO::TranslationOutput &output) override { + NEO::TranslationErrorCode link(const NEO::Device &device, + const NEO::TranslationInput &input, + NEO::TranslationOutput &output) override { - return NEO::TranslationOutput::ErrorCode::buildFailure; + return NEO::TranslationErrorCode::buildFailure; } }; 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 79c6a262b6..f432e18190 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 @@ -975,9 +975,9 @@ TEST_F(ModuleSpecConstantsLongTests, givenSpecializationConstantsSetWhenCompiler class FailingMockCompilerInterfaceWithSpecConstants : public MockCompilerInterfaceWithSpecConstants { public: FailingMockCompilerInterfaceWithSpecConstants(uint32_t moduleNumSpecConstants) : MockCompilerInterfaceWithSpecConstants(moduleNumSpecConstants) {} - NEO::TranslationOutput::ErrorCode getSpecConstantsInfo(const NEO::Device &device, - ArrayRef srcSpirV, NEO::SpecConstantInfo &output) override { - return NEO::TranslationOutput::ErrorCode::compilerNotAvailable; + NEO::TranslationErrorCode getSpecConstantsInfo(const NEO::Device &device, + ArrayRef srcSpirV, NEO::SpecConstantInfo &output) override { + return NEO::TranslationErrorCode::compilerNotAvailable; } }; mockCompiler = new FailingMockCompilerInterfaceWithSpecConstants(moduleNumSpecConstants); @@ -1062,9 +1062,9 @@ TEST_F(ModuleSpecConstantsLongTests, givenSpecializationConstantsSetWhenCompiler class FailingMockCompilerInterfaceWithSpecConstants : public MockCompilerInterfaceWithSpecConstants { public: FailingMockCompilerInterfaceWithSpecConstants(uint32_t moduleNumSpecConstants) : MockCompilerInterfaceWithSpecConstants(moduleNumSpecConstants) {} - NEO::TranslationOutput::ErrorCode getSpecConstantsInfo(const NEO::Device &device, - ArrayRef srcSpirV, NEO::SpecConstantInfo &output) override { - return NEO::TranslationOutput::ErrorCode::compilerNotAvailable; + NEO::TranslationErrorCode getSpecConstantsInfo(const NEO::Device &device, + ArrayRef srcSpirV, NEO::SpecConstantInfo &output) override { + return NEO::TranslationErrorCode::compilerNotAvailable; } }; mockCompiler = new FailingMockCompilerInterfaceWithSpecConstants(moduleNumSpecConstants); diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index ab3adcb70c..3baec93192 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -62,8 +62,6 @@ #include #include -using namespace iOpenCL; - namespace NEO { uint32_t Kernel::dummyPatchLocation = 0xbaddf00d; diff --git a/opencl/source/program/program.cpp b/opencl/source/program/program.cpp index d7be1ba658..f0f736fb15 100644 --- a/opencl/source/program/program.cpp +++ b/opencl/source/program/program.cpp @@ -8,6 +8,7 @@ #include "program.h" #include "shared/source/command_stream/command_stream_receiver.h" +#include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/compiler_interface/compiler_options.h" #include "shared/source/compiler_interface/compiler_options_extra.h" #include "shared/source/compiler_interface/external_functions.h" @@ -481,7 +482,7 @@ cl_int Program::setProgramSpecializationConstant(cl_uint specId, size_t specSize SpecConstantInfo specConstInfo; auto retVal = pCompilerInterface->getSpecConstantsInfo(device, ArrayRef(irBinary.get(), irBinarySize), specConstInfo); - if (retVal != TranslationOutput::ErrorCode::success) { + if (retVal != TranslationErrorCode::success) { return CL_INVALID_VALUE; } diff --git a/opencl/source/program/program.h b/opencl/source/program/program.h index e9385d721a..bd09f12f45 100644 --- a/opencl/source/program/program.h +++ b/opencl/source/program/program.h @@ -6,8 +6,9 @@ */ #pragma once -#include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/compiler_interface/linker.h" +#include "shared/source/compiler_interface/spec_const_values_map.h" +#include "shared/source/compiler_interface/translation_error_code.h" #include "shared/source/helpers/non_copyable_or_moveable.h" #include "shared/source/program/program_info.h" #include "shared/source/utilities/const_stringref.h" @@ -15,6 +16,10 @@ #include "opencl/source/cl_device/cl_device_vector.h" #include "opencl/source/helpers/base_object.h" +#include "cif/builtins/memory/buffer/buffer.h" +#include "cif/common/cif.h" +#include "ocl_igc_interface/code_type.h" + #include namespace NEO { @@ -54,19 +59,19 @@ using CreateFromILFunc = std::functionfclPushDebugVars(fclDebugVars); TranslationOutput translationOutput = {}; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_TRUE(hasSubstr(receivedInternalOptions, pClDevice->peekCompilerExtensions())); gEnvironment->fclPopDebugVars(); } @@ -88,7 +88,7 @@ TEST_F(ClCompilerInterfaceTestMockedBinaryFilesTest, WhenCompileIsInvokedThenFcl gEnvironment->fclPushDebugVars(fclDebugVars); TranslationOutput translationOutput = {}; auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_TRUE(hasSubstr(receivedInternalOptions, pClDevice->peekCompilerExtensions())); gEnvironment->fclPopDebugVars(); } diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index 8bda589f63..9c3dd0ddbd 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -3181,16 +3181,16 @@ struct SpecializationConstantProgramMock : public MockProgram { }; struct SpecializationConstantCompilerInterfaceMock : public CompilerInterface { - TranslationOutput::ErrorCode retVal = TranslationOutput::ErrorCode::success; + TranslationErrorCode retVal = TranslationErrorCode::success; int counter = 0; const char *spirV = nullptr; - TranslationOutput::ErrorCode getSpecConstantsInfo(const NEO::Device &device, ArrayRef srcSpirV, SpecConstantInfo &output) override { + TranslationErrorCode getSpecConstantsInfo(const NEO::Device &device, ArrayRef srcSpirV, SpecConstantInfo &output) override { counter++; spirV = srcSpirV.begin(); return retVal; } void returnError() { - retVal = TranslationOutput::ErrorCode::compilationFailure; + retVal = TranslationErrorCode::compilationFailure; } }; @@ -3518,7 +3518,7 @@ TEST_F(ProgramMultiRootDeviceTests, WhenProgramIsCreatedThenBuildInfosVectorIsPr class MockCompilerInterfaceWithGtpinParam : public CompilerInterface { public: - TranslationOutput::ErrorCode link( + TranslationErrorCode link( const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) override { diff --git a/shared/source/built_ins/built_ins.cpp b/shared/source/built_ins/built_ins.cpp index 47637c7fe9..eb0c672d8f 100644 --- a/shared/source/built_ins/built_ins.cpp +++ b/shared/source/built_ins/built_ins.cpp @@ -43,7 +43,7 @@ const SipKernel &BuiltIns::getSipKernel(SipKernelType type, Device &device) { auto ret = compilerInterface->getSipKernelBinary(device, type, sipBinary, stateSaveAreaHeader); - UNRECOVERABLE_IF(ret != TranslationOutput::ErrorCode::success); + UNRECOVERABLE_IF(ret != TranslationErrorCode::success); UNRECOVERABLE_IF(sipBinary.size() == 0); if (NEO::debugManager.flags.DumpSipHeaderFile.get() != "unk") { diff --git a/shared/source/compiler_interface/CMakeLists.txt b/shared/source/compiler_interface/CMakeLists.txt index ea7dc0965e..71d2526eec 100644 --- a/shared/source/compiler_interface/CMakeLists.txt +++ b/shared/source/compiler_interface/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2019-2024 Intel Corporation +# Copyright (C) 2019-2025 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -29,7 +29,9 @@ set(NEO_CORE_COMPILER_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/os_compiler_cache_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/oclc_extensions.cpp ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}oclc_extensions_extra.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/spec_const_values_map.h ${CMAKE_CURRENT_SOURCE_DIR}/tokenized_string.h + ${CMAKE_CURRENT_SOURCE_DIR}/translation_error_code.h ) set_property(GLOBAL PROPERTY NEO_CORE_COMPILER_INTERFACE ${NEO_CORE_COMPILER_INTERFACE}) diff --git a/shared/source/compiler_interface/compiler_interface.cpp b/shared/source/compiler_interface/compiler_interface.cpp index cb404fdab2..4bd5e1f913 100644 --- a/shared/source/compiler_interface/compiler_interface.cpp +++ b/shared/source/compiler_interface/compiler_interface.cpp @@ -52,12 +52,12 @@ CompilerInterface::CompilerInterface() } CompilerInterface::~CompilerInterface() = default; -TranslationOutput::ErrorCode CompilerInterface::build( +TranslationErrorCode CompilerInterface::build( const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { if (false == isCompilerAvailable(&device, input.srcType, input.outType)) { - return TranslationOutput::ErrorCode::compilerNotAvailable; + return TranslationErrorCode::compilerNotAvailable; } IGC::CodeType::CodeType_t srcCodeType = input.srcType; @@ -79,7 +79,7 @@ TranslationOutput::ErrorCode CompilerInterface::build( bool success = CompilerCacheHelper::loadCacheAndSetOutput(*cache, kernelFileHash, output, device); if (success) { - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } } @@ -114,13 +114,13 @@ TranslationOutput::ErrorCode CompilerInterface::build( } if (fclOutput == nullptr) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } TranslationOutput::makeCopy(output.frontendCompilerLog, fclOutput->GetBuildLog()); if (fclOutput->Successful() == false) { - return TranslationOutput::ErrorCode::buildFailure; + return TranslationErrorCode::buildFailure; } output.intermediateCodeType = intermediateCodeType; @@ -145,7 +145,7 @@ TranslationOutput::ErrorCode CompilerInterface::build( bool success = CompilerCacheHelper::loadCacheAndSetOutput(*cache, kernelFileHash, output, device); if (success) { - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } } @@ -160,13 +160,13 @@ TranslationOutput::ErrorCode CompilerInterface::build( fclOptions.get(), fclInternalOptions.get(), input.gtPinInput); if (buildOutput == nullptr) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } TranslationOutput::makeCopy(output.backendCompilerLog, buildOutput->GetBuildLog()); if (buildOutput->Successful() == false) { - return TranslationOutput::ErrorCode::buildFailure; + return TranslationErrorCode::buildFailure; } if (igcOutputType == this->finalizerInputType) { @@ -180,7 +180,7 @@ TranslationOutput::ErrorCode CompilerInterface::build( TranslationOutput::append(output.backendCompilerLog, buildOutput->GetBuildLog(), "\n", 0); if (buildOutput->Successful() == false) { - return TranslationOutput::ErrorCode::buildFailure; + return TranslationErrorCode::buildFailure; } } @@ -191,20 +191,20 @@ TranslationOutput::ErrorCode CompilerInterface::build( CompilerCacheHelper::packAndCacheBinary(*cache, kernelFileHash, NEO::getTargetDevice(device.getRootDeviceEnvironment()), output); } - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } -TranslationOutput::ErrorCode CompilerInterface::compile( +TranslationErrorCode CompilerInterface::compile( const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { if ((IGC::CodeType::oclC != input.srcType) && (IGC::CodeType::elf != input.srcType)) { - return TranslationOutput::ErrorCode::alreadyCompiled; + return TranslationErrorCode::alreadyCompiled; } if (false == isCompilerAvailable(&device, input.srcType, input.outType)) { - return TranslationOutput::ErrorCode::compilerNotAvailable; + return TranslationErrorCode::compilerNotAvailable; } auto outType = input.outType; @@ -238,27 +238,27 @@ TranslationOutput::ErrorCode CompilerInterface::compile( } if (fclOutput == nullptr) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } TranslationOutput::makeCopy(output.frontendCompilerLog, fclOutput->GetBuildLog()); if (fclOutput->Successful() == false) { - return TranslationOutput::ErrorCode::compilationFailure; + return TranslationErrorCode::compilationFailure; } output.intermediateCodeType = outType; TranslationOutput::makeCopy(output.intermediateRepresentation, fclOutput->GetOutput()); - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } -TranslationOutput::ErrorCode CompilerInterface::link( +TranslationErrorCode CompilerInterface::link( const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { if (false == isCompilerAvailable(&device, input.srcType, input.outType)) { - return TranslationOutput::ErrorCode::compilerNotAvailable; + return TranslationErrorCode::compilerNotAvailable; } auto *igcMain = getIgc(&device)->entryPoint.get(); @@ -267,7 +267,7 @@ TranslationOutput::ErrorCode CompilerInterface::link( auto igcInternalOptions = CIF::Builtins::CreateConstBuffer(igcMain, input.internalOptions.begin(), input.internalOptions.size()); if (inSrc == nullptr) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } CIF::RAII::UPtr_t currOut; @@ -284,12 +284,12 @@ TranslationOutput::ErrorCode CompilerInterface::link( igcOptions.get(), igcInternalOptions.get(), input.gtPinInput); if (currOut == nullptr) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } if (currOut->Successful() == false) { TranslationOutput::makeCopy(output.backendCompilerLog, currOut->GetBuildLog()); - return TranslationOutput::ErrorCode::linkFailure; + return TranslationErrorCode::linkFailure; } currOut->GetOutput()->Retain(); // shared with currSrc @@ -300,12 +300,12 @@ TranslationOutput::ErrorCode CompilerInterface::link( TranslationOutput::makeCopy(output.deviceBinary, currOut->GetOutput()); TranslationOutput::makeCopy(output.debugData, currOut->GetDebugData()); - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } -TranslationOutput::ErrorCode CompilerInterface::getSpecConstantsInfo(const NEO::Device &device, ArrayRef srcSpirV, SpecConstantInfo &output) { +TranslationErrorCode CompilerInterface::getSpecConstantsInfo(const NEO::Device &device, ArrayRef srcSpirV, SpecConstantInfo &output) { if (false == isIgcAvailable(&device)) { - return TranslationOutput::ErrorCode::compilerNotAvailable; + return TranslationErrorCode::compilerNotAvailable; } auto igcTranslationCtx = createIgcTranslationCtx(device, IGC::CodeType::spirV, IGC::CodeType::oclGenBin); @@ -318,18 +318,18 @@ TranslationOutput::ErrorCode CompilerInterface::getSpecConstantsInfo(const NEO:: auto retVal = getSpecConstantsInfoImpl(igcTranslationCtx.get(), inSrc.get(), output.idsBuffer.get(), output.sizesBuffer.get()); if (!retVal) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } -TranslationOutput::ErrorCode CompilerInterface::createLibrary( +TranslationErrorCode CompilerInterface::createLibrary( NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { if (false == isIgcAvailable(&device)) { - return TranslationOutput::ErrorCode::compilerNotAvailable; + return TranslationErrorCode::compilerNotAvailable; } auto *igcMain = getIgc(&device)->entryPoint.get(); @@ -344,25 +344,25 @@ TranslationOutput::ErrorCode CompilerInterface::createLibrary( igcOptions.get(), igcInternalOptions.get()); if (igcOutput == nullptr) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } TranslationOutput::makeCopy(output.backendCompilerLog, igcOutput->GetBuildLog()); if (igcOutput->Successful() == false) { - return TranslationOutput::ErrorCode::linkFailure; + return TranslationErrorCode::linkFailure; } output.intermediateCodeType = intermediateRepresentation; TranslationOutput::makeCopy(output.intermediateRepresentation, igcOutput->GetOutput()); - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } -TranslationOutput::ErrorCode CompilerInterface::getSipKernelBinary(NEO::Device &device, SipKernelType type, std::vector &retBinary, - std::vector &stateSaveAreaHeader) { +TranslationErrorCode CompilerInterface::getSipKernelBinary(NEO::Device &device, SipKernelType type, std::vector &retBinary, + std::vector &stateSaveAreaHeader) { if (false == isIgcAvailable(&device)) { - return TranslationOutput::ErrorCode::compilerNotAvailable; + return TranslationErrorCode::compilerNotAvailable; } bool bindlessSip = false; @@ -392,7 +392,7 @@ TranslationOutput::ErrorCode CompilerInterface::getSipKernelBinary(NEO::Device & auto deviceCtx = getIgcDeviceCtx(device); if (deviceCtx == nullptr) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } auto *igcMain = getIgc(&device)->entryPoint.get(); @@ -405,13 +405,13 @@ TranslationOutput::ErrorCode CompilerInterface::getSipKernelBinary(NEO::Device & stateSaveAreaBuffer.get()); if (!result) { - return TranslationOutput::ErrorCode::unknownError; + return TranslationErrorCode::unknownError; } retBinary.assign(systemRoutineBuffer->GetMemory(), systemRoutineBuffer->GetMemory() + systemRoutineBuffer->GetSizeRaw()); stateSaveAreaHeader.assign(stateSaveAreaBuffer->GetMemory(), stateSaveAreaBuffer->GetMemory() + stateSaveAreaBuffer->GetSizeRaw()); - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } CIF::RAII::UPtr_t CompilerInterface::getIgcFeaturesAndWorkarounds(NEO::Device const &device) { diff --git a/shared/source/compiler_interface/compiler_interface.h b/shared/source/compiler_interface/compiler_interface.h index 4033eebd6c..59ad7fb273 100644 --- a/shared/source/compiler_interface/compiler_interface.h +++ b/shared/source/compiler_interface/compiler_interface.h @@ -6,6 +6,8 @@ */ #pragma once +#include "shared/source/compiler_interface/spec_const_values_map.h" +#include "shared/source/compiler_interface/translation_error_code.h" #include "shared/source/helpers/non_copyable_or_moveable.h" #include "shared/source/utilities/arrayref.h" #include "shared/source/utilities/spinlock.h" @@ -16,7 +18,6 @@ #include "ocl_igc_interface/fcl_ocl_device_ctx.h" #include "ocl_igc_interface/igc_ocl_device_ctx.h" -#include #include namespace NEO { @@ -26,8 +27,6 @@ class CompilerCache; class Device; struct TargetDevice; -using specConstValuesMap = std::unordered_map; - struct TranslationInput { TranslationInput(IGC::CodeType::CodeType_t srcType, IGC::CodeType::CodeType_t outType, IGC::CodeType::CodeType_t preferredIntermediateType = IGC::CodeType::undefined) : srcType(srcType), preferredIntermediateType(preferredIntermediateType), outType(outType) { @@ -126,27 +125,27 @@ class CompilerInterface : NEO::NonCopyableAndNonMovableClass { return instance; } - MOCKABLE_VIRTUAL TranslationOutput::ErrorCode build(const NEO::Device &device, - const TranslationInput &input, - TranslationOutput &output); + MOCKABLE_VIRTUAL TranslationErrorCode build(const NEO::Device &device, + const TranslationInput &input, + TranslationOutput &output); - MOCKABLE_VIRTUAL TranslationOutput::ErrorCode compile(const NEO::Device &device, - const TranslationInput &input, - TranslationOutput &output); + MOCKABLE_VIRTUAL TranslationErrorCode compile(const NEO::Device &device, + const TranslationInput &input, + TranslationOutput &output); - MOCKABLE_VIRTUAL TranslationOutput::ErrorCode link(const NEO::Device &device, - const TranslationInput &input, - TranslationOutput &output); - - MOCKABLE_VIRTUAL TranslationOutput::ErrorCode getSpecConstantsInfo(const NEO::Device &device, - ArrayRef srcSpirV, SpecConstantInfo &output); - - TranslationOutput::ErrorCode createLibrary(NEO::Device &device, + MOCKABLE_VIRTUAL TranslationErrorCode link(const NEO::Device &device, const TranslationInput &input, TranslationOutput &output); - MOCKABLE_VIRTUAL TranslationOutput::ErrorCode getSipKernelBinary(NEO::Device &device, SipKernelType type, std::vector &retBinary, - std::vector &stateSaveAreaHeader); + MOCKABLE_VIRTUAL TranslationErrorCode getSpecConstantsInfo(const NEO::Device &device, + ArrayRef srcSpirV, SpecConstantInfo &output); + + TranslationErrorCode createLibrary(NEO::Device &device, + const TranslationInput &input, + TranslationOutput &output); + + MOCKABLE_VIRTUAL TranslationErrorCode getSipKernelBinary(NEO::Device &device, SipKernelType type, std::vector &retBinary, + std::vector &stateSaveAreaHeader); MOCKABLE_VIRTUAL CIF::RAII::UPtr_t getIgcFeaturesAndWorkarounds(const NEO::Device &device); diff --git a/shared/source/compiler_interface/spec_const_values_map.h b/shared/source/compiler_interface/spec_const_values_map.h new file mode 100644 index 0000000000..5cd783fd3e --- /dev/null +++ b/shared/source/compiler_interface/spec_const_values_map.h @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include +#include + +namespace NEO { + +using specConstValuesMap = std::unordered_map; + +} // namespace NEO \ No newline at end of file diff --git a/shared/source/compiler_interface/translation_error_code.h b/shared/source/compiler_interface/translation_error_code.h new file mode 100644 index 0000000000..5e478c0b1b --- /dev/null +++ b/shared/source/compiler_interface/translation_error_code.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include + +namespace NEO { +enum class TranslationErrorCode { + success = 0, + compilerNotAvailable, + compilationFailure, + buildFailure, + linkFailure, + alreadyCompiled, + unknownError, +}; + +} // namespace NEO \ No newline at end of file diff --git a/shared/test/common/mocks/mock_compiler_interface.h b/shared/test/common/mocks/mock_compiler_interface.h index f98114339d..5abfd436c4 100644 --- a/shared/test/common/mocks/mock_compiler_interface.h +++ b/shared/test/common/mocks/mock_compiler_interface.h @@ -150,12 +150,12 @@ class MockCompilerInterface : public CompilerInterface { return this->fclBaseTranslationCtx.get(); } - TranslationOutput::ErrorCode getSipKernelBinary(NEO::Device &device, SipKernelType type, std::vector &retBinary, - std::vector &stateAreaHeader) override { + TranslationErrorCode getSipKernelBinary(NEO::Device &device, SipKernelType type, std::vector &retBinary, + std::vector &stateAreaHeader) override { if (this->sipKernelBinaryOverride.size() > 0) { retBinary = this->sipKernelBinaryOverride; this->requestedSipKernel = type; - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } else { return CompilerInterface::getSipKernelBinary(device, type, retBinary, stateAreaHeader); } @@ -211,7 +211,7 @@ inline std::unordered_map } struct MockCompilerInterfaceCaptureBuildOptions : CompilerInterface { - TranslationOutput::ErrorCode compile(const NEO::Device &device, const TranslationInput &input, TranslationOutput &out) override { + TranslationErrorCode compile(const NEO::Device &device, const TranslationInput &input, TranslationOutput &out) override { buildOptions.clear(); if ((input.apiOptions.size() > 0) && (input.apiOptions.begin() != nullptr)) { buildOptions.assign(input.apiOptions.begin(), input.apiOptions.end()); @@ -233,16 +233,16 @@ struct MockCompilerInterfaceCaptureBuildOptions : CompilerInterface { copy(out.deviceBinary, output.intermediateRepresentation); out.intermediateCodeType = output.intermediateCodeType; - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } - TranslationOutput::ErrorCode build(const NEO::Device &device, const TranslationInput &input, TranslationOutput &out) override { + TranslationErrorCode build(const NEO::Device &device, const TranslationInput &input, TranslationOutput &out) override { return this->MockCompilerInterfaceCaptureBuildOptions::compile(device, input, out); } - TranslationOutput::ErrorCode link(const NEO::Device &device, - const TranslationInput &input, - TranslationOutput &output) override { + TranslationErrorCode link(const NEO::Device &device, + const TranslationInput &input, + TranslationOutput &output) override { return this->MockCompilerInterfaceCaptureBuildOptions::compile(device, input, output); } diff --git a/shared/test/common/mocks/mock_compiler_interface_spirv.cpp b/shared/test/common/mocks/mock_compiler_interface_spirv.cpp index a668a943e9..6daa8cb44c 100644 --- a/shared/test/common/mocks/mock_compiler_interface_spirv.cpp +++ b/shared/test/common/mocks/mock_compiler_interface_spirv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,7 +13,7 @@ #include "shared/test/common/libult/global_environment.h" namespace NEO { -TranslationOutput::ErrorCode MockCompilerInterfaceSpirv::compile(const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { +TranslationErrorCode MockCompilerInterfaceSpirv::compile(const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { std::string kernelName; retrieveBinaryKernelFilename(kernelName, KernelBinaryHelper::BUILT_INS + "_", ".bin"); @@ -25,9 +25,9 @@ TranslationOutput::ErrorCode MockCompilerInterfaceSpirv::compile(const NEO::Devi output.deviceBinary.size = size; output.intermediateCodeType = IGC::CodeType::spirV; - return TranslationOutput::ErrorCode::success; + return TranslationErrorCode::success; } -TranslationOutput::ErrorCode MockCompilerInterfaceSpirv::build(const NEO::Device &device, const TranslationInput &input, TranslationOutput &out) { +TranslationErrorCode MockCompilerInterfaceSpirv::build(const NEO::Device &device, const TranslationInput &input, TranslationOutput &out) { return this->compile(device, input, out); } } // namespace NEO \ No newline at end of file diff --git a/shared/test/common/mocks/mock_compiler_interface_spirv.h b/shared/test/common/mocks/mock_compiler_interface_spirv.h index ae236ccf00..9f092b6746 100644 --- a/shared/test/common/mocks/mock_compiler_interface_spirv.h +++ b/shared/test/common/mocks/mock_compiler_interface_spirv.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,7 +12,7 @@ namespace NEO { class MockCompilerInterfaceSpirv : public MockCompilerInterface { - TranslationOutput::ErrorCode compile(const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) override; - TranslationOutput::ErrorCode build(const NEO::Device &device, const TranslationInput &input, TranslationOutput &out) override; + TranslationErrorCode compile(const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) override; + TranslationErrorCode build(const NEO::Device &device, const TranslationInput &input, TranslationOutput &out) override; }; } // namespace NEO \ No newline at end of file diff --git a/shared/test/common/mocks/mock_compilers.h b/shared/test/common/mocks/mock_compilers.h index a504cf4e3f..48683d5fb4 100644 --- a/shared/test/common/mocks/mock_compilers.h +++ b/shared/test/common/mocks/mock_compilers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,15 +7,24 @@ #pragma once -#include "shared/source/compiler_interface/compiler_interface.h" #include "shared/test/common/mocks/mock_cif.h" +#include "cif/builtins/memory/buffer/buffer.h" +#include "cif/common/cif.h" +#include "cif/common/id.h" +#include "ocl_igc_interface/code_type.h" #include "ocl_igc_interface/fcl_ocl_device_ctx.h" +#include "ocl_igc_interface/fcl_ocl_translation_ctx.h" +#include "ocl_igc_interface/gt_system_info.h" +#include "ocl_igc_interface/igc_features_and_workarounds.h" #include "ocl_igc_interface/igc_ocl_device_ctx.h" +#include "ocl_igc_interface/igc_ocl_translation_ctx.h" +#include "ocl_igc_interface/ocl_translation_output.h" +#include "ocl_igc_interface/platform.h" -#include -#include +#include #include +#include namespace NEO { diff --git a/shared/test/unit_test/built_ins/sip_tests.cpp b/shared/test/unit_test/built_ins/sip_tests.cpp index 6f68cbb412..4055dfabe1 100644 --- a/shared/test/unit_test/built_ins/sip_tests.cpp +++ b/shared/test/unit_test/built_ins/sip_tests.cpp @@ -7,13 +7,11 @@ #include "shared/source/built_ins/built_ins.h" #include "shared/source/command_stream/command_stream_receiver.h" -#include "shared/source/debugger/DebuggerStateSaveHeader.h" -#include "shared/source/debugger/debugger_l0.h" +#include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/memory_manager/memory_allocation.h" #include "shared/source/os_interface/os_context.h" -#include "shared/source/sip_external_lib/sip_external_lib.h" #include "shared/test/common/fixtures/device_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/engine_descriptor_helper.h" diff --git a/shared/test/unit_test/compiler_interface/compiler_cache_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_cache_tests.cpp index 0ef76dc910..7c869623b4 100644 --- a/shared/test/unit_test/compiler_interface/compiler_cache_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_cache_tests.cpp @@ -404,7 +404,7 @@ TEST(CompilerInterfaceCachedTests, GivenNoCachedBinaryWhenBuildingThenErrorIsRet inputArgs.allowCaching = true; MockDevice device; auto err = compilerInterface->build(device, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::buildFailure, err); + EXPECT_EQ(TranslationErrorCode::buildFailure, err); gEnvironment->fclPopDebugVars(); gEnvironment->igcPopDebugVars(); @@ -435,7 +435,7 @@ TEST(CompilerInterfaceCachedTests, GivenCachedBinaryWhenBuildingThenSuccessIsRet TranslationOutput translationOutput; MockDevice device; auto err = compilerInterface->build(device, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); gEnvironment->fclPopDebugVars(); gEnvironment->igcPopDebugVars(); @@ -467,7 +467,7 @@ TEST(CompilerInterfaceCachedTests, givenKernelWithoutIncludesAndBinaryInCacheWhe TranslationOutput translationOutput; inputArgs.allowCaching = true; auto retVal = compilerInterface->build(device, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::success, retVal); + EXPECT_EQ(TranslationErrorCode::success, retVal); gEnvironment->fclPopDebugVars(); gEnvironment->igcPopDebugVars(); @@ -491,7 +491,7 @@ TEST(CompilerInterfaceCachedTests, givenKernelWithIncludesAndBinaryInCacheWhenCo TranslationOutput translationOutput; inputArgs.allowCaching = true; auto retVal = compilerInterface->build(device, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::buildFailure, retVal); + EXPECT_EQ(TranslationErrorCode::buildFailure, retVal); gEnvironment->fclPopDebugVars(); } @@ -656,7 +656,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenKernelWithIncludesWhenBuildingThen TranslationOutput outputFromCompilation; MockDevice device; auto err = compilerInterface->build(device, inputArgs, outputFromCompilation); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(patchtokensProgram.storage.data(), outputFromCompilation.deviceBinary.mem.get(), outputFromCompilation.deviceBinary.size)); EXPECT_EQ(nullptr, outputFromCompilation.debugData.mem.get()); @@ -671,7 +671,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenKernelWithIncludesWhenBuildingThen TranslationOutput outputFromCache; err = compilerInterface->build(device, inputArgs, outputFromCache); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(patchtokensProgram.storage.data(), outputFromCache.deviceBinary.mem.get(), outputFromCache.deviceBinary.size)); EXPECT_EQ(nullptr, outputFromCache.debugData.mem.get()); @@ -692,7 +692,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenKernelWithIncludesWhenLoadedCacheD TranslationOutput outputFromCompilation; MockDevice device; auto err = compilerInterface->build(device, inputArgs, outputFromCompilation); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(invalidBinary.data(), outputFromCompilation.deviceBinary.mem.get(), outputFromCompilation.deviceBinary.size)); EXPECT_EQ(nullptr, outputFromCompilation.debugData.mem.get()); @@ -704,7 +704,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenKernelWithIncludesWhenLoadedCacheD TranslationOutput outputFromCache; err = compilerInterface->build(device, inputArgs, outputFromCache); - EXPECT_EQ(TranslationOutput::ErrorCode::buildFailure, err); + EXPECT_EQ(TranslationErrorCode::buildFailure, err); EXPECT_EQ(nullptr, outputFromCache.deviceBinary.mem.get()); EXPECT_EQ(nullptr, outputFromCache.debugData.mem.get()); @@ -725,7 +725,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenKernelWithIncludesAndDebugDataWhen TranslationOutput outputFromCompilation; MockDevice device; auto err = compilerInterface->build(device, inputArgs, outputFromCompilation); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(patchtokensProgram.storage.data(), outputFromCompilation.deviceBinary.mem.get(), outputFromCompilation.deviceBinary.size)); EXPECT_EQ(0, std::strncmp(debugDataToReturn.c_str(), outputFromCompilation.debugData.mem.get(), debugDataToReturn.size())); @@ -740,7 +740,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenKernelWithIncludesAndDebugDataWhen TranslationOutput outputFromCache; err = compilerInterface->build(device, inputArgs, outputFromCache); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(patchtokensProgram.storage.data(), outputFromCache.deviceBinary.mem.get(), outputFromCache.deviceBinary.size)); EXPECT_EQ(0, std::strncmp(debugDataToReturn.c_str(), outputFromCache.debugData.mem.get(), debugDataToReturn.size())); @@ -761,7 +761,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenBinaryWhenBuildingThenPackBinaryOn TranslationOutput outputFromCompilation; MockDevice device; auto err = compilerInterface->build(device, inputArgs, outputFromCompilation); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(patchtokensProgram.storage.data(), outputFromCompilation.deviceBinary.mem.get(), outputFromCompilation.deviceBinary.size)); EXPECT_EQ(nullptr, outputFromCompilation.debugData.mem.get()); @@ -776,7 +776,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenBinaryWhenBuildingThenPackBinaryOn TranslationOutput outputFromCache; err = compilerInterface->build(device, inputArgs, outputFromCache); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(patchtokensProgram.storage.data(), outputFromCache.deviceBinary.mem.get(), outputFromCache.deviceBinary.size)); EXPECT_EQ(nullptr, outputFromCache.debugData.mem.get()); @@ -797,7 +797,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenBinaryWhenLoadedCacheDoesNotUnpack TranslationOutput outputFromCompilation; MockDevice device; auto err = compilerInterface->build(device, inputArgs, outputFromCompilation); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(invalidBinary.data(), outputFromCompilation.deviceBinary.mem.get(), outputFromCompilation.deviceBinary.size)); EXPECT_EQ(nullptr, outputFromCompilation.debugData.mem.get()); @@ -809,7 +809,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenBinaryWhenLoadedCacheDoesNotUnpack TranslationOutput outputFromCache; err = compilerInterface->build(device, inputArgs, outputFromCache); - EXPECT_EQ(TranslationOutput::ErrorCode::buildFailure, err); + EXPECT_EQ(TranslationErrorCode::buildFailure, err); gEnvironment->fclPopDebugVars(); } @@ -827,7 +827,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenBinaryAndDebugDataWhenBuildingThen TranslationOutput outputFromCompilation; MockDevice device; auto err = compilerInterface->build(device, inputArgs, outputFromCompilation); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(patchtokensProgram.storage.data(), outputFromCompilation.deviceBinary.mem.get(), outputFromCompilation.deviceBinary.size)); EXPECT_EQ(0, std::strncmp(debugDataToReturn.c_str(), outputFromCompilation.debugData.mem.get(), debugDataToReturn.size())); @@ -842,7 +842,7 @@ TEST_F(CompilerInterfaceOclElfCacheTest, GivenBinaryAndDebugDataWhenBuildingThen TranslationOutput outputFromCache; err = compilerInterface->build(device, inputArgs, outputFromCache); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_EQ(0, memcmp(patchtokensProgram.storage.data(), outputFromCache.deviceBinary.mem.get(), outputFromCache.deviceBinary.size)); EXPECT_EQ(0, std::strncmp(debugDataToReturn.c_str(), outputFromCache.debugData.mem.get(), debugDataToReturn.size())); diff --git a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp index 56197c3c7f..b02c475423 100644 --- a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp @@ -179,7 +179,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, WhenCompilingToIsaThenSuccessIsRe TranslationOutput translationOutput; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); } TEST_F(CompilerInterfaceMockedBinaryFilesTest, WhenPreferredIntermediateRepresentationSpecifiedThenPreserveIt) { @@ -192,7 +192,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, WhenPreferredIntermediateRepresen inputArgs.preferredIntermediateType = IGC::CodeType::llvmLl; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); EXPECT_EQ(IGC::CodeType::llvmLl, translationOutput.intermediateCodeType); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); } TEST_F(CompilerInterfaceMockedBinaryFilesTest, GivenCompileCommandWhenPreferredIntermediateNotSpirvThenUseLlvmBc) { @@ -206,7 +206,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, GivenCompileCommandWhenPreferredI TranslationOutput translationOutput; auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); EXPECT_EQ(IGC::CodeType::llvmBc, translationOutput.intermediateCodeType); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); } TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenBuildFailsGracefully) { @@ -215,7 +215,7 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenBuildFailsGracefully TranslationOutput translationOutput = {}; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); + EXPECT_EQ(TranslationErrorCode::compilerNotAvailable, err); } TEST_F(CompilerInterfaceTest, whenFclTranslatorReturnsNullptrThenBuildFailsGracefully) { @@ -227,7 +227,7 @@ TEST_F(CompilerInterfaceTest, whenFclTranslatorReturnsNullptrThenBuildFailsGrace TranslationOutput translationOutput = {}; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); pCompilerInterface->failCreateFclTranslationCtx = false; - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); } TEST_F(CompilerInterfaceMockedBinaryFilesTest, whenIgcTranslatorReturnsNullptrThenBuildFailsGracefully) { @@ -240,7 +240,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, whenIgcTranslatorReturnsNullptrTh TranslationOutput translationOutput = {}; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); pCompilerInterface->failCreateIgcTranslationCtx = true; - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); } TEST_F(CompilerInterfaceMockedBinaryFilesTest, GivenOptionsWhenCompilingToIsaThenSuccessIsReturned) { @@ -259,7 +259,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, GivenOptionsWhenCompilingToIsaThe TranslationOutput translationOutput = {}; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); gEnvironment->fclPopDebugVars(); gEnvironment->igcPopDebugVars(); @@ -271,7 +271,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, WhenCompilingToIrThenSuccessIsRet gEnvironment->fclPushDebugVars(fclDebugVars); TranslationOutput translationOutput = {}; auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); gEnvironment->fclPopDebugVars(); } @@ -294,7 +294,7 @@ TEST_F(CompilerInterfaceTest, GivenFclRedirectionEnvSetToForceIgcWhenCompilingTo auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); gEnvironment->fclPopDebugVars(); gEnvironment->igcPopDebugVars(); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); ASSERT_EQ(1U, translationOutput.intermediateRepresentation.size); EXPECT_EQ(7, translationOutput.intermediateRepresentation.mem[0]); } @@ -317,7 +317,7 @@ TEST_F(CompilerInterfaceTest, GivenFclRedirectionEnvSetToForceFclWhenCompilingTo auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); gEnvironment->fclPopDebugVars(); gEnvironment->igcPopDebugVars(); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); ASSERT_EQ(1U, translationOutput.intermediateRepresentation.size); EXPECT_EQ(7, translationOutput.intermediateRepresentation.mem[0]); } @@ -347,7 +347,7 @@ TEST_F(CompilerInterfaceTest, GivenFclRedirectionEnvSetToForceIgcWhenBuildingDev auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); gEnvironment->fclPopDebugVars(); gEnvironment->igcPopDebugVars(); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); ASSERT_EQ(1U, translationOutput.intermediateRepresentation.size); EXPECT_EQ(7, translationOutput.intermediateRepresentation.mem[0]); } @@ -372,7 +372,7 @@ TEST_F(CompilerInterfaceTest, GivenFclRedirectionEnvSetToForceFclWhenBuildingDev auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); gEnvironment->fclPopDebugVars(); gEnvironment->igcPopDebugVars(); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); ASSERT_EQ(2U, translationOutput.intermediateRepresentation.size); EXPECT_EQ(3, translationOutput.intermediateRepresentation.mem[0]); EXPECT_EQ(5, translationOutput.intermediateRepresentation.mem[1]); @@ -382,19 +382,19 @@ TEST_F(CompilerInterfaceTest, GivenProgramCreatedFromIrWhenCompileIsCalledThenDo TranslationOutput translationOutput = {}; inputArgs.srcType = IGC::CodeType::spirV; auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::alreadyCompiled, err); + EXPECT_EQ(TranslationErrorCode::alreadyCompiled, err); inputArgs.srcType = IGC::CodeType::llvmBc; err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::alreadyCompiled, err); + EXPECT_EQ(TranslationErrorCode::alreadyCompiled, err); inputArgs.srcType = IGC::CodeType::llvmLl; err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::alreadyCompiled, err); + EXPECT_EQ(TranslationErrorCode::alreadyCompiled, err); inputArgs.srcType = IGC::CodeType::oclGenBin; err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::alreadyCompiled, err); + EXPECT_EQ(TranslationErrorCode::alreadyCompiled, err); } TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenCompileFailsGracefully) { @@ -406,7 +406,7 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenCompileFailsGraceful pCompilerInterface->failLoadIgc = true; TranslationOutput translationOutput = {}; auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); + EXPECT_EQ(TranslationErrorCode::compilerNotAvailable, err); gEnvironment->fclPopDebugVars(); } @@ -419,7 +419,7 @@ TEST_F(CompilerInterfaceTest, whenFclTranslatorReturnsNullptrThenCompileFailsGra TranslationOutput translationOutput = {}; auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); pCompilerInterface->failCreateFclTranslationCtx = false; - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); gEnvironment->fclPopDebugVars(); } @@ -431,7 +431,7 @@ TEST_F(CompilerInterfaceTest, GivenForceBuildFailureWhenCompilingToIrThenCompila gEnvironment->fclPushDebugVars(fclDebugVars); TranslationOutput translationOutput = {}; auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::compilationFailure, err); + EXPECT_EQ(TranslationErrorCode::compilationFailure, err); gEnvironment->fclPopDebugVars(); } @@ -443,7 +443,7 @@ TEST_F(CompilerInterfaceTest, GivenForceBuildFailureWhenLinkingIrThenLinkFailure gEnvironment->igcPushDebugVars(igcDebugVars); TranslationOutput translationOutput = {}; auto err = pCompilerInterface->link(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::linkFailure, err); + EXPECT_EQ(TranslationErrorCode::linkFailure, err); gEnvironment->igcPopDebugVars(); } @@ -456,7 +456,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, WhenLinkIsCalledThenOclGenBinIsTh TranslationOutput translationOutput = {}; auto err = pCompilerInterface->link(*pDevice, inputArgs, translationOutput); gEnvironment->igcPopDebugVars(); - ASSERT_EQ(TranslationOutput::ErrorCode::success, err); + ASSERT_EQ(TranslationErrorCode::success, err); ASSERT_EQ(1u, pCompilerInterface->requestedTranslationCtxs.size()); MockCompilerInterface::TranslationOpT translation = {IGC::CodeType::elf, IGC::CodeType::oclGenBin}; @@ -472,7 +472,7 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenLinkFailsGracefully) pCompilerInterface->failLoadIgc = true; TranslationOutput translationOutput = {}; auto err = pCompilerInterface->link(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); + EXPECT_EQ(TranslationErrorCode::compilerNotAvailable, err); gEnvironment->igcPopDebugVars(); } @@ -485,7 +485,7 @@ TEST_F(CompilerInterfaceTest, whenSrcAllocationFailsThenLinkFailsGracefully) { TranslationOutput translationOutput = {}; auto err = pCompilerInterface->link(*pDevice, inputArgs, translationOutput); MockCIFBuffer::failAllocations = false; - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); gEnvironment->igcPopDebugVars(); } @@ -498,7 +498,7 @@ TEST_F(CompilerInterfaceTest, whenTranslateReturnsNullptrThenLinkFailsGracefully TranslationOutput translationOutput = {}; auto err = pCompilerInterface->link(*pDevice, inputArgs, translationOutput); pCompilerInterface->failCreateIgcTranslationCtx = false; - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); gEnvironment->igcPopDebugVars(); } @@ -511,7 +511,7 @@ TEST_F(CompilerInterfaceTest, GivenForceBuildFailureWhenCreatingLibraryThenLinkF gEnvironment->igcPushDebugVars(igcDebugVars); TranslationOutput translationOutput = {}; auto err = pCompilerInterface->createLibrary(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::linkFailure, err); + EXPECT_EQ(TranslationErrorCode::linkFailure, err); gEnvironment->igcPopDebugVars(); } @@ -524,7 +524,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, WhenCreateLibraryIsCalledThenLlvm TranslationOutput translationOutput = {}; auto err = pCompilerInterface->createLibrary(*pDevice, inputArgs, translationOutput); gEnvironment->igcPopDebugVars(); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); ASSERT_EQ(1U, pCompilerInterface->requestedTranslationCtxs.size()); EXPECT_EQ(IGC::CodeType::llvmBc, pCompilerInterface->requestedTranslationCtxs[0].second); @@ -540,7 +540,7 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenCreateLibraryFailsGr TranslationOutput translationOutput = {}; auto err = pCompilerInterface->createLibrary(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); + EXPECT_EQ(TranslationErrorCode::compilerNotAvailable, err); gEnvironment->igcPopDebugVars(); } @@ -553,7 +553,7 @@ TEST_F(CompilerInterfaceTest, whenIgcTranslatorReturnsNullptrThenCreateLibraryFa TranslationOutput translationOutput = {}; auto err = pCompilerInterface->createLibrary(*pDevice, inputArgs, translationOutput); pCompilerInterface->failCreateIgcTranslationCtx = false; - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); gEnvironment->igcPopDebugVars(); } @@ -573,7 +573,7 @@ TEST_F(CompilerInterfaceTest, GivenForceBuildFailureWhenFclBuildingThenBuildFail TranslationOutput translationOutput = {}; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::buildFailure, err); + EXPECT_EQ(TranslationErrorCode::buildFailure, err); gEnvironment->fclPopDebugVars(); } @@ -593,7 +593,7 @@ TEST_F(CompilerInterfaceTest, GivenForceBuildFailureWhenIgcBuildingThenBuildFail TranslationOutput translationOutput = {}; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::buildFailure, err); + EXPECT_EQ(TranslationErrorCode::buildFailure, err); gEnvironment->igcPopDebugVars(); } @@ -910,7 +910,7 @@ TEST_F(CompilerInterfaceMockedBinaryFilesTest, givenUpdatedSpecConstValuesWhenBu TranslationOutput translationOutput; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); } // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks), NEO-14033 TEST_F(CompilerInterfaceTest, GivenRequestForNewFclTranslationCtxWhenDeviceCtxIsNotAvailableThenCreateNewDeviceCtxAndUseItToReturnValidTranslationCtx) { @@ -1212,7 +1212,7 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenGetSipKernelBinaryFa std::vector sipBinary; std::vector stateAreaHeader; auto err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::csr, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); + EXPECT_EQ(TranslationErrorCode::compilerNotAvailable, err); EXPECT_EQ(0U, sipBinary.size()); } @@ -1224,7 +1224,7 @@ TEST_F(CompilerInterfaceTest, whenIgcReturnsErrorThenGetSipKernelBinaryFailsGrac std::vector sipBinary; std::vector stateAreaHeader; auto err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::csr, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); EXPECT_EQ(0U, sipBinary.size()); gEnvironment->igcPopDebugVars(); @@ -1236,7 +1236,7 @@ TEST_F(CompilerInterfaceTest, whenGetIgcDeviceCtxReturnsNullptrThenGetSipKernelB std::vector sipBinary; std::vector stateAreaHeader; auto err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::csr, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); } TEST_F(CompilerInterfaceTest, whenEverythingIsOkThenGetSipKernelReturnsIgcsOutputAsSipBinary) { @@ -1246,7 +1246,7 @@ TEST_F(CompilerInterfaceTest, whenEverythingIsOkThenGetSipKernelReturnsIgcsOutpu std::vector sipBinary; std::vector stateAreaHeader; auto err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::csr, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_NE(0U, sipBinary.size()); gEnvironment->igcPopDebugVars(); @@ -1258,17 +1258,17 @@ TEST_F(CompilerInterfaceTest, whenRequestingSipKernelBinaryThenProperSystemRouti std::vector sipBinary; std::vector stateAreaHeader; auto err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::csr, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_NE(0U, sipBinary.size()); EXPECT_EQ(IGC::SystemRoutineType::contextSaveRestore, getIgcDebugVars().typeOfSystemRoutine); err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::dbgCsr, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_NE(0U, sipBinary.size()); EXPECT_EQ(IGC::SystemRoutineType::debug, getIgcDebugVars().typeOfSystemRoutine); err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::dbgCsrLocal, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_NE(0U, sipBinary.size()); EXPECT_EQ(IGC::SystemRoutineType::debugSlm, getIgcDebugVars().typeOfSystemRoutine); @@ -1281,25 +1281,25 @@ TEST_F(CompilerInterfaceTest, WhenRequestingBindlessDebugSipThenProperSystemRout std::vector sipBinary; std::vector stateAreaHeader; auto err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::csr, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_NE(0U, sipBinary.size()); EXPECT_EQ(IGC::SystemRoutineType::contextSaveRestore, getIgcDebugVars().typeOfSystemRoutine); EXPECT_EQ(MockCompilerDebugVars::SipAddressingType::bindful, getIgcDebugVars().receivedSipAddressingType); err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::dbgCsrLocal, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_NE(0U, sipBinary.size()); EXPECT_EQ(IGC::SystemRoutineType::debugSlm, getIgcDebugVars().typeOfSystemRoutine); EXPECT_EQ(MockCompilerDebugVars::SipAddressingType::bindful, getIgcDebugVars().receivedSipAddressingType); err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::dbgBindless, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_NE(0U, sipBinary.size()); EXPECT_EQ(IGC::SystemRoutineType::debug, getIgcDebugVars().typeOfSystemRoutine); EXPECT_EQ(MockCompilerDebugVars::SipAddressingType::bindless, getIgcDebugVars().receivedSipAddressingType); err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::dbgHeapless, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); EXPECT_NE(0U, sipBinary.size()); EXPECT_EQ(IGC::SystemRoutineType::debug, getIgcDebugVars().typeOfSystemRoutine); EXPECT_EQ(MockCompilerDebugVars::SipAddressingType::bindful, getIgcDebugVars().receivedSipAddressingType); @@ -1313,7 +1313,7 @@ TEST_F(CompilerInterfaceTest, whenRequestingInvalidSipKernelBinaryThenErrorIsRet std::vector sipBinary; std::vector stateAreaHeader; auto err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::count, sipBinary, stateAreaHeader); - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); EXPECT_EQ(0U, sipBinary.size()); EXPECT_EQ(IGC::SystemRoutineType::undefined, getIgcDebugVars().typeOfSystemRoutine); @@ -1326,7 +1326,7 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenGetSpecializationCon NEO::SpecConstantInfo sci; auto err = pCompilerInterface->getSpecConstantsInfo(*pDevice, ArrayRef{}, sci); - EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); + EXPECT_EQ(TranslationErrorCode::compilerNotAvailable, err); } TEST_F(CompilerInterfaceTest, givenCompilerInterfacewhenGettingIgcFeaturesAndWorkaroundsThenValidPointerIsReturned) { @@ -1445,14 +1445,14 @@ TEST_F(CompilerInterfaceTest, whenIgcTranlationContextCreationFailsThenErrorIsRe pCompilerInterface->failCreateIgcTranslationCtx = true; NEO::SpecConstantInfo specConstInfo; auto err = pCompilerInterface->getSpecConstantsInfo(*pDevice, inputArgs.src, specConstInfo); - EXPECT_EQ(TranslationOutput::ErrorCode::unknownError, err); + EXPECT_EQ(TranslationErrorCode::unknownError, err); } TEST_F(CompilerInterfaceTest, givenCompilerInterfaceWhenGetSpecializationConstantsThenSuccessIsReturned) { TranslationOutput translationOutput; NEO::SpecConstantInfo specConstInfo; auto err = pCompilerInterface->getSpecConstantsInfo(*pDevice, inputArgs.src, specConstInfo); - EXPECT_EQ(TranslationOutput::ErrorCode::success, err); + EXPECT_EQ(TranslationErrorCode::success, err); } struct UnknownInterfaceCIFMain : MockCIFMain {