mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 17:33:00 +08:00
Update sub device internal ref counts
Change-Id: I82eea99bbb3d1edc32d09c0b703dee30b62f6b76 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
6d4832fe24
commit
f2c11eb870
@@ -69,6 +69,23 @@ ClDevice::~ClDevice() {
|
||||
device.decRefInternal();
|
||||
}
|
||||
|
||||
void ClDevice::incRefInternal() {
|
||||
if (deviceInfo.parentDevice == nullptr) {
|
||||
BaseObject<_cl_device_id>::incRefInternal();
|
||||
return;
|
||||
}
|
||||
auto pParentDevice = static_cast<ClDevice *>(deviceInfo.parentDevice);
|
||||
pParentDevice->incRefInternal();
|
||||
}
|
||||
|
||||
unique_ptr_if_unused<ClDevice> ClDevice::decRefInternal() {
|
||||
if (deviceInfo.parentDevice == nullptr) {
|
||||
return BaseObject<_cl_device_id>::decRefInternal();
|
||||
}
|
||||
auto pParentDevice = static_cast<ClDevice *>(deviceInfo.parentDevice);
|
||||
return pParentDevice->decRefInternal();
|
||||
}
|
||||
|
||||
void ClDevice::allocateSyncBufferHandler() {
|
||||
TakeOwnershipWrapper<ClDevice> lock(*this);
|
||||
if (syncBufferHandler.get() == nullptr) {
|
||||
|
||||
@@ -51,6 +51,9 @@ class ClDevice : public BaseObject<_cl_device_id> {
|
||||
explicit ClDevice(Device &device, Platform *platformId);
|
||||
~ClDevice() override;
|
||||
|
||||
void incRefInternal();
|
||||
unique_ptr_if_unused<ClDevice> decRefInternal();
|
||||
|
||||
unsigned int getEnabledClVersion() const { return enabledClVersion; };
|
||||
unsigned int getSupportedClVersion() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user