mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Fix casts between Device, DeviceImp and device handle
Change-Id: Ib267239cd041aa812e7d4d7e5cda6daf5b4b6d2c Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
0443b97927
commit
0d7d2c0be0
@@ -65,7 +65,7 @@ void DeviceImp::setDriverHandle(DriverHandle *driverHandle) {
|
||||
ze_result_t DeviceImp::canAccessPeer(ze_device_handle_t hPeerDevice, ze_bool_t *value) {
|
||||
*value = false;
|
||||
|
||||
DeviceImp *pPeerDevice = reinterpret_cast<DeviceImp *>(Device::fromHandle(hPeerDevice));
|
||||
DeviceImp *pPeerDevice = static_cast<DeviceImp *>(Device::fromHandle(hPeerDevice));
|
||||
if (this->getNEODevice()->getRootDeviceIndex() == pPeerDevice->getNEODevice()->getRootDeviceIndex()) {
|
||||
*value = true;
|
||||
}
|
||||
@@ -597,7 +597,7 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, uint3
|
||||
if (subDevice == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
reinterpret_cast<DeviceImp *>(subDevice)->isSubdevice = true;
|
||||
static_cast<DeviceImp *>(subDevice)->isSubdevice = true;
|
||||
device->subDevices.push_back(static_cast<Device *>(subDevice));
|
||||
}
|
||||
device->numSubDevices = static_cast<uint32_t>(device->subDevices.size());
|
||||
|
||||
@@ -253,6 +253,7 @@ TEST_F(MultipleDevicesTest, whenRetrievingNumberOfSubdevicesThenCorrectNumberIsR
|
||||
EXPECT_EQ(numSubDevices, count);
|
||||
for (auto subDevice : subDevices) {
|
||||
EXPECT_NE(nullptr, subDevice);
|
||||
EXPECT_TRUE(static_cast<DeviceImp *>(subDevice)->isSubdevice);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user