Do not use max power saving mode in VA sharing scenarios.

-This can be achieved by passing CL_QUEUE_THROTTLE_LOW_KHR as throttle hint
to command queue.
- This gives much better control about the granularity of this feature
instead of triggering this for the whole context user may still have
power saving mode queues.

Change-Id: I066729f963119ddc1f62ad2785c342af2fea588e
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
Mrozek, Michal
2019-05-07 14:24:13 +02:00
committed by sys_ocldev
parent cadc461712
commit bc35cd250a
8 changed files with 1 additions and 98 deletions

View File

@@ -235,59 +235,3 @@ TEST(Context, givenMockSharingBuilderWhenContextWithInvalidPropertiesThenContext
context.reset(Context::create<Context>(validProperties, deviceVector, nullptr, nullptr, retVal));
EXPECT_NE(nullptr, context.get());
};
TEST(Context, GivenVaContextWhenItIsCreatedItInitializesPowerSavingMode) {
SharingFactoryStateRestore stateRestore;
stateRestore.clearCurrentState();
stateRestore.registerSharing<VAMockSharingBuilderFactory>(SharingType::VA_SHARING);
auto device = std::make_unique<MockDevice>(*platformDevices[0]);
cl_device_id clDevice = static_cast<cl_device_id>(device.get());
cl_int retVal;
cl_platform_id platformId[] = {platform()};
auto &commandStreamReceiver = device->getCommandStreamReceiver();
auto kmdNotifyHelper = commandStreamReceiver.peekKmdNotifyHelper();
int64_t timeout = 0;
kmdNotifyHelper->obtainTimeoutParams(timeout, true, 1, 10, 2, false);
EXPECT_NE(1, timeout);
cl_context_properties validProperties[5] = {CL_CONTEXT_PLATFORM, (cl_context_properties)platformId[0],
clContextPropertyMock, mockContextPassFinalize, 0};
std::unique_ptr<MockContext> ctx(Context::create<MockContext>(validProperties, DeviceVector(&clDevice, 1), nullptr, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, ctx);
kmdNotifyHelper->obtainTimeoutParams(timeout, true, 1, 10, 2, false);
EXPECT_EQ(1, timeout);
}
TEST(Context, GivenNonVaContextWhenItIsCreatedItInitializesPowerSavingMode) {
SharingFactoryStateRestore stateRestore;
stateRestore.clearCurrentState();
stateRestore.registerSharing<MockSharingBuilderFactory>(SharingType::CLGL_SHARING);
auto device = std::make_unique<MockDevice>(*platformDevices[0]);
cl_device_id clDevice = static_cast<cl_device_id>(device.get());
cl_int retVal;
cl_platform_id platformId[] = {platform()};
auto &commandStreamReceiver = device->getCommandStreamReceiver();
auto kmdNotifyHelper = commandStreamReceiver.peekKmdNotifyHelper();
int64_t timeout = 0;
kmdNotifyHelper->obtainTimeoutParams(timeout, true, 1, 10, 2, false);
EXPECT_NE(1, timeout);
cl_context_properties validProperties[5] = {CL_CONTEXT_PLATFORM, (cl_context_properties)platformId[0],
clContextPropertyMock, mockContextPassFinalize, 0};
std::unique_ptr<MockContext> ctx(Context::create<MockContext>(validProperties, DeviceVector(&clDevice, 1), nullptr, nullptr, retVal));
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, ctx);
kmdNotifyHelper->obtainTimeoutParams(timeout, true, 1, 10, 2, false);
EXPECT_NE(1, timeout);
}