Skip to content

Commit e5a1d33

Browse files
Fix ocloc fatbinary for better gen/sku detection
Signed-off-by: Kacper Nowak <[email protected]>
1 parent 2ef41e4 commit e5a1d33

File tree

8 files changed

+133
-81
lines changed

8 files changed

+133
-81
lines changed

opencl/test/unit_test/offline_compiler/ocloc_fatbinary_tests.cpp

Lines changed: 80 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "opencl/test/unit_test/offline_compiler/ocloc_fatbinary_tests.h"
99

10+
#include "shared/offline_compiler/source/ocloc_arg_helper.h"
1011
#include "shared/source/helpers/hw_helper.h"
1112

1213
#include <algorithm>
@@ -17,40 +18,63 @@ namespace NEO {
1718
TEST(OclocFatBinaryRequestedFatBinary, WhenDeviceArgMissingThenReturnsFalse) {
1819
const char *args[] = {"ocloc", "-aaa", "*", "-device", "*"};
1920

20-
EXPECT_FALSE(NEO::requestedFatBinary(0, nullptr));
21-
EXPECT_FALSE(NEO::requestedFatBinary(1, args));
22-
EXPECT_FALSE(NEO::requestedFatBinary(2, args));
23-
EXPECT_FALSE(NEO::requestedFatBinary(3, args));
24-
EXPECT_FALSE(NEO::requestedFatBinary(4, args));
21+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
22+
23+
EXPECT_FALSE(NEO::requestedFatBinary(0, nullptr, argHelper.get()));
24+
EXPECT_FALSE(NEO::requestedFatBinary(1, args, argHelper.get()));
25+
EXPECT_FALSE(NEO::requestedFatBinary(2, args, argHelper.get()));
26+
EXPECT_FALSE(NEO::requestedFatBinary(3, args, argHelper.get()));
27+
EXPECT_FALSE(NEO::requestedFatBinary(4, args, argHelper.get()));
2528
}
2629

27-
TEST(OclocFatBinaryRequestedFatBinary, WhenDeviceArgProvidedAndContainsFatbinaryArgFormatThenReturnsTrue) {
30+
TEST(OclocFatBinaryRequestedFatBinary, GivenDeviceArgProvidedWhenFatBinaryFormatWithRangeIsPassedThenTrueIsReturned) {
31+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
32+
2833
const char *allPlatforms[] = {"ocloc", "-device", "*"};
2934
const char *manyPlatforms[] = {"ocloc", "-device", "a,b"};
3035
const char *manyGens[] = {"ocloc", "-device", "gen0,gen1"};
31-
const char *gen[] = {"ocloc", "-device", "gen0"};
3236
const char *rangePlatformFrom[] = {"ocloc", "-device", "skl-"};
3337
const char *rangePlatformTo[] = {"ocloc", "-device", "-skl"};
3438
const char *rangePlatformBounds[] = {"ocloc", "-device", "skl-icllp"};
3539
const char *rangeGenFrom[] = {"ocloc", "-device", "gen0-"};
3640
const char *rangeGenTo[] = {"ocloc", "-device", "-gen5"};
3741
const char *rangeGenBounds[] = {"ocloc", "-device", "gen0-gen5"};
3842

39-
EXPECT_TRUE(NEO::requestedFatBinary(3, allPlatforms));
40-
EXPECT_TRUE(NEO::requestedFatBinary(3, manyPlatforms));
41-
EXPECT_TRUE(NEO::requestedFatBinary(3, manyGens));
42-
EXPECT_TRUE(NEO::requestedFatBinary(3, gen));
43-
EXPECT_TRUE(NEO::requestedFatBinary(3, rangePlatformFrom));
44-
EXPECT_TRUE(NEO::requestedFatBinary(3, rangePlatformTo));
45-
EXPECT_TRUE(NEO::requestedFatBinary(3, rangePlatformBounds));
46-
EXPECT_TRUE(NEO::requestedFatBinary(3, rangeGenFrom));
47-
EXPECT_TRUE(NEO::requestedFatBinary(3, rangeGenTo));
48-
EXPECT_TRUE(NEO::requestedFatBinary(3, rangeGenBounds));
43+
EXPECT_TRUE(NEO::requestedFatBinary(3, allPlatforms, argHelper.get()));
44+
EXPECT_TRUE(NEO::requestedFatBinary(3, manyPlatforms, argHelper.get()));
45+
EXPECT_TRUE(NEO::requestedFatBinary(3, manyGens, argHelper.get()));
46+
EXPECT_TRUE(NEO::requestedFatBinary(3, rangePlatformFrom, argHelper.get()));
47+
EXPECT_TRUE(NEO::requestedFatBinary(3, rangePlatformTo, argHelper.get()));
48+
EXPECT_TRUE(NEO::requestedFatBinary(3, rangePlatformBounds, argHelper.get()));
49+
EXPECT_TRUE(NEO::requestedFatBinary(3, rangeGenFrom, argHelper.get()));
50+
EXPECT_TRUE(NEO::requestedFatBinary(3, rangeGenTo, argHelper.get()));
51+
EXPECT_TRUE(NEO::requestedFatBinary(3, rangeGenBounds, argHelper.get()));
52+
}
53+
54+
TEST(OclocFatBinaryRequestedFatBinary, GivenDeviceArgProvidedWhenUnknownGenNameIsPassedThenRequestedFatBinaryReturnsFalse) {
55+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
56+
const char *unknownGen[] = {"ocloc", "-device", "gen0"};
57+
const char *unknownGenCaseInsensitive[] = {"ocloc", "-device", "Gen0"};
58+
59+
EXPECT_FALSE(NEO::requestedFatBinary(3, unknownGen, argHelper.get()));
60+
EXPECT_FALSE(NEO::requestedFatBinary(3, unknownGenCaseInsensitive, argHelper.get()));
61+
}
62+
63+
TEST(OclocFatBinaryRequestedFatBinary, GivenDeviceArgProvidedWhenKnownGenNameIsPassedThenRequestedFatBinaryReturnsTrue) {
64+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
65+
unsigned int i = 0;
66+
for (; i < IGFX_MAX_CORE; ++i) {
67+
if (NEO::familyName[i] != nullptr)
68+
break;
69+
}
70+
const char *genFromFamilyName[] = {"ocloc", "-device", NEO::familyName[i]};
71+
EXPECT_TRUE(NEO::requestedFatBinary(3, genFromFamilyName, argHelper.get()));
4972
}
5073

5174
TEST(OclocFatBinaryRequestedFatBinary, WhenDeviceArgProvidedButDoesnNotContainFatbinaryArgFormatThenReturnsFalse) {
75+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
5276
const char *skl[] = {"ocloc", "-device", "skl"};
53-
EXPECT_FALSE(NEO::requestedFatBinary(3, skl));
77+
EXPECT_FALSE(NEO::requestedFatBinary(3, skl, argHelper.get()));
5478
}
5579

5680
TEST(OclocFatBinaryGetAllSupportedTargetPlatforms, WhenRequestedThenReturnsAllPlatformsWithNonNullHardwarePrefixes) {
@@ -91,21 +115,51 @@ TEST(OclocFatBinaryAsProductId, GivenDisabledPlatformNameThenReturnsUnknownPlatf
91115
}
92116

93117
TEST(OclocFatBinaryAsGfxCoreIdList, GivenEnabledGfxCoreNameThenReturnsNonEmptyList) {
118+
119+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
120+
94121
for (unsigned int coreId = 0; coreId < IGFX_MAX_CORE; ++coreId) {
95122
if (nullptr != NEO::familyName[coreId]) {
96-
EXPECT_FALSE(NEO::asGfxCoreIdList(ConstStringRef(NEO::familyName[coreId], strlen(NEO::familyName[coreId]))).empty());
97-
std::string caseInsesitive = NEO::familyName[coreId];
98-
caseInsesitive[0] = 'g';
99-
EXPECT_FALSE(NEO::asGfxCoreIdList(caseInsesitive).empty());
123+
EXPECT_TRUE(argHelper->isGen(ConstStringRef(NEO::familyName[coreId]).str()));
124+
std::string caseInsensitive = NEO::familyName[coreId];
125+
std::transform(caseInsensitive.begin(), caseInsensitive.begin() + 1, caseInsensitive.begin(), ::tolower);
126+
EXPECT_TRUE(argHelper->isGen(caseInsensitive));
100127
}
101128
}
102129
}
103130

104131
TEST(OclocFatBinaryAsGfxCoreIdList, GivenDisabledGfxCoreNameThenReturnsEmptyList) {
105-
EXPECT_TRUE(NEO::asGfxCoreIdList(ConstStringRef("genA")).empty());
106-
EXPECT_TRUE(NEO::asGfxCoreIdList(ConstStringRef("gen0")).empty());
107-
EXPECT_TRUE(NEO::asGfxCoreIdList(ConstStringRef("gen1")).empty());
108-
EXPECT_TRUE(NEO::asGfxCoreIdList(ConstStringRef("gen2")).empty());
132+
133+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
134+
135+
EXPECT_FALSE(argHelper->isGen(ConstStringRef("genA").str()));
136+
EXPECT_FALSE(argHelper->isGen(ConstStringRef("gen0").str()));
137+
EXPECT_FALSE(argHelper->isGen(ConstStringRef("gen1").str()));
138+
EXPECT_FALSE(argHelper->isGen(ConstStringRef("gen2").str()));
139+
}
140+
141+
TEST(OclocFatBinaryAsGfxCoreIdList, GivenEnabledGfxCoreNameThenReturnsNonNullIGFX) {
142+
143+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
144+
145+
for (unsigned int coreId = 0; coreId < IGFX_MAX_CORE; ++coreId) {
146+
if (nullptr != NEO::familyName[coreId]) {
147+
EXPECT_EQ(argHelper->returnIGFXforGen(ConstStringRef(NEO::familyName[coreId]).str()), coreId);
148+
std::string caseInsensitive = NEO::familyName[coreId];
149+
std::transform(caseInsensitive.begin(), caseInsensitive.begin() + 1, caseInsensitive.begin(), ::tolower);
150+
EXPECT_EQ(argHelper->returnIGFXforGen(caseInsensitive), coreId);
151+
}
152+
}
153+
}
154+
155+
TEST(OclocFatBinaryAsGfxCoreIdList, GivenDisabledGfxCoreNameThenReturnsNullIGFX) {
156+
157+
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
158+
159+
EXPECT_EQ(argHelper->returnIGFXforGen(ConstStringRef("genA").str()), 0u);
160+
EXPECT_EQ(argHelper->returnIGFXforGen(ConstStringRef("gen0").str()), 0u);
161+
EXPECT_EQ(argHelper->returnIGFXforGen(ConstStringRef("gen1").str()), 0u);
162+
EXPECT_EQ(argHelper->returnIGFXforGen(ConstStringRef("gen2").str()), 0u);
109163
}
110164

111165
TEST(OclocFatBinaryAppendPlatformsForGfxCore, GivenCoreIdThenAppendsEnabledProductIdsThatMatch) {

shared/offline_compiler/source/multi_command.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace NEO {
1616
int MultiCommand::singleBuild(const std::vector<std::string> &args) {
1717
int retVal = OfflineCompiler::ErrorCode::SUCCESS;
1818

19-
if (requestedFatBinary(args)) {
19+
if (requestedFatBinary(args, argHelper)) {
2020
retVal = buildFatBinary(args, argHelper);
2121
} else {
2222
std::unique_ptr<OfflineCompiler> pCompiler{OfflineCompiler::create(args.size(), args, true, retVal, argHelper)};

shared/offline_compiler/source/ocloc_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ int oclocInvoke(unsigned int numArgs, const char *argv[],
102102
int retValue = OfflineCompiler::ErrorCode::SUCCESS;
103103
std::unique_ptr<MultiCommand> pMulti{(MultiCommand::create(allArgs, retValue, helper.get()))};
104104
return retValue;
105-
} else if (requestedFatBinary(allArgs)) {
105+
} else if (requestedFatBinary(allArgs, helper.get())) {
106106
return buildFatBinary(allArgs, helper.get());
107107
} else if (numArgs > 1 && ConstStringRef("validate") == allArgs[1]) {
108108
return NEO::Ocloc::validate(allArgs, helper.get());

shared/offline_compiler/source/ocloc_arg_helper.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "hw_cmds.h"
1515

16+
#include <algorithm>
1617
#include <cstring>
1718
#include <sstream>
1819

@@ -60,6 +61,13 @@ OclocArgHelper::OclocArgHelper(const uint32_t numSources, const uint8_t **dataSo
6061
for (uint32_t i = 0; i < numInputHeaders; ++i) {
6162
headers.push_back(Source(dataInputHeaders[i], static_cast<size_t>(lenInputHeaders[i]), nameInputHeaders[i]));
6263
}
64+
for (unsigned int i = 0; i < IGFX_MAX_CORE; ++i) {
65+
if (NEO::familyName[i] == nullptr)
66+
continue;
67+
std::string gen = NEO::familyName[i];
68+
std::transform(gen.begin(), gen.end(), gen.begin(), ::tolower);
69+
genIGFXMap.insert({gen, i});
70+
}
6371
}
6472

6573
OclocArgHelper::OclocArgHelper() : OclocArgHelper(0, nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr) {}
@@ -170,4 +178,20 @@ std::string OclocArgHelper::returnProductNameForDevice(unsigned short deviceId)
170178
}
171179
}
172180
return res;
181+
}
182+
183+
bool OclocArgHelper::isGen(const std::string &device) {
184+
std::string buf(device);
185+
std::transform(buf.begin(), buf.end(), buf.begin(), ::tolower);
186+
auto it = genIGFXMap.find(buf);
187+
return it == genIGFXMap.end() ? false : true;
188+
}
189+
190+
unsigned int OclocArgHelper::returnIGFXforGen(const std::string &device) {
191+
std::string buf(device);
192+
std::transform(buf.begin(), buf.end(), buf.begin(), ::tolower);
193+
auto it = genIGFXMap.find(buf);
194+
if (it == genIGFXMap.end())
195+
return 0;
196+
return it->second;
173197
}

shared/offline_compiler/source/ocloc_arg_helper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <cctype>
1313
#include <fstream>
14+
#include <map>
1415
#include <memory>
1516
#include <string>
1617
#include <vector>
@@ -53,6 +54,7 @@ class OclocArgHelper {
5354
uint64_t **lenOutputs = nullptr;
5455
bool hasOutput = false;
5556
const std::vector<DeviceProduct> deviceProductTable;
57+
std::map<std::string, unsigned int> genIGFXMap;
5658
void moveOutputs();
5759
MessagePrinter messagePrinter;
5860
Source *findSourceFile(const std::string &filename);
@@ -102,4 +104,6 @@ class OclocArgHelper {
102104
messagePrinter.printf(format, std::forward<Args>(args)...);
103105
}
104106
std::string returnProductNameForDevice(unsigned short deviceId);
107+
bool isGen(const std::string &device);
108+
unsigned int returnIGFXforGen(const std::string &device);
105109
};

shared/offline_compiler/source/ocloc_fatbinary.cpp

Lines changed: 18 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323

2424
namespace NEO {
2525

26-
bool requestedFatBinary(const std::vector<std::string> &args) {
26+
bool requestedFatBinary(const std::vector<std::string> &args, OclocArgHelper *helper) {
2727
for (size_t argIndex = 1; argIndex < args.size(); argIndex++) {
2828
const auto &currArg = args[argIndex];
2929
const bool hasMoreArgs = (argIndex + 1 < args.size());
3030
if ((ConstStringRef("-device") == currArg) && hasMoreArgs) {
3131
ConstStringRef deviceArg(args[argIndex + 1]);
32-
return deviceArg.contains("*") || deviceArg.contains("-") || deviceArg.contains(",") || deviceArg.containsCaseInsensitive("gen") || deviceArg.startsWith("XE_");
32+
return deviceArg.contains("*") || deviceArg.contains("-") || deviceArg.contains(",") || helper->isGen(deviceArg.str());
3333
}
3434
}
3535
return false;
@@ -56,34 +56,6 @@ PRODUCT_FAMILY asProductId(ConstStringRef product, const std::vector<PRODUCT_FAM
5656
return IGFX_UNKNOWN;
5757
}
5858

59-
std::vector<GFXCORE_FAMILY> asGfxCoreIdList(ConstStringRef core) {
60-
std::vector<GFXCORE_FAMILY> result;
61-
62-
constexpr size_t genPrefixLength = 3;
63-
auto coreSuffixBeg = core.begin() + genPrefixLength;
64-
size_t coreSuffixLength = core.end() - coreSuffixBeg;
65-
ConstStringRef coreSuffix(coreSuffixBeg, coreSuffixLength);
66-
67-
for (unsigned int coreId = 0; coreId < IGFX_MAX_CORE; ++coreId) {
68-
auto name = familyName[coreId];
69-
if (name == nullptr)
70-
continue;
71-
72-
auto nameSuffix = name + genPrefixLength;
73-
auto nameNumberEnd = nameSuffix;
74-
for (; *nameNumberEnd != '\0' && isdigit(*nameNumberEnd); ++nameNumberEnd)
75-
;
76-
size_t nameNumberLength = nameNumberEnd - nameSuffix;
77-
if (nameNumberLength > coreSuffixLength)
78-
continue;
79-
80-
if (ConstStringRef(nameSuffix, std::min(coreSuffixLength, strlen(nameSuffix))) == coreSuffix)
81-
result.push_back(static_cast<GFXCORE_FAMILY>(coreId));
82-
}
83-
84-
return result;
85-
}
86-
8759
void appendPlatformsForGfxCore(GFXCORE_FAMILY core, const std::vector<PRODUCT_FAMILY> &allSupportedPlatforms, std::vector<PRODUCT_FAMILY> &out) {
8860
for (auto family : allSupportedPlatforms) {
8961
if (core == hardwareInfoTable[family]->platform.eRenderCoreFamily) {
@@ -112,12 +84,14 @@ std::vector<ConstStringRef> getTargetPlatformsForFatbinary(ConstStringRef device
11284

11385
if (range.size() == 1) {
11486
// open range , from-max or min-to
115-
if (range[0].containsCaseInsensitive("gen") || range[0].startsWith("XE_")) {
116-
auto coreIdList = asGfxCoreIdList(range[0]);
117-
if (coreIdList.empty()) {
87+
if (argHelper->isGen(range[0].str())) {
88+
std::vector<GFXCORE_FAMILY> coreIdList;
89+
auto coreId = argHelper->returnIGFXforGen(range[0].str());
90+
if (coreId == 0) {
11891
argHelper->printf("Unknown device : %s\n", set.str().c_str());
11992
return {};
12093
}
94+
coreIdList.push_back(static_cast<GFXCORE_FAMILY>(coreId));
12195
if ('-' == set[0]) {
12296
// to
12397
auto coreId = coreIdList.back();
@@ -152,25 +126,22 @@ std::vector<ConstStringRef> getTargetPlatformsForFatbinary(ConstStringRef device
152126
}
153127
}
154128
} else {
155-
if (range[0].contains("gen") || range[0].startsWith("XE_")) {
156-
if (false == range[1].contains("gen") && false == range[1].startsWith("XE_")) {
129+
if (argHelper->isGen(range[0].str())) {
130+
if (false == argHelper->isGen(range[1].str())) {
157131
argHelper->printf("Ranges mixing platforms and gfxCores is not supported : %s - should be genFrom-genTo or platformFrom-platformTo\n", set.str().c_str());
158132
return {};
159133
}
160-
auto coreFromList = asGfxCoreIdList(range[0]);
161-
auto coreToList = asGfxCoreIdList(range[1]);
162-
if (coreFromList.empty()) {
134+
auto coreFrom = argHelper->returnIGFXforGen(range[0].str());
135+
auto coreTo = argHelper->returnIGFXforGen(range[1].str());
136+
if (coreFrom == 0) {
163137
argHelper->printf("Unknown device : %s\n", set.str().c_str());
164138
return {};
165139
}
166-
if (coreToList.empty()) {
140+
if (coreTo == 0) {
167141
argHelper->printf("Unknown device : %s\n", set.str().c_str());
168142
return {};
169143
}
170-
171-
auto coreFrom = coreFromList.front();
172-
auto coreTo = coreToList.back();
173-
if (coreFrom > coreTo) {
144+
if (static_cast<GFXCORE_FAMILY>(coreFrom) > static_cast<GFXCORE_FAMILY>(coreTo)) {
174145
std::swap(coreFrom, coreTo);
175146
}
176147
while (coreFrom <= coreTo) {
@@ -197,17 +168,16 @@ std::vector<ConstStringRef> getTargetPlatformsForFatbinary(ConstStringRef device
197168
requestedPlatforms.insert(requestedPlatforms.end(), from, to);
198169
}
199170
}
200-
} else if (set.containsCaseInsensitive("gen") || deviceArg.startsWith("XE_")) {
171+
} else if (argHelper->isGen(set.str())) {
201172
if (set.size() == genArg.size()) {
202173
argHelper->printf("Invalid gen-based device : %s - gen should be followed by a number\n", set.str().c_str());
203174
} else {
204-
auto coreIdList = asGfxCoreIdList(set);
205-
if (coreIdList.empty()) {
175+
auto coreId = argHelper->returnIGFXforGen(set.str());
176+
if (coreId == 0) {
206177
argHelper->printf("Unknown device : %s\n", set.str().c_str());
207178
return {};
208179
}
209-
for (auto coreId : coreIdList)
210-
appendPlatformsForGfxCore(coreId, allSupportedPlatforms, requestedPlatforms);
180+
appendPlatformsForGfxCore(static_cast<GFXCORE_FAMILY>(coreId), allSupportedPlatforms, requestedPlatforms);
211181
}
212182
} else {
213183
auto prodId = asProductId(set, allSupportedPlatforms);

shared/offline_compiler/source/ocloc_fatbinary.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 Intel Corporation
2+
* Copyright (C) 2020-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -17,11 +17,11 @@
1717
class OclocArgHelper;
1818
namespace NEO {
1919

20-
bool requestedFatBinary(const std::vector<std::string> &args);
21-
inline bool requestedFatBinary(int argc, const char *argv[]) {
20+
bool requestedFatBinary(const std::vector<std::string> &args, OclocArgHelper *helper);
21+
inline bool requestedFatBinary(int argc, const char *argv[], OclocArgHelper *helper) {
2222
std::vector<std::string> args;
2323
args.assign(argv, argv + argc);
24-
return requestedFatBinary(args);
24+
return requestedFatBinary(args, helper);
2525
}
2626

2727
int buildFatBinary(const std::vector<std::string> &args, OclocArgHelper *argHelper);
@@ -34,7 +34,6 @@ inline int buildFatBinary(int argc, const char *argv[], OclocArgHelper *argHelpe
3434
std::vector<PRODUCT_FAMILY> getAllSupportedTargetPlatforms();
3535
std::vector<ConstStringRef> toProductNames(const std::vector<PRODUCT_FAMILY> &productIds);
3636
PRODUCT_FAMILY asProductId(ConstStringRef product, const std::vector<PRODUCT_FAMILY> &allSupportedPlatforms);
37-
std::vector<GFXCORE_FAMILY> asGfxCoreIdList(ConstStringRef core);
3837
void appendPlatformsForGfxCore(GFXCORE_FAMILY core, const std::vector<PRODUCT_FAMILY> &allSupportedPlatforms, std::vector<PRODUCT_FAMILY> &out);
3938
std::vector<ConstStringRef> getTargetPlatformsForFatbinary(ConstStringRef deviceArg, OclocArgHelper *argHelper);
4039

shared/offline_compiler/source/offline_compiler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ int OfflineCompiler::getHardwareInfo(std::string deviceName) {
289289
int retVal = INVALID_DEVICE;
290290

291291
overridePlatformName(deviceName);
292+
std::transform(deviceName.begin(), deviceName.end(), deviceName.begin(), ::tolower);
292293

293294
const char hexPrefix = 2;
294295
std::string product("");

0 commit comments

Comments
 (0)