Disable sharing extensions on specific configs

Change-Id: Ib2be6e797095bf771c618ba3515236e3f3eb16c6
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Resolves: NEO-4010
This commit is contained in:
Kamil Kopryk
2020-01-21 13:43:34 +01:00
committed by sys_ocldev
parent 522dedfbd2
commit bb8dd181a7
2 changed files with 22 additions and 1 deletions

View File

@ -181,7 +181,10 @@ void Device::initializeCaps() {
deviceExtensions += "cl_intel_media_block_io ";
}
deviceExtensions += sharingFactory.getExtensions();
auto sharingAllowed = (HwHelper::getSubDevicesCount(&hwInfo) == 1u);
if (sharingAllowed) {
deviceExtensions += sharingFactory.getExtensions();
}
deviceExtensions += hwHelper.getExtensions();

View File

@ -366,6 +366,24 @@ TEST_F(DeviceGetCapsTest, DISABLED_givenDeviceWhenCapsAreCreateThenClGLSharingIs
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_gl_sharing ")));
}
TEST_F(DeviceGetCapsTest, givenEnableSharingFormatQuerySetTrueAndDisabledMultipleSubDevicesWhenDeviceCapsAreCreatedThenSharingFormatQueryIsReported) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableFormatQuery.set(true);
DebugManager.flags.CreateMultipleSubDevices.set(0);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_sharing_format_query ")));
}
TEST_F(DeviceGetCapsTest, givenEnableSharingFormatQuerySetTrueAndEnabledMultipleSubDevicesWhenDeviceCapsAreCreatedThenSharingFormatQueryIsNotReported) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableFormatQuery.set(true);
DebugManager.flags.CreateMultipleSubDevices.set(2);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_intel_sharing_format_query "))));
}
TEST_F(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClKhrSubgroupsExtension) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceOCLVersion.set(21);