mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Add method to get total number of devices in context
Related-To: NEO-3691 Change-Id: I6e468118f99967a40dd8dce30013ada2142ca727 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
68f8e2bade
commit
09c775f347
@@ -249,6 +249,14 @@ size_t Context::getNumDevices() const {
|
||||
return devices.size();
|
||||
}
|
||||
|
||||
size_t Context::getTotalNumDevices() const {
|
||||
size_t numAvailableDevices = 0u;
|
||||
for (auto &device : devices) {
|
||||
numAvailableDevices += device->getNumAvailableDevices();
|
||||
}
|
||||
return numAvailableDevices;
|
||||
}
|
||||
|
||||
Device *Context::getDevice(size_t deviceOrdinal) {
|
||||
return (Device *)devices[deviceOrdinal];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user