diff --git a/opencl/test/unit_test/offline_compiler/ocloc_api_tests.cpp b/opencl/test/unit_test/offline_compiler/ocloc_api_tests.cpp index 2509ac3e3f..e89fe79ae6 100644 --- a/opencl/test/unit_test/offline_compiler/ocloc_api_tests.cpp +++ b/opencl/test/unit_test/offline_compiler/ocloc_api_tests.cpp @@ -40,7 +40,7 @@ TEST(OclocApiTests, WhenGoodArgsAreGivenThenSuccessIsReturned) { nullptr, nullptr, nullptr, nullptr); std::string output = testing::internal::GetCapturedStdout(); - EXPECT_EQ(retVal, NEO::SUCCESS); + EXPECT_EQ(retVal, NEO::OfflineCompiler::ErrorCode::SUCCESS); EXPECT_EQ(std::string::npos, output.find("Command was: ocloc -file test_files/copybuffer.cl -device "s + argv[4])); } @@ -60,7 +60,7 @@ TEST(OclocApiTests, WhenGoodFamilyNameIsProvidedThenSuccessIsReturned) { nullptr, nullptr, nullptr, nullptr); std::string output = testing::internal::GetCapturedStdout(); - EXPECT_EQ(retVal, NEO::SUCCESS); + EXPECT_EQ(retVal, NEO::OfflineCompiler::ErrorCode::SUCCESS); EXPECT_EQ(std::string::npos, output.find("Command was: ocloc -file test_files/copybuffer.cl -device "s + argv[4])); } @@ -80,7 +80,7 @@ TEST(OclocApiTests, WhenArgsWithMissingFileAreGivenThenErrorMessageIsProduced) { nullptr, nullptr, nullptr, nullptr); std::string output = testing::internal::GetCapturedStdout(); - EXPECT_EQ(retVal, NEO::INVALID_FILE); + EXPECT_EQ(retVal, NEO::OfflineCompiler::ErrorCode::INVALID_FILE); EXPECT_NE(std::string::npos, output.find("Command was: ocloc -file test_files/IDoNotExist.cl -device "s + argv[4])); } diff --git a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp index bf2bce55ac..06330e1c76 100644 --- a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp +++ b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -153,7 +153,7 @@ TEST_F(MultiCommandTests, GivenMissingTextFileWithArgsWhenBuildingMultiCommandTh EXPECT_STRNE(output.c_str(), ""); EXPECT_EQ(nullptr, pMultiCommand); - EXPECT_EQ(INVALID_FILE, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::INVALID_FILE, retVal); DebugManager.flags.PrintDebugMessages.set(false); } TEST_F(MultiCommandTests, GivenLackOfClFileWhenBuildingMultiCommandThenInvalidFileErrorIsReturned) { @@ -178,7 +178,7 @@ TEST_F(MultiCommandTests, GivenLackOfClFileWhenBuildingMultiCommandThenInvalidFi std::string output = testing::internal::GetCapturedStdout(); EXPECT_EQ(nullptr, pMultiCommand); - EXPECT_EQ(INVALID_FILE, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::INVALID_FILE, retVal); DebugManager.flags.PrintDebugMessages.set(false); deleteFileWithArgs(); @@ -446,7 +446,7 @@ TEST_F(OfflineCompilerTests, GivenHelpOptionThenBuildDoesNotOccur) { std::string output = testing::internal::GetCapturedStdout(); EXPECT_EQ(nullptr, pOfflineCompiler); EXPECT_STRNE("", output.c_str()); - EXPECT_EQ(PRINT_USAGE, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::PRINT_USAGE, retVal); delete pOfflineCompiler; } @@ -464,7 +464,7 @@ TEST_F(OfflineCompilerTests, GivenInvalidFileWhenBuildingThenInvalidFileErrorIsR std::string output = testing::internal::GetCapturedStdout(); EXPECT_STRNE(output.c_str(), ""); EXPECT_EQ(nullptr, pOfflineCompiler); - EXPECT_EQ(INVALID_FILE, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::INVALID_FILE, retVal); DebugManager.flags.PrintDebugMessages.set(false); delete pOfflineCompiler; } @@ -482,7 +482,7 @@ TEST_F(OfflineCompilerTests, GivenInvalidFlagWhenBuildingThenInvalidCommandLineE std::string output = testing::internal::GetCapturedStdout(); EXPECT_STRNE(output.c_str(), ""); EXPECT_EQ(nullptr, pOfflineCompiler); - EXPECT_EQ(INVALID_COMMAND_LINE, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::INVALID_COMMAND_LINE, retVal); delete pOfflineCompiler; } @@ -499,7 +499,7 @@ TEST_F(OfflineCompilerTests, GivenInvalidOptionsWhenBuildingThenInvalidCommandLi EXPECT_STRNE(output.c_str(), ""); EXPECT_EQ(nullptr, pOfflineCompiler); - EXPECT_EQ(INVALID_COMMAND_LINE, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::INVALID_COMMAND_LINE, retVal); delete pOfflineCompiler; @@ -513,7 +513,7 @@ TEST_F(OfflineCompilerTests, GivenInvalidOptionsWhenBuildingThenInvalidCommandLi output = testing::internal::GetCapturedStdout(); EXPECT_STRNE(output.c_str(), ""); EXPECT_EQ(nullptr, pOfflineCompiler); - EXPECT_EQ(INVALID_COMMAND_LINE, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::INVALID_COMMAND_LINE, retVal); delete pOfflineCompiler; } @@ -1209,7 +1209,7 @@ TEST(OfflineCompilerTest, givenCompilerWhenBuildSourceCodeFailsThenGenerateElfBi MockOfflineCompiler compiler; compiler.overrideBuildSourceCodeStatus = true; - auto expectedError = BUILD_PROGRAM_FAILURE; + auto expectedError = OfflineCompiler::ErrorCode::BUILD_PROGRAM_FAILURE; compiler.buildSourceCodeStatus = expectedError; EXPECT_EQ(0u, compiler.generateElfBinaryCalled); @@ -1240,7 +1240,7 @@ TEST(OfflineCompilerTest, givenDeviceSpecificKernelFileWhenCompilerIsInitialized gEnvironment->devicePrefix.c_str()}; int retVal = mockOfflineCompiler->initialize(argv.size(), argv); - EXPECT_EQ(SUCCESS, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::SUCCESS, retVal); EXPECT_STREQ("-cl-opt-disable", mockOfflineCompiler->options.c_str()); } @@ -1259,7 +1259,7 @@ TEST(OfflineCompilerTest, givenRevisionIdWhenCompilerIsInitializedThenPassItToHw "3"}; int retVal = mockOfflineCompiler->initialize(argv.size(), argv); - EXPECT_EQ(SUCCESS, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::SUCCESS, retVal); EXPECT_EQ(mockOfflineCompiler->hwInfo.platform.usRevId, 3); } @@ -1278,7 +1278,7 @@ TEST(OfflineCompilerTest, givenNoRevisionIdWhenCompilerIsInitializedThenHwInfoHa mockOfflineCompiler->getHardwareInfo(gEnvironment->devicePrefix.c_str()); auto revId = mockOfflineCompiler->hwInfo.platform.usRevId; int retVal = mockOfflineCompiler->initialize(argv.size(), argv); - EXPECT_EQ(SUCCESS, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::SUCCESS, retVal); EXPECT_EQ(mockOfflineCompiler->hwInfo.platform.usRevId, revId); } @@ -1295,7 +1295,7 @@ TEST(OfflineCompilerTest, whenDeviceIsSpecifiedThenDefaultConfigFromTheDeviceIsU gEnvironment->devicePrefix.c_str()}; int retVal = mockOfflineCompiler->initialize(argv.size(), argv); - EXPECT_EQ(SUCCESS, retVal); + EXPECT_EQ(OfflineCompiler::ErrorCode::SUCCESS, retVal); auto actualHwInfo = mockOfflineCompiler->hwInfo; auto expectedHwInfo = actualHwInfo; diff --git a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.h b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.h index 36890da0eb..28add9e15b 100644 --- a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.h +++ b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ namespace NEO { class OfflineCompilerTests : public ::testing::Test { public: OfflineCompiler *pOfflineCompiler = nullptr; - int retVal = SUCCESS; + int retVal = OfflineCompiler::ErrorCode::SUCCESS; std::unique_ptr oclocArgHelperWithoutInput = std::make_unique(); }; @@ -31,7 +31,7 @@ class MultiCommandTests : public ::testing::Test { MultiCommand *pMultiCommand = nullptr; std::string nameOfFileWithArgs; std::string outFileList; - int retVal = SUCCESS; + int retVal = OfflineCompiler::ErrorCode::SUCCESS; std::unique_ptr oclocArgHelperWithoutInput = std::make_unique(); }; diff --git a/shared/offline_compiler/source/CMakeLists.txt b/shared/offline_compiler/source/CMakeLists.txt index 126d961b29..1a1fb27c59 100644 --- a/shared/offline_compiler/source/CMakeLists.txt +++ b/shared/offline_compiler/source/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2018-2020 Intel Corporation +# Copyright (C) 2018-2021 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -30,6 +30,7 @@ set(CLOC_LIB_SRCS_LIB ${NEO_SHARED_DIRECTORY}/helpers/file_io.cpp ${NEO_SHARED_DIRECTORY}/helpers/hw_info.cpp ${NEO_SHARED_DIRECTORY}/helpers/hw_info.h + ${NEO_SHARED_DIRECTORY}/helpers${BRANCH_DIR_SUFFIX}/hw_info_extended.cpp ${NEO_SHARED_DIRECTORY}/os_interface/os_library.h ${NEO_SOURCE_DIR}/opencl/source/platform/extensions.cpp ${NEO_SOURCE_DIR}/opencl/source/platform/extensions.h diff --git a/shared/offline_compiler/source/multi_command.cpp b/shared/offline_compiler/source/multi_command.cpp index 24bc9cf141..cde56cbf61 100644 --- a/shared/offline_compiler/source/multi_command.cpp +++ b/shared/offline_compiler/source/multi_command.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2020 Intel Corporation + * Copyright (C) 2019-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,13 +14,13 @@ namespace NEO { int MultiCommand::singleBuild(const std::vector &args) { - int retVal = SUCCESS; + int retVal = OfflineCompiler::ErrorCode::SUCCESS; if (requestedFatBinary(args)) { retVal = buildFatBinary(args, argHelper); } else { std::unique_ptr pCompiler{OfflineCompiler::create(args.size(), args, true, retVal, argHelper)}; - if (retVal == SUCCESS) { + if (retVal == OfflineCompiler::ErrorCode::SUCCESS) { retVal = buildWithSafetyGuard(pCompiler.get()); std::string &buildLog = pCompiler->getBuildLog(); @@ -30,14 +30,14 @@ int MultiCommand::singleBuild(const std::vector &args) { } outFileName += ".bin"; } - if (retVal == SUCCESS) { + if (retVal == OfflineCompiler::ErrorCode::SUCCESS) { if (!quiet) argHelper->printf("Build succeeded.\n"); } else { argHelper->printf("Build failed with error code: %d\n", retVal); } - if (retVal == SUCCESS) { + if (retVal == OfflineCompiler::ErrorCode::SUCCESS) { outputFile << getCurrentDirectoryOwn(outDirForBuilds) + outFileName; } else { outputFile << "Unsuccesful build"; @@ -48,7 +48,7 @@ int MultiCommand::singleBuild(const std::vector &args) { } MultiCommand *MultiCommand::create(const std::vector &args, int &retVal, OclocArgHelper *helper) { - retVal = ErrorCode::SUCCESS; + retVal = OfflineCompiler::ErrorCode::SUCCESS; auto pMultiCommand = new MultiCommand(); if (pMultiCommand) { @@ -56,7 +56,7 @@ MultiCommand *MultiCommand::create(const std::vector &args, int &re retVal = pMultiCommand->initialize(args); } - if (retVal != ErrorCode::SUCCESS) { + if (retVal != OfflineCompiler::ErrorCode::SUCCESS) { delete pMultiCommand; pMultiCommand = nullptr; } @@ -107,7 +107,7 @@ int MultiCommand::initialize(const std::vector &args) { } else { argHelper->printf("Invalid option (arg %zu): %s\n", argIndex, currArg.c_str()); printHelp(); - return INVALID_COMMAND_LINE; + return OfflineCompiler::ErrorCode::INVALID_COMMAND_LINE; } } @@ -116,11 +116,11 @@ int MultiCommand::initialize(const std::vector &args) { argHelper->readFileToVectorOfStrings(pathToCommandFile, lines); if (lines.empty()) { argHelper->printf("Command file was empty.\n"); - return INVALID_FILE; + return OfflineCompiler::ErrorCode::INVALID_FILE; } } else { argHelper->printf("Could not find/open file with builds argument.s\n"); - return INVALID_FILE; + return OfflineCompiler::ErrorCode::INVALID_FILE; } runBuilds(args[0]); @@ -136,7 +136,7 @@ void MultiCommand::runBuilds(const std::string &argZero) { std::vector args = {argZero}; int retVal = splitLineInSeparateArgs(args, lines[i], i); - if (retVal != SUCCESS) { + if (retVal != OfflineCompiler::ErrorCode::SUCCESS) { retValues.push_back(retVal); continue; } @@ -188,22 +188,22 @@ int MultiCommand::splitLineInSeparateArgs(std::vector &qargs, const } if (end == std::string::npos) { argHelper->printf("One of the quotes is open in build number %zu\n", numberOfBuild + 1); - return INVALID_FILE; + return OfflineCompiler::ErrorCode::INVALID_FILE; } argLen = end - start; i = end; qargs.push_back(commandsLine.substr(start, argLen)); } - return SUCCESS; + return OfflineCompiler::ErrorCode::SUCCESS; } int MultiCommand::showResults() { - int retValue = SUCCESS; + int retValue = OfflineCompiler::ErrorCode::SUCCESS; int indexRetVal = 0; for (int retVal : retValues) { retValue |= retVal; if (!quiet) { - if (retVal != SUCCESS) { + if (retVal != OfflineCompiler::ErrorCode::SUCCESS) { argHelper->printf("Build command %d: failed. Error code: %d\n", indexRetVal, retVal); } else { argHelper->printf("Build command %d: successful\n", indexRetVal); diff --git a/shared/offline_compiler/source/ocloc_api.cpp b/shared/offline_compiler/source/ocloc_api.cpp index 44299ea07b..96d472fae9 100644 --- a/shared/offline_compiler/source/ocloc_api.cpp +++ b/shared/offline_compiler/source/ocloc_api.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -81,7 +81,7 @@ int oclocInvoke(unsigned int numArgs, const char *argv[], try { if (numArgs == 1 || (numArgs > 1 && (ConstStringRef("-h") == allArgs[1] || ConstStringRef("--help") == allArgs[1]))) { helper->printf("%s", help); - return ErrorCode::SUCCESS; + return OfflineCompiler::ErrorCode::SUCCESS; } else if (numArgs > 1 && ConstStringRef("disasm") == allArgs[1]) { BinaryDecoder disasm(helper.get()); int retVal = disasm.validateInput(allArgs); @@ -99,7 +99,7 @@ int oclocInvoke(unsigned int numArgs, const char *argv[], return retVal; } } else if (numArgs > 1 && ConstStringRef("multi") == allArgs[1]) { - int retValue = ErrorCode::SUCCESS; + int retValue = OfflineCompiler::ErrorCode::SUCCESS; std::unique_ptr pMulti{(MultiCommand::create(allArgs, retValue, helper.get()))}; return retValue; } else if (requestedFatBinary(allArgs)) { @@ -107,10 +107,10 @@ int oclocInvoke(unsigned int numArgs, const char *argv[], } else if (numArgs > 1 && ConstStringRef("validate") == allArgs[1]) { return NEO::Ocloc::validate(allArgs, helper.get()); } else { - int retVal = ErrorCode::SUCCESS; + int retVal = OfflineCompiler::ErrorCode::SUCCESS; std::unique_ptr pCompiler{OfflineCompiler::create(numArgs, allArgs, true, retVal, helper.get())}; - if (retVal == ErrorCode::SUCCESS) { + if (retVal == OfflineCompiler::ErrorCode::SUCCESS) { retVal = buildWithSafetyGuard(pCompiler.get()); std::string buildLog = pCompiler->getBuildLog(); @@ -118,7 +118,7 @@ int oclocInvoke(unsigned int numArgs, const char *argv[], helper->printf("%s\n", buildLog.c_str()); } - if (retVal == ErrorCode::SUCCESS) { + if (retVal == OfflineCompiler::ErrorCode::SUCCESS) { if (!pCompiler->isQuiet()) helper->printf("Build succeeded.\n"); } else { @@ -126,7 +126,7 @@ int oclocInvoke(unsigned int numArgs, const char *argv[], } } - if (retVal != ErrorCode::SUCCESS) + if (retVal != OfflineCompiler::ErrorCode::SUCCESS) printOclocCmdLine(numArgs, argv, helper); return retVal; diff --git a/shared/offline_compiler/source/ocloc_fatbinary.cpp b/shared/offline_compiler/source/ocloc_fatbinary.cpp index 2e0dcc0f1a..6ec0ddfdf0 100644 --- a/shared/offline_compiler/source/ocloc_fatbinary.cpp +++ b/shared/offline_compiler/source/ocloc_fatbinary.cpp @@ -265,7 +265,7 @@ int buildFatBinary(const std::vector &args, OclocArgHelper *argHelp argsCopy[deviceArgIndex] = targetPlatform.str(); std::unique_ptr pCompiler{OfflineCompiler::create(argsCopy.size(), argsCopy, false, retVal, argHelper)}; - if (ErrorCode::SUCCESS != retVal) { + if (OfflineCompiler::ErrorCode::SUCCESS != retVal) { argHelper->printf("Error! Couldn't create OfflineCompiler. Exiting.\n"); return retVal; } diff --git a/shared/offline_compiler/source/offline_compiler.cpp b/shared/offline_compiler/source/offline_compiler.cpp index e8fbf77de6..abbab229f1 100644 --- a/shared/offline_compiler/source/offline_compiler.cpp +++ b/shared/offline_compiler/source/offline_compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,6 +15,7 @@ #include "shared/source/helpers/compiler_options_parser.h" #include "shared/source/helpers/debug_helpers.h" #include "shared/source/helpers/file_io.h" +#include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/string.h" #include "shared/source/os_interface/os_library.h" @@ -286,11 +287,13 @@ std::string &OfflineCompiler::getBuildLog() { return buildLog; } -int OfflineCompiler::getHardwareInfo(const char *pDeviceName) { +int OfflineCompiler::getHardwareInfo(std::string deviceName) { int retVal = INVALID_DEVICE; + overridePlatformName(deviceName); + for (unsigned int productId = 0; productId < IGFX_MAX_PRODUCT; ++productId) { - if (hardwarePrefix[productId] && (0 == strcmp(pDeviceName, hardwarePrefix[productId]))) { + if (hardwarePrefix[productId] && (0 == strcmp(deviceName.c_str(), hardwarePrefix[productId]))) { if (hardwareInfoTable[productId]) { hwInfo = *hardwareInfoTable[productId]; if (revisionId != -1) { diff --git a/shared/offline_compiler/source/offline_compiler.h b/shared/offline_compiler/source/offline_compiler.h index 80782860ee..7c17a9c808 100644 --- a/shared/offline_compiler/source/offline_compiler.h +++ b/shared/offline_compiler/source/offline_compiler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -28,22 +28,22 @@ class OsLibrary; std::string convertToPascalCase(const std::string &inString); -enum ErrorCode { - SUCCESS = 0, - OUT_OF_HOST_MEMORY = -6, - BUILD_PROGRAM_FAILURE = -11, - INVALID_DEVICE = -33, - INVALID_PROGRAM = -44, - INVALID_COMMAND_LINE = -5150, - INVALID_FILE = -5151, - PRINT_USAGE = -5152, -}; - std::string generateFilePath(const std::string &directory, const std::string &fileNameBase, const char *extension); std::string getDevicesTypes(); class OfflineCompiler { public: + enum ErrorCode { + SUCCESS = 0, + OUT_OF_HOST_MEMORY = -6, + BUILD_PROGRAM_FAILURE = -11, + INVALID_DEVICE = -33, + INVALID_PROGRAM = -44, + INVALID_COMMAND_LINE = -5150, + INVALID_FILE = -5151, + PRINT_USAGE = -5152, + }; + static OfflineCompiler *create(size_t numArgs, const std::vector &allArgs, bool dumpFiles, int &retVal, OclocArgHelper *helper); int build(); std::string &getBuildLog(); @@ -77,7 +77,7 @@ class OfflineCompiler { protected: OfflineCompiler(); - int getHardwareInfo(const char *pDeviceName); + int getHardwareInfo(std::string deviceName); std::string getStringWithinDelimiters(const std::string &src); int initialize(size_t numArgs, const std::vector &allArgs, bool dumpFiles); int parseCommandLine(size_t numArgs, const std::vector &allArgs); diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index adfc25fd82..72bcaa3168 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -61,6 +61,7 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tgllp_plus.inl ${CMAKE_CURRENT_SOURCE_DIR}/hw_info.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info.h + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/hw_info_extended.cpp ${CMAKE_CURRENT_SOURCE_DIR}/interlocked_max.h ${CMAKE_CURRENT_SOURCE_DIR}/kernel_helpers.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel_helpers.h diff --git a/shared/source/helpers/hw_info.cpp b/shared/source/helpers/hw_info.cpp index ba35dd3362..505d704ddd 100644 --- a/shared/source/helpers/hw_info.cpp +++ b/shared/source/helpers/hw_info.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #include "shared/source/helpers/hw_info.h" #include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/helpers/hw_helper.h" #include "hw_cmds.h" @@ -46,6 +47,8 @@ void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *, bool, uint64_t) = { bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwInfoIn) { std::transform(platform.begin(), platform.end(), platform.begin(), ::tolower); + overridePlatformName(platform); + bool ret = false; for (int j = 0; j < IGFX_MAX_PRODUCT; j++) { if (hardwarePrefix[j] == nullptr) @@ -56,6 +59,7 @@ bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwIn break; } } + return ret; } diff --git a/shared/source/helpers/hw_info.h b/shared/source/helpers/hw_info.h index b11c823e0b..e472adb9d2 100644 --- a/shared/source/helpers/hw_info.h +++ b/shared/source/helpers/hw_info.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -111,6 +111,7 @@ struct EnableGfxFamilyHw { bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwInfoIn); void setHwInfoValuesFromConfig(const uint64_t hwInfoConfig, HardwareInfo &hwInfoIn); bool parseHwInfoConfigString(const std::string &hwInfoConfigStr, uint64_t &hwInfoConfig); +void overridePlatformName(std::string &name); aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo); const std::string getFamilyNameWithType(const HardwareInfo &hwInfo); diff --git a/shared/source/helpers/hw_info_extended.cpp b/shared/source/helpers/hw_info_extended.cpp new file mode 100644 index 0000000000..106bd6ae02 --- /dev/null +++ b/shared/source/helpers/hw_info_extended.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/hw_info.h" + +namespace NEO { + +void overridePlatformName(std::string &name) { +} + +} // namespace NEO