mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
ocloc refactor
Related-To: NEO-5538 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a9ab9f0789
commit
cee785f8a1
@@ -14,7 +14,7 @@ components:
|
||||
infra:
|
||||
branch: infra
|
||||
dest_dir: infra
|
||||
revision: 8b65692dfdec1cd8005986684ee509d1fd0afdc0
|
||||
revision: 0cdf9d69ec5fc0fd12c49ac67b13cdd3417dbbc3
|
||||
type: git
|
||||
internal:
|
||||
branch: master
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -140,7 +140,9 @@ TEST_F(OclocFatBinaryGetTargetPlatformsForFatbinary, GivenGenThenReturnAllEnable
|
||||
auto platform0 = allEnabledPlatforms[0];
|
||||
auto gfxCore0 = NEO::hardwareInfoTable[platform0]->platform.eRenderCoreFamily;
|
||||
std::string genName = NEO::familyName[gfxCore0];
|
||||
genName[0] = 'g'; // ocloc uses lower case
|
||||
if (genName[0] == 'G') {
|
||||
genName[0] = 'g';
|
||||
}
|
||||
|
||||
std::vector<PRODUCT_FAMILY> platformsForGen;
|
||||
NEO::appendPlatformsForGfxCore(gfxCore0, allEnabledPlatforms, platformsForGen);
|
||||
@@ -235,7 +237,9 @@ TEST_F(OclocFatBinaryGetTargetPlatformsForFatbinary, GivenGenOpenRangeFromThenRe
|
||||
}
|
||||
auto core0 = allEnabledCores[allEnabledCores.size() / 2];
|
||||
std::string genName = NEO::familyName[core0];
|
||||
genName[0] = 'g'; // ocloc uses lower case
|
||||
if (genName[0] == 'G') {
|
||||
genName[0] = 'g';
|
||||
}
|
||||
|
||||
std::vector<PRODUCT_FAMILY> expectedPlatforms;
|
||||
unsigned int coreIt = core0;
|
||||
@@ -258,7 +262,9 @@ TEST_F(OclocFatBinaryGetTargetPlatformsForFatbinary, GivenGenOpenRangeToThenRetu
|
||||
}
|
||||
auto core0 = allEnabledCores[allEnabledCores.size() / 2];
|
||||
std::string genName = NEO::familyName[core0];
|
||||
genName[0] = 'g'; // ocloc uses lower case
|
||||
if (genName[0] == 'G') {
|
||||
genName[0] = 'g';
|
||||
}
|
||||
|
||||
std::vector<PRODUCT_FAMILY> expectedPlatforms;
|
||||
unsigned int coreIt = IGFX_UNKNOWN_CORE;
|
||||
@@ -282,9 +288,13 @@ TEST_F(OclocFatBinaryGetTargetPlatformsForFatbinary, GivenGenClosedRangeThenRetu
|
||||
auto genFrom = allEnabledCores[1];
|
||||
auto genTo = allEnabledCores[allEnabledCores.size() - 2];
|
||||
std::string genNameFrom = NEO::familyName[genFrom];
|
||||
genNameFrom[0] = 'g';
|
||||
if (genNameFrom[0] == 'G') {
|
||||
genNameFrom[0] = 'g';
|
||||
}
|
||||
std::string genNameTo = NEO::familyName[genTo];
|
||||
genNameTo[0] = 'g';
|
||||
if (genNameTo[0] == 'G') {
|
||||
genNameTo[0] = 'g';
|
||||
}
|
||||
|
||||
std::vector<PRODUCT_FAMILY> expectedPlatforms;
|
||||
auto genIt = genFrom;
|
||||
@@ -352,7 +362,9 @@ TEST_F(OclocFatBinaryGetTargetPlatformsForFatbinary, GivenGenClosedRangeWhenAnyO
|
||||
auto platform0 = allEnabledPlatforms[0];
|
||||
auto gfxCore0 = NEO::hardwareInfoTable[platform0]->platform.eRenderCoreFamily;
|
||||
std::string genName = NEO::familyName[gfxCore0];
|
||||
genName[0] = 'g'; // ocloc uses lower case
|
||||
if (genName[0] == 'G') {
|
||||
genName[0] = 'g';
|
||||
}
|
||||
|
||||
auto got = NEO::getTargetPlatformsForFatbinary("gen2-" + genName, oclocArgHelperWithoutInput.get());
|
||||
EXPECT_TRUE(got.empty());
|
||||
|
||||
@@ -112,7 +112,7 @@ std::vector<ConstStringRef> getTargetPlatformsForFatbinary(ConstStringRef device
|
||||
|
||||
if (range.size() == 1) {
|
||||
// open range , from-max or min-to
|
||||
if (range[0].containsCaseInsensitive("gen")) {
|
||||
if (range[0].containsCaseInsensitive("gen") || range[0].startsWith("XE_")) {
|
||||
auto coreIdList = asGfxCoreIdList(range[0]);
|
||||
if (coreIdList.empty()) {
|
||||
argHelper->printf("Unknown device : %s\n", set.str().c_str());
|
||||
@@ -152,8 +152,8 @@ std::vector<ConstStringRef> getTargetPlatformsForFatbinary(ConstStringRef device
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (range[0].contains("gen")) {
|
||||
if (false == range[1].contains("gen")) {
|
||||
if (range[0].contains("gen") || range[0].startsWith("XE_")) {
|
||||
if (false == range[1].contains("gen") && false == range[1].startsWith("XE_")) {
|
||||
argHelper->printf("Ranges mixing platforms and gfxCores is not supported : %s - should be genFrom-genTo or platformFrom-platformTo\n", set.str().c_str());
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user