mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Improve getDevice methods
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
a9226a9113
commit
cb91474b1a
@ -560,7 +560,7 @@ HWTEST_F(LowPriorityCommandQueueTest, GivenDeviceWithSubdevicesWhenCreatingLowPr
|
||||
auto cmdQ = clCreateCommandQueueWithProperties(&context, context.getDevice(0), properties, nullptr);
|
||||
|
||||
auto commandQueueObj = castToObject<CommandQueue>(cmdQ);
|
||||
auto subDevice = context.getDevice(0)->getDeviceById(0);
|
||||
auto subDevice = context.getDevice(0)->getSubDevice(0);
|
||||
auto &engine = subDevice->getEngine(getChosenEngineType(subDevice->getHardwareInfo()), EngineUsage::LowPriority);
|
||||
|
||||
EXPECT_EQ(engine.commandStreamReceiver, &commandQueueObj->getGpgpuCommandStreamReceiver());
|
||||
|
@ -93,8 +93,8 @@ TEST_F(clCreateSubDevicesTests, GivenValidInputWhenCreatingSubDevicesThenSubDevi
|
||||
|
||||
auto retVal = clCreateSubDevices(device.get(), properties, outDevicesCount, outDevices, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(device->getDeviceById(0), outDevices[0]);
|
||||
EXPECT_EQ(device->getDeviceById(1), outDevices[1]);
|
||||
EXPECT_EQ(device->getSubDevice(0), outDevices[0]);
|
||||
EXPECT_EQ(device->getSubDevice(1), outDevices[1]);
|
||||
|
||||
properties[1] = CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE;
|
||||
cl_device_id outDevices2[2];
|
||||
@ -107,18 +107,18 @@ TEST_F(clCreateSubDevicesTests, GivenValidInputWhenCreatingSubDevicesThenSubDevi
|
||||
TEST_F(clCreateSubDevicesTests, GivenValidInputWhenCreatingSubDevicesThenDeviceApiReferenceCountIsIncreasedEveryTime) {
|
||||
setup(2);
|
||||
|
||||
EXPECT_EQ(0, device->getDeviceById(0)->getRefApiCount());
|
||||
EXPECT_EQ(0, device->getDeviceById(1)->getRefApiCount());
|
||||
EXPECT_EQ(0, device->getSubDevice(0)->getRefApiCount());
|
||||
EXPECT_EQ(0, device->getSubDevice(1)->getRefApiCount());
|
||||
|
||||
auto retVal = clCreateSubDevices(device.get(), properties, outDevicesCount, outDevices, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(1, device->getDeviceById(0)->getRefApiCount());
|
||||
EXPECT_EQ(1, device->getDeviceById(1)->getRefApiCount());
|
||||
EXPECT_EQ(1, device->getSubDevice(0)->getRefApiCount());
|
||||
EXPECT_EQ(1, device->getSubDevice(1)->getRefApiCount());
|
||||
|
||||
retVal = clCreateSubDevices(device.get(), properties, outDevicesCount, outDevices, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(2, device->getDeviceById(0)->getRefApiCount());
|
||||
EXPECT_EQ(2, device->getDeviceById(1)->getRefApiCount());
|
||||
EXPECT_EQ(2, device->getSubDevice(0)->getRefApiCount());
|
||||
EXPECT_EQ(2, device->getSubDevice(1)->getRefApiCount());
|
||||
}
|
||||
|
||||
struct clCreateSubDevicesDeviceInfoTests : clCreateSubDevicesTests {
|
||||
|
Reference in New Issue
Block a user