P4 to Git Change 1561216 by gandryey@gera-w8 on 2018/05/29 18:05:31

SWDEV-79445 - OCL generic changes and code clean-up
	- Remove parent_ field from the device object, since it was used for subdevices only.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_device.cpp#72 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#219 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#304 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#590 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#91 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.cpp#52 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#94 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.hpp#45 edit
This commit is contained in:
foreman
2018-05-29 18:13:40 -04:00
parent a36ef232f2
commit 12315470b7
7 changed files with 13 additions and 77 deletions
+1 -38
View File
@@ -1411,24 +1411,12 @@ class Device : public RuntimeObject {
virtual Compiler* compiler() const = 0;
Device(Device* parent = NULL);
Device();
virtual ~Device();
//! Initializes abstraction layer device object
bool create();
//! Increment the reference count
uint retain() {
// Only increment the reference count of sub-devices
return !isRootDevice() ? RuntimeObject::retain() : 0u;
}
//! Decrement the reference count
uint release() {
// Only decrement the reference count of sub-devices
return !isRootDevice() ? RuntimeObject::release() : 0u;
}
//! Register a device as available
void registerDevice();
@@ -1561,30 +1549,6 @@ class Device : public RuntimeObject {
//! Returns TRUE if the device is available for computations
bool isOnline() const { return online_; }
//! Returns TRUE if the device is a root device (as opposed to sub-device)
bool isRootDevice() const { return parent_ == NULL; }
//! Returns TRUE if 'this' is an ancestor of the given sub-device.
bool isAncestor(const Device* sub) const;
//! Return the parent device.
Device* parent() const { return parent_; }
//! Return the root device for this instance;
Device& rootDevice() {
Device* root = this;
while (!root->isRootDevice()) {
root = root->parent_;
}
return *root;
}
const Device& rootDevice() const {
const Device* root = this;
while (!root->isRootDevice()) {
root = root->parent_;
}
return *root;
}
//! Returns device settings
const device::Settings& settings() const { return *settings_; }
@@ -1643,7 +1607,6 @@ class Device : public RuntimeObject {
static std::vector<Device*>* devices_; //!< All known devices
Device* parent_; //!< This device's parent
Monitor* vaCacheAccess_; //!< Lock to serialize VA caching access
std::map<uintptr_t, device::Memory*>* vaCacheMap_; //!< VA cache map
};