Fix ocloc -device option

Related-To: NEO-4782

Change-Id: I2e7752a4f9f1bdf4cc1c45549e39139d8e77b89f
Signed-off-by: Konstanty Misiak <konstanty.misiak@intel.com>
This commit is contained in:
Konstanty Misiak
2020-06-25 10:56:53 +02:00
committed by sys_ocldev
parent d712a015b4
commit 0ca7e5b5ae
4 changed files with 69 additions and 31 deletions

View File

@ -89,22 +89,22 @@ TEST(OclocFatBinaryAsProductId, GivenDisabledPlatformNameThenReturnsUnknownPlatf
}
}
TEST(OclocFatBinaryAsGfxCoreId, GivenEnabledGfxCoreNameThenReturnsProperGfxCoreId) {
TEST(OclocFatBinaryAsGfxCoreIdList, GivenEnabledGfxCoreNameThenReturnsNonEmptyList) {
for (unsigned int coreId = 0; coreId < IGFX_MAX_CORE; ++coreId) {
if (nullptr != NEO::familyName[coreId]) {
EXPECT_NE(IGFX_UNKNOWN_CORE, NEO::asGfxCoreId(ConstStringRef(NEO::familyName[coreId], strlen(NEO::familyName[coreId]))));
EXPECT_FALSE(NEO::asGfxCoreIdList(ConstStringRef(NEO::familyName[coreId], strlen(NEO::familyName[coreId]))).empty());
std::string caseInsesitive = NEO::familyName[coreId];
caseInsesitive[0] = 'g';
EXPECT_NE(IGFX_UNKNOWN_CORE, NEO::asGfxCoreId(caseInsesitive));
EXPECT_FALSE(NEO::asGfxCoreIdList(caseInsesitive).empty());
}
}
}
TEST(OclocFatBinaryAsGfxCoreId, GivenDisabledGfxCoreNameThenReturnsProperGfxCoreId) {
EXPECT_EQ(IGFX_UNKNOWN_CORE, NEO::asGfxCoreId(ConstStringRef("genA")));
EXPECT_EQ(IGFX_UNKNOWN_CORE, NEO::asGfxCoreId(ConstStringRef("gen0")));
EXPECT_EQ(IGFX_UNKNOWN_CORE, NEO::asGfxCoreId(ConstStringRef("gen1")));
EXPECT_EQ(IGFX_UNKNOWN_CORE, NEO::asGfxCoreId(ConstStringRef("gen2")));
TEST(OclocFatBinaryAsGfxCoreIdList, GivenDisabledGfxCoreNameThenReturnsEmptyList) {
EXPECT_TRUE(NEO::asGfxCoreIdList(ConstStringRef("genA")).empty());
EXPECT_TRUE(NEO::asGfxCoreIdList(ConstStringRef("gen0")).empty());
EXPECT_TRUE(NEO::asGfxCoreIdList(ConstStringRef("gen1")).empty());
EXPECT_TRUE(NEO::asGfxCoreIdList(ConstStringRef("gen2")).empty());
}
TEST(OclocFatBinaryAppendPlatformsForGfxCore, GivenCoreIdThenAppendsEnabledProductIdsThatMatch) {