Pass device index to create method..

Change-Id: Iab493edf1b96a6cecf6e3dba6813824529f0c08b
This commit is contained in:
Mrozek, Michal
2018-09-11 11:28:19 +02:00
committed by sys_ocldev
parent d24a0accd9
commit 377b99be90
15 changed files with 54 additions and 58 deletions

View File

@ -248,7 +248,7 @@ TEST(Device_GetCaps, givenDeviceWithMidThreadPreemptionWhenDeviceIsCreatedThenSi
auto executionEnvironment = new ExecutionEnvironment();
executionEnvironment->builtins.reset(builtIns);
auto device = std::unique_ptr<Device>(MockDevice::createWithExecutionEnvironment<MockDevice>(platformDevices[0], executionEnvironment));
auto device = std::unique_ptr<Device>(MockDevice::createWithExecutionEnvironment<MockDevice>(platformDevices[0], executionEnvironment, 0u));
ASSERT_EQ(builtIns, device->getExecutionEnvironment()->getBuiltIns());
EXPECT_TRUE(builtIns->getSipKernelCalled);
}

View File

@ -181,8 +181,8 @@ TEST(DeviceCreation, givenDeviceWhenItIsCreatedThenOsContextIsRegistredInMemoryM
TEST(DeviceCreation, givenMultiDeviceWhenTheyAreCreatedThenEachOsContextHasUniqueId) {
ExecutionEnvironment executionEnvironment;
executionEnvironment.incRefInternal();
auto device = std::unique_ptr<Device>(Device::create<Device>(nullptr, &executionEnvironment));
auto device2 = std::unique_ptr<Device>(Device::create<Device>(nullptr, &executionEnvironment));
auto device = std::unique_ptr<Device>(Device::create<Device>(nullptr, &executionEnvironment, 0u));
auto device2 = std::unique_ptr<Device>(Device::create<Device>(nullptr, &executionEnvironment, 1u));
EXPECT_EQ(0u, device->getOsContext()->getContextId());
EXPECT_EQ(1u, device2->getOsContext()->getContextId());
@ -192,8 +192,8 @@ TEST(DeviceCreation, givenMultiDeviceWhenTheyAreCreatedThenEachOsContextHasUniqu
TEST(DeviceCreation, givenMultiDeviceWhenTheyAreCreatedThenEachDeviceHasSeperateDeviceIndex) {
ExecutionEnvironment executionEnvironment;
executionEnvironment.incRefInternal();
auto device = std::unique_ptr<Device>(Device::create<Device>(nullptr, &executionEnvironment));
auto device2 = std::unique_ptr<Device>(Device::create<Device>(nullptr, &executionEnvironment));
auto device = std::unique_ptr<Device>(Device::create<Device>(nullptr, &executionEnvironment, 0u));
auto device2 = std::unique_ptr<Device>(Device::create<Device>(nullptr, &executionEnvironment, 1u));
EXPECT_EQ(0u, device->getDeviceIndex());
EXPECT_EQ(1u, device2->getDeviceIndex());