mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Add trailing space to compiler extensions string
Change-Id: Ib9e2f33916dd1475defc60bfc297ef36fc87eb03
This commit is contained in:
committed by
sys_ocldev
parent
f5baa783de
commit
d447c8c951
@@ -83,7 +83,7 @@ std::string convertEnabledExtensionsToCompilerInternalOptions(const char *enable
|
|||||||
while ((pos = extensionsList.find(" ", pos)) != std::string::npos) {
|
while ((pos = extensionsList.find(" ", pos)) != std::string::npos) {
|
||||||
extensionsList.replace(pos, 1, ",+");
|
extensionsList.replace(pos, 1, ",+");
|
||||||
}
|
}
|
||||||
extensionsList = " -cl-ext=-all,+" + extensionsList;
|
extensionsList = " -cl-ext=-all,+" + extensionsList + " ";
|
||||||
return extensionsList;
|
return extensionsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ TEST_F(PlatformFailingTest, givenPlatformInitializationWhenIncorrectHwInfoThenIn
|
|||||||
delete platform;
|
delete platform;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(PlatformTest, getAsCompilerEnabledExtensionsString) {
|
TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatchingSubstringsAndMandatoryTrailingSpace) {
|
||||||
const HardwareInfo *hwInfo;
|
const HardwareInfo *hwInfo;
|
||||||
hwInfo = platformDevices[0];
|
hwInfo = platformDevices[0];
|
||||||
std::string extensionsList = getExtensionsList(*hwInfo);
|
std::string extensionsList = getExtensionsList(*hwInfo);
|
||||||
@@ -165,9 +165,11 @@ TEST_F(PlatformTest, getAsCompilerEnabledExtensionsString) {
|
|||||||
if (hwInfo->capabilityTable.ftrSupportsFP64) {
|
if (hwInfo->capabilityTable.ftrSupportsFP64) {
|
||||||
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_fp64")));
|
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_fp64")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPECT_THAT(compilerExtensions, ::testing::EndsWith(std::string(" ")));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(PlatformTest, getAsCompilerEnabledExtensionsStringTestNotFP64) {
|
TEST_F(PlatformTest, givenNotSupportingCl21WhenPlatformNotSupportFp64ThenNotFillMatchingSubstringAndFillMandatoryTrailingSpace) {
|
||||||
HardwareInfo TesthwInfo = *platformDevices[0];
|
HardwareInfo TesthwInfo = *platformDevices[0];
|
||||||
TesthwInfo.capabilityTable.ftrSupportsFP64 = false;
|
TesthwInfo.capabilityTable.ftrSupportsFP64 = false;
|
||||||
TesthwInfo.capabilityTable.clVersionSupport = 10;
|
TesthwInfo.capabilityTable.clVersionSupport = 10;
|
||||||
@@ -180,6 +182,8 @@ TEST_F(PlatformTest, getAsCompilerEnabledExtensionsStringTestNotFP64) {
|
|||||||
|
|
||||||
EXPECT_THAT(compilerExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_khr_fp64"))));
|
EXPECT_THAT(compilerExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_khr_fp64"))));
|
||||||
EXPECT_THAT(compilerExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_khr_subgroups"))));
|
EXPECT_THAT(compilerExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_khr_subgroups"))));
|
||||||
|
|
||||||
|
EXPECT_THAT(compilerExtensions, ::testing::EndsWith(std::string(" ")));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(PlatformTest, testRemoveLastSpace) {
|
TEST_F(PlatformTest, testRemoveLastSpace) {
|
||||||
|
|||||||
Reference in New Issue
Block a user